overview-components 1.0.79 → 1.0.80
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.js +70 -72
- package/dist/assets/generated/locales/de.js.map +1 -0
- package/dist/assets/generated/locales/en.js +70 -72
- package/dist/assets/generated/locales/en.js.map +1 -0
- package/dist/assets/generated/locales/fr.js +70 -72
- package/dist/assets/generated/locales/fr.js.map +1 -0
- package/dist/assets/generated/locales/hr.js +70 -72
- package/dist/assets/generated/locales/hr.js.map +1 -0
- package/dist/assets/generated/locales/it.js +70 -72
- package/dist/assets/generated/locales/it.js.map +1 -0
- package/dist/assets/generated/locales/pl.js +70 -72
- package/dist/assets/generated/locales/pl.js.map +1 -0
- package/dist/assets/generated/locales/ro.js +70 -72
- package/dist/assets/generated/locales/ro.js.map +1 -0
- package/dist/assets/generated/locales/sk.js +70 -72
- package/dist/assets/generated/locales/sk.js.map +1 -0
- package/dist/assets/generated/locales/sr.js +70 -72
- package/dist/assets/generated/locales/sr.js.map +1 -0
- package/dist/assets/icons/iconGlyphs.js +678 -679
- package/dist/assets/icons/iconGlyphs.js.map +1 -0
- package/dist/assets/illustration/delete-illustration.js +96 -0
- package/dist/assets/illustration/delete-illustration.js.map +1 -0
- package/dist/assets/illustration/no-content.js +167 -0
- package/dist/assets/illustration/no-content.js.map +1 -0
- package/dist/assets/illustration/no-preview.js +133 -0
- package/dist/assets/illustration/no-preview.js.map +1 -0
- package/dist/assets/illustration/not-found.js +106 -0
- package/dist/assets/illustration/not-found.js.map +1 -0
- package/dist/assets/illustration/settings-illustration.js +176 -0
- package/dist/assets/illustration/settings-illustration.js.map +1 -0
- package/dist/components/components-settings/attachments-tab-settings.js +226 -0
- package/dist/components/components-settings/attachments-tab-settings.js.map +1 -0
- package/dist/components/components-settings/data-grid-settings.js +318 -0
- package/dist/components/components-settings/data-grid-settings.js.map +1 -0
- package/dist/components/components-settings/section-tab-settings.js +269 -0
- package/dist/components/components-settings/section-tab-settings.js.map +1 -0
- package/dist/components/components-settings/tabs-overview-settings.js +439 -0
- package/dist/components/components-settings/tabs-overview-settings.js.map +1 -0
- package/dist/components/lit-attachments-tab.js +432 -271
- package/dist/components/lit-attachments-tab.js.map +1 -0
- package/dist/components/lit-badge.js +40 -40
- package/dist/components/lit-badge.js.map +1 -0
- package/dist/components/lit-case-variables-tab.js +497 -382
- package/dist/components/lit-case-variables-tab.js.map +1 -0
- package/dist/components/lit-chart.js +406 -378
- package/dist/components/lit-chart.js.map +1 -0
- package/dist/components/lit-data-grid-tanstack.js +1663 -1150
- package/dist/components/lit-data-grid-tanstack.js.map +1 -0
- package/dist/components/lit-filter-modal.js +230 -198
- package/dist/components/lit-filter-modal.js.map +1 -0
- package/dist/components/lit-multiselect-item.js +477 -301
- package/dist/components/lit-multiselect-item.js.map +1 -0
- package/dist/components/lit-section-tab.js +85 -73
- package/dist/components/lit-section-tab.js.map +1 -0
- package/dist/components/lit-tabs-overview.js +232 -191
- package/dist/components/lit-tabs-overview.js.map +1 -0
- package/dist/components/modals/lit-confirm-modal.js +120 -0
- package/dist/components/modals/lit-confirm-modal.js.map +1 -0
- package/dist/components/modals/lit-delete-modal.js +128 -0
- package/dist/components/modals/lit-delete-modal.js.map +1 -0
- package/dist/components/react-wrappers/attachments-tab.js +8 -13
- package/dist/components/react-wrappers/attachments-tab.js.map +1 -0
- package/dist/components/react-wrappers/badge.js +8 -13
- package/dist/components/react-wrappers/badge.js.map +1 -0
- package/dist/components/react-wrappers/button.js +8 -13
- package/dist/components/react-wrappers/button.js.map +1 -0
- package/dist/components/react-wrappers/case-variables-tab.js +8 -13
- package/dist/components/react-wrappers/case-variables-tab.js.map +1 -0
- package/dist/components/react-wrappers/chart.js +8 -13
- package/dist/components/react-wrappers/chart.js.map +1 -0
- package/dist/components/react-wrappers/data-grid-tanstack.js +8 -13
- package/dist/components/react-wrappers/data-grid-tanstack.js.map +1 -0
- package/dist/components/react-wrappers/filter-modal.js +8 -13
- package/dist/components/react-wrappers/filter-modal.js.map +1 -0
- package/dist/components/react-wrappers/progress-bar.js +8 -13
- package/dist/components/react-wrappers/progress-bar.js.map +1 -0
- package/dist/components/react-wrappers/section-tab.js +8 -13
- package/dist/components/react-wrappers/section-tab.js.map +1 -0
- package/dist/components/react-wrappers/tabs-overview.js +8 -13
- package/dist/components/react-wrappers/tabs-overview.js.map +1 -0
- package/dist/data/translations.js +2763 -0
- package/dist/data/translations.js.map +1 -0
- package/dist/index.js +107 -113
- package/dist/index.js.map +1 -0
- package/dist/schemas/index.js +17 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/lit-attachments-tab-document.schema.js +20 -0
- package/dist/schemas/lit-attachments-tab-document.schema.js.map +1 -0
- package/dist/schemas/lit-attachments-tab-settings-value.schema.js +15 -0
- package/dist/schemas/lit-attachments-tab-settings-value.schema.js.map +1 -0
- package/dist/schemas/lit-attachments-tab.schema.js +32 -0
- package/dist/schemas/lit-attachments-tab.schema.js.map +1 -0
- package/dist/schemas/lit-case-variables-tab-cell.schema.js +43 -0
- package/dist/schemas/lit-case-variables-tab-cell.schema.js.map +1 -0
- package/dist/schemas/lit-case-variables-tab-rows.schema.js +6 -0
- package/dist/schemas/lit-case-variables-tab-rows.schema.js.map +1 -0
- package/dist/schemas/lit-case-variables-tab.schema.js +24 -0
- package/dist/schemas/lit-case-variables-tab.schema.js.map +1 -0
- package/dist/schemas/lit-data-grid-tanstack-column-array.schema.js +6 -0
- package/dist/schemas/lit-data-grid-tanstack-column-array.schema.js.map +1 -0
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter-array.schema.js +6 -0
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter-array.schema.js.map +1 -0
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter.schema.js +11 -0
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter.schema.js.map +1 -0
- package/dist/schemas/lit-data-grid-tanstack-column.schema.js +55 -0
- package/dist/schemas/lit-data-grid-tanstack-column.schema.js.map +1 -0
- package/dist/schemas/lit-data-grid-tanstack.schema.js +99 -0
- package/dist/schemas/lit-data-grid-tanstack.schema.js.map +1 -0
- package/dist/schemas/lit-section-tab-schema.js +24 -0
- package/dist/schemas/lit-section-tab-schema.js.map +1 -0
- package/dist/schemas/lit-tabs-overview-tab-array.schema.js +6 -0
- package/dist/schemas/lit-tabs-overview-tab-array.schema.js.map +1 -0
- package/dist/schemas/lit-tabs-overview-tab.schema.js +32 -0
- package/dist/schemas/lit-tabs-overview-tab.schema.js.map +1 -0
- package/dist/schemas/lit-tabs-overview.schema.js +29 -0
- package/dist/schemas/lit-tabs-overview.schema.js.map +1 -0
- package/dist/scripts/translate-locales.js +69 -0
- package/dist/scripts/translate-locales.js.map +1 -0
- package/dist/shared/filter-inputs.js +335 -234
- package/dist/shared/filter-inputs.js.map +1 -0
- package/dist/shared/lit-button.js +80 -66
- package/dist/shared/lit-button.js.map +1 -0
- package/dist/shared/lit-case-variables-tab-cell.js +127 -108
- package/dist/shared/lit-case-variables-tab-cell.js.map +1 -0
- package/dist/shared/lit-checkbox.js +94 -78
- package/dist/shared/lit-checkbox.js.map +1 -0
- package/dist/shared/lit-custom-popper.js +84 -66
- package/dist/shared/lit-custom-popper.js.map +1 -0
- package/dist/shared/lit-data-grid-action-buttons-popover.js +178 -141
- package/dist/shared/lit-data-grid-action-buttons-popover.js.map +1 -0
- package/dist/shared/lit-data-grid-density-popover.js +54 -49
- package/dist/shared/lit-data-grid-density-popover.js.map +1 -0
- package/dist/shared/lit-data-grid-export-popover.js +43 -41
- package/dist/shared/lit-data-grid-export-popover.js.map +1 -0
- package/dist/shared/lit-data-grid-operators-popover.js +90 -70
- package/dist/shared/lit-data-grid-operators-popover.js.map +1 -0
- package/dist/shared/lit-data-grid-row-actions.js +54 -51
- package/dist/shared/lit-data-grid-row-actions.js.map +1 -0
- package/dist/shared/lit-date-picker.js +451 -370
- package/dist/shared/lit-date-picker.js.map +1 -0
- package/dist/shared/lit-icon-button.js +66 -52
- package/dist/shared/lit-icon-button.js.map +1 -0
- package/dist/shared/lit-icon.js +261 -259
- package/dist/shared/lit-icon.js.map +1 -0
- package/dist/shared/lit-input.js +143 -115
- package/dist/shared/lit-input.js.map +1 -0
- package/dist/shared/lit-label.js +63 -55
- package/dist/shared/lit-label.js.map +1 -0
- package/dist/shared/lit-loader.js +26 -27
- package/dist/shared/lit-loader.js.map +1 -0
- package/dist/shared/lit-loading-bar.js +57 -24
- package/dist/shared/lit-loading-bar.js.map +1 -0
- package/dist/shared/lit-menu-item.js +56 -51
- package/dist/shared/lit-menu-item.js.map +1 -0
- package/dist/shared/lit-menu.js +22 -20
- package/dist/shared/lit-menu.js.map +1 -0
- package/dist/shared/lit-modal-body.js +9 -15
- package/dist/shared/lit-modal-body.js.map +1 -0
- package/dist/shared/lit-modal-footer.js +17 -20
- package/dist/shared/lit-modal-footer.js.map +1 -0
- package/dist/shared/lit-modal-header.js +24 -27
- package/dist/shared/lit-modal-header.js.map +1 -0
- package/dist/shared/lit-modal.js +112 -71
- package/dist/shared/lit-modal.js.map +1 -0
- package/dist/shared/lit-overflow-tooltip.js +86 -68
- package/dist/shared/lit-overflow-tooltip.js.map +1 -0
- package/dist/shared/lit-pill.js +39 -37
- package/dist/shared/lit-pill.js.map +1 -0
- package/dist/shared/lit-progress-bar.js +33 -35
- package/dist/shared/lit-progress-bar.js.map +1 -0
- package/dist/shared/lit-responsive-button.js +74 -64
- package/dist/shared/lit-responsive-button.js.map +1 -0
- package/dist/shared/lit-select-field.js +266 -183
- package/dist/shared/lit-select-field.js.map +1 -0
- package/dist/shared/lit-select.js +276 -202
- package/dist/shared/lit-select.js.map +1 -0
- package/dist/shared/lit-settings.js +68 -51
- package/dist/shared/lit-settings.js.map +1 -0
- package/dist/shared/lit-text-field.js +99 -82
- package/dist/shared/lit-text-field.js.map +1 -0
- package/dist/shared/lit-toggle.js +74 -65
- package/dist/shared/lit-toggle.js.map +1 -0
- package/dist/shared/lit-tooltip.js +113 -84
- package/dist/shared/lit-tooltip.js.map +1 -0
- package/dist/shared/simple-popper.js +229 -149
- package/dist/shared/simple-popper.js.map +1 -0
- package/dist/shared/simple-tooltip.js +198 -124
- package/dist/shared/simple-tooltip.js.map +1 -0
- package/dist/shared/styles/button-shared-styles.js +4 -8
- package/dist/shared/styles/button-shared-styles.js.map +1 -0
- package/dist/styles.js +3 -8
- package/dist/styles.js.map +1 -0
- package/dist/utils/currency.js +15 -12
- package/dist/utils/currency.js.map +1 -0
- package/dist/utils/custom-filters.js +80 -46
- package/dist/utils/custom-filters.js.map +1 -0
- package/dist/utils/date.js +21 -14
- package/dist/utils/date.js.map +1 -0
- package/dist/utils/getOperatorByType.js +65 -51
- package/dist/utils/getOperatorByType.js.map +1 -0
- package/dist/utils/getOverviewValue.js +177 -0
- package/dist/utils/getOverviewValue.js.map +1 -0
- package/dist/utils/localization.js +429 -412
- package/dist/utils/localization.js.map +1 -0
- package/dist/utils/utils.js +12 -10
- package/dist/utils/utils.js.map +1 -0
- package/dist/utils/validate-json-schema.js +8 -0
- package/dist/utils/validate-json-schema.js.map +1 -0
- package/dist/validators/validator.js +7 -0
- package/dist/validators/validator.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,676 +1,1061 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import "../node_modules/@lit/localize/init/runtime.js";
|
|
7
|
-
import { customElement as ot } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
8
|
-
import { property as a } from "../node_modules/@lit/reactive-element/decorators/property.js";
|
|
9
|
-
import { state as z } from "../node_modules/@lit/reactive-element/decorators/state.js";
|
|
10
|
-
import { query as Q } from "../node_modules/@lit/reactive-element/decorators/query.js";
|
|
11
|
-
import { unsafeHTML as j } from "../node_modules/lit-html/directives/unsafe-html.js";
|
|
12
|
-
import { TableController as nt, flexRender as L } from "../node_modules/@tanstack/lit-table/build/lib/index.js";
|
|
13
|
-
import { repeat as T } from "../node_modules/lit-html/directives/repeat.js";
|
|
14
|
-
import { VirtualizerController as K } from "../node_modules/@tanstack/lit-virtual/dist/esm/index.js";
|
|
15
|
-
import { createRef as lt, ref as X } from "../node_modules/lit-html/directives/ref.js";
|
|
16
|
-
import { styleMap as E } from "../node_modules/lit-html/directives/style-map.js";
|
|
17
|
-
import st from "../node_modules/sortablejs/modular/sortable.esm.js";
|
|
18
|
-
import { formatDate as W } from "../utils/date.js";
|
|
19
|
-
import { formatCurrency as rt } from "../utils/currency.js";
|
|
20
|
-
import { dateFilterFn as Z, dateRangeFilterFn as Y, multiselectFilterFn as J } from "../utils/custom-filters.js";
|
|
21
|
-
import { getLocale as at, setLocale as dt } from "../utils/localization.js";
|
|
22
|
-
import { getOperatorsByColumnType as ct } from "../utils/getOperatorByType.js";
|
|
23
|
-
import { filterFns as V, getFacetedUniqueValues as ht, getExpandedRowModel as pt, getGroupedRowModel as ut, getFacetedRowModel as gt, getFilteredRowModel as mt, getSortedRowModel as ft, getCoreRowModel as bt } from "../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
24
|
-
import { css as yt } from "../node_modules/@lit/reactive-element/css-tag.js";
|
|
25
|
-
var wt = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, l = (t, e, o, d) => {
|
|
26
|
-
for (var s = d > 1 ? void 0 : d ? xt(e, o) : e, p = t.length - 1, g; p >= 0; p--)
|
|
27
|
-
(g = t[p]) && (s = (d ? g(e, o, s) : g(s)) || s);
|
|
28
|
-
return d && s && wt(e, o, s), s;
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
29
6
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
7
|
+
import { css, html, LitElement } from 'lit';
|
|
8
|
+
import _, { isEqual } from 'lodash';
|
|
9
|
+
import { msg } from '@lit/localize';
|
|
10
|
+
import { customElement, property, state, query } from 'lit/decorators.js';
|
|
11
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
12
|
+
import { TableController, getCoreRowModel, flexRender, getSortedRowModel, getFilteredRowModel, getFacetedRowModel, getFacetedUniqueValues, getGroupedRowModel, getExpandedRowModel, filterFns, } from '@tanstack/lit-table';
|
|
13
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
14
|
+
import { VirtualizerController } from '@tanstack/lit-virtual';
|
|
15
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
16
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
17
|
+
import Sortable from 'sortablejs';
|
|
18
|
+
// components
|
|
19
|
+
import '../shared/filter-inputs.js';
|
|
20
|
+
import '../shared/lit-icon.js';
|
|
21
|
+
import '../shared/lit-icon-button.js';
|
|
22
|
+
import '../shared/lit-button.js';
|
|
23
|
+
import '../shared/lit-responsive-button.js';
|
|
24
|
+
import '../shared/lit-data-grid-export-popover.js';
|
|
25
|
+
import '../shared/lit-data-grid-action-buttons-popover.js';
|
|
26
|
+
import '../assets/illustration/not-found.js';
|
|
27
|
+
import '../shared/lit-data-grid-density-popover.js';
|
|
28
|
+
import '../shared/lit-loading-bar.js';
|
|
29
|
+
import '../shared/lit-data-grid-row-actions.js';
|
|
30
|
+
import '../shared/simple-tooltip.js';
|
|
31
|
+
import '../shared/lit-checkbox.js';
|
|
32
|
+
import '../shared/lit-overflow-tooltip.js';
|
|
33
|
+
import './components-settings/data-grid-settings.js';
|
|
34
|
+
// utils
|
|
35
|
+
import { formatDate } from '../utils/date.js';
|
|
36
|
+
import { formatCurrency } from '../utils/currency.js';
|
|
37
|
+
import { dateFilterFn, multiselectFilterFn, dateRangeFilterFn } from '../utils/custom-filters.js';
|
|
38
|
+
import { setLocale, getLocale } from '../utils/localization.js';
|
|
39
|
+
import { getOperatorsByColumnType } from '../utils/getOperatorByType.js';
|
|
40
|
+
let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments);
|
|
43
|
+
this.row = [];
|
|
44
|
+
this.columns = [];
|
|
45
|
+
this.enableRowVirtualization = true;
|
|
46
|
+
this.enableColumnVirtualization = false;
|
|
47
|
+
this.enableColumnPinning = true;
|
|
48
|
+
this.enableColumnOrdering = false;
|
|
49
|
+
this.enableGrouping = true;
|
|
50
|
+
this.enablePinning = true;
|
|
51
|
+
this.exportData = true;
|
|
52
|
+
this.actionButtonsInMenu = false;
|
|
53
|
+
this.id = '';
|
|
54
|
+
this.initialSorting = [];
|
|
55
|
+
this.initialRowExpanded = {};
|
|
56
|
+
this.columnSizing = {};
|
|
57
|
+
this.leftPinnedColumns = [];
|
|
58
|
+
this.rightPinnedColumns = [];
|
|
59
|
+
this.enableFiltering = true;
|
|
60
|
+
this.enableSorting = true;
|
|
61
|
+
this.userLang = 'cs';
|
|
62
|
+
this.dateFormat = null;
|
|
63
|
+
this.isLoading = false;
|
|
64
|
+
this.enableRowSelection = false;
|
|
65
|
+
this.initialFiltering = [];
|
|
66
|
+
this.server = false;
|
|
67
|
+
this.scrollEndThreshold = 100;
|
|
68
|
+
this.rowDensity = 'standard';
|
|
69
|
+
this.enableMultiRowSelection = false;
|
|
70
|
+
this.minFilterCharacters = 3;
|
|
71
|
+
this.localizeDate = true;
|
|
72
|
+
this.rowsSelected = {};
|
|
73
|
+
this.enableSettings = false;
|
|
74
|
+
this.onSettingsChanged = () => { };
|
|
75
|
+
this.onCellKeyDown = (event, row) => { };
|
|
76
|
+
this.onColumnResize = () => { };
|
|
77
|
+
this.onColumnFiltersChanged = (table, filterModel) => { };
|
|
78
|
+
this.onColumnSortChanged = (table, sortModel) => { };
|
|
79
|
+
this.onRowSelectionChanged = (table, selectedRows) => { };
|
|
80
|
+
this.onColumnOrderChanged = (table, columnOrder) => { };
|
|
81
|
+
this.hideFooter = false;
|
|
82
|
+
this.columnVisibility = {};
|
|
83
|
+
this.onColumnVisibilityChanged = (table, columnVisibility) => { };
|
|
84
|
+
this.onMouseDown = (e, row) => { };
|
|
85
|
+
this.onRowFocusChanged = (table, rowIndex) => { };
|
|
86
|
+
this.focusedRowIndex = null;
|
|
87
|
+
this.autoFocus = false;
|
|
88
|
+
this.rowsCount = 0;
|
|
89
|
+
this.isScrollable = false;
|
|
90
|
+
this.disableScrollLeft = true;
|
|
91
|
+
this.disableScrollRight = false;
|
|
92
|
+
this.columnOrder = [];
|
|
93
|
+
this.isOpen = false;
|
|
94
|
+
this.filterText = '';
|
|
95
|
+
this.isOpenModal = false;
|
|
96
|
+
this.scrollToEnd = false;
|
|
97
|
+
this.tableContainerRef = createRef();
|
|
98
|
+
this.scrollInterval = null;
|
|
99
|
+
this.currentScrollTop = 0;
|
|
100
|
+
this.lastSelectedIndex = null;
|
|
101
|
+
this.getCellBackgroundColor = (cell) => {
|
|
102
|
+
if (cell.getIsGrouped()) {
|
|
103
|
+
return this.columnGroupedColor ?? `var(--color-primary-light, #f0fadf)`;
|
|
104
|
+
}
|
|
105
|
+
if (cell.getIsAggregated()) {
|
|
106
|
+
return this.rowAggregationColor ?? `var(--color-warning-light, #ffe1a8)`;
|
|
107
|
+
}
|
|
108
|
+
if (cell.getIsPlaceholder()) {
|
|
109
|
+
return `var(--background-default, #eff3f4)`;
|
|
110
|
+
}
|
|
111
|
+
if (cell.column.getIsPinned()) {
|
|
112
|
+
return `var(--background-paper, #fff)`;
|
|
113
|
+
}
|
|
114
|
+
return 'transparent';
|
|
115
|
+
};
|
|
116
|
+
this.updateScrollState = () => {
|
|
117
|
+
const grid = this.tableContainerRef.value;
|
|
118
|
+
if (grid) {
|
|
119
|
+
const canScrollHorizontally = grid.scrollWidth > grid.clientWidth;
|
|
120
|
+
this.isScrollable = canScrollHorizontally;
|
|
121
|
+
this.disableScrollLeft = grid.scrollLeft === 0;
|
|
122
|
+
this.disableScrollRight = grid.scrollLeft + grid.clientWidth >= grid.scrollWidth;
|
|
123
|
+
this.currentScrollTop = grid.scrollTop;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
72
126
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
g && g.setOptions({
|
|
76
|
-
...g.options,
|
|
77
|
-
count: (p = this.table) == null ? void 0 : p.getVisibleLeafColumns().length
|
|
78
|
-
});
|
|
127
|
+
get rows() {
|
|
128
|
+
return [...(this.row || [])];
|
|
79
129
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
130
|
+
get getColumns() {
|
|
131
|
+
return [...(this.columns || [])];
|
|
132
|
+
}
|
|
133
|
+
// lifecycle
|
|
134
|
+
connectedCallback() {
|
|
135
|
+
this.initRowVirtualizer();
|
|
136
|
+
this.initColumnVirtualizer();
|
|
137
|
+
this.initTable();
|
|
138
|
+
window.addEventListener('resize', this.updateScrollState);
|
|
139
|
+
super.connectedCallback();
|
|
140
|
+
}
|
|
141
|
+
disconnectedCallback() {
|
|
142
|
+
super.disconnectedCallback();
|
|
143
|
+
window.removeEventListener('resize', this.updateScrollState);
|
|
144
|
+
}
|
|
145
|
+
updated(changedProperties) {
|
|
146
|
+
if (changedProperties.has('rowsCount') && this.enableRowVirtualization) {
|
|
147
|
+
this.scrollToEnd = false;
|
|
148
|
+
const virtualizer = this.rowVirtualizerController?.getVirtualizer();
|
|
149
|
+
if (virtualizer) {
|
|
150
|
+
virtualizer.setOptions({
|
|
151
|
+
...virtualizer.options,
|
|
152
|
+
count: this.table?.getRowModel()?.rows.length,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
this.requestUpdate();
|
|
156
|
+
}
|
|
157
|
+
if ((changedProperties.has('columns') || changedProperties.has('columnVisibility')) &&
|
|
158
|
+
this.enableColumnVirtualization) {
|
|
159
|
+
const virtualizer = this.columnVirtualizerController?.getVirtualizer();
|
|
160
|
+
if (virtualizer) {
|
|
161
|
+
virtualizer.setOptions({
|
|
162
|
+
...virtualizer.options,
|
|
163
|
+
count: this.table?.getVisibleLeafColumns().length,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (changedProperties.has('row') || changedProperties.has('columns')) {
|
|
168
|
+
this.initTable();
|
|
169
|
+
this.requestUpdate();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
firstUpdated() {
|
|
173
|
+
const grid = this.tableContainerRef.value;
|
|
174
|
+
if (grid) {
|
|
175
|
+
grid.addEventListener('scroll', this.updateScrollState);
|
|
176
|
+
}
|
|
177
|
+
this.updateScrollState();
|
|
178
|
+
this.initSortable();
|
|
179
|
+
this._container.addEventListener('scroll', this.handleScroll.bind(this));
|
|
180
|
+
// focus row by index
|
|
181
|
+
if (this.autoFocus) {
|
|
182
|
+
setTimeout(() => {
|
|
183
|
+
if (this.focusedRowIndex !== null && this.focusedRowIndex !== undefined) {
|
|
184
|
+
this.focusRow?.(this.focusedRowIndex);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
// first selected row if exists
|
|
188
|
+
const selectedRows = this.table.getSelectedRowModel().rows;
|
|
189
|
+
if (selectedRows.length > 0) {
|
|
190
|
+
this.focusRow?.(selectedRows[0].index);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}, 0);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
toggleModal() {
|
|
197
|
+
this.isOpenModal = !this.isOpenModal;
|
|
198
|
+
}
|
|
199
|
+
async initSortable() {
|
|
200
|
+
if (!this.enableColumnOrdering)
|
|
201
|
+
return;
|
|
202
|
+
const headerRow = this.shadowRoot?.querySelector('thead tr.head');
|
|
203
|
+
if (!headerRow)
|
|
204
|
+
return;
|
|
205
|
+
Sortable.create(headerRow, {
|
|
206
|
+
animation: 150,
|
|
207
|
+
direction: 'horizontal',
|
|
208
|
+
handle: '.drag-handle',
|
|
209
|
+
filter: 'th[data-index="checkbox"], th[data-index="actions"]',
|
|
210
|
+
preventOnFilter: false,
|
|
211
|
+
onMove: (evt) => {
|
|
212
|
+
const dragged = evt.dragged.getAttribute('data-index');
|
|
213
|
+
const target = evt.related.getAttribute('data-index');
|
|
214
|
+
const disallowed = ['checkbox', 'actions'];
|
|
215
|
+
if (disallowed.includes(dragged) || disallowed.includes(target)) {
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
const headers = this.table.getHeaderGroups()[0].headers;
|
|
219
|
+
const draggedHeader = headers.find((header) => header.id === dragged);
|
|
220
|
+
const targetHeader = headers.find((header) => header.id === target);
|
|
221
|
+
if (!draggedHeader || !targetHeader)
|
|
222
|
+
return false;
|
|
223
|
+
const isDraggedPinned = draggedHeader.column.getIsPinned?.();
|
|
224
|
+
const isTargetPinned = targetHeader.column.getIsPinned?.();
|
|
225
|
+
const isDraggedGrouped = draggedHeader.column.getIsGrouped?.();
|
|
226
|
+
const isTargetGrouped = targetHeader.column.getIsGrouped?.();
|
|
227
|
+
return !(isDraggedPinned || isTargetPinned || isDraggedGrouped || isTargetGrouped);
|
|
228
|
+
},
|
|
229
|
+
onEnd: () => {
|
|
230
|
+
const newOrder = Array.from(headerRow.querySelectorAll('th'))
|
|
231
|
+
.map((th) => th.getAttribute('data-index'))
|
|
232
|
+
.filter((id) => {
|
|
233
|
+
if (!id || id === 'checkbox' || id === 'actions')
|
|
234
|
+
return false;
|
|
235
|
+
const header = this.table
|
|
236
|
+
.getHeaderGroups()[0]
|
|
237
|
+
.headers.find((h) => h.id === id);
|
|
238
|
+
if (!header)
|
|
239
|
+
return false;
|
|
240
|
+
return !header.column.getIsPinned?.() && !header.column.getIsGrouped?.();
|
|
241
|
+
});
|
|
242
|
+
this.table.setColumnOrder(newOrder);
|
|
243
|
+
},
|
|
123
244
|
});
|
|
124
|
-
this.table.setColumnOrder(o);
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
async loadXLSX() {
|
|
129
|
-
!window.XLSX && !this.server && await new Promise((t) => {
|
|
130
|
-
const e = document.createElement("script");
|
|
131
|
-
e.src = "../../public/libs/xlsx.mini.min.js", e.onload = t, document.head.appendChild(e);
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
// row density
|
|
135
|
-
getRowHeight() {
|
|
136
|
-
switch (this.rowDensity) {
|
|
137
|
-
case "compact":
|
|
138
|
-
return 31;
|
|
139
|
-
case "standard":
|
|
140
|
-
return 38;
|
|
141
|
-
case "comfort":
|
|
142
|
-
return 50;
|
|
143
|
-
default:
|
|
144
|
-
return 38;
|
|
145
245
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
default:
|
|
156
|
-
return "medium";
|
|
246
|
+
async loadXLSX() {
|
|
247
|
+
if (!window.XLSX && !this.server) {
|
|
248
|
+
await new Promise((resolve) => {
|
|
249
|
+
const script = document.createElement('script');
|
|
250
|
+
script.src = '../../public/libs/xlsx.mini.min.js';
|
|
251
|
+
script.onload = resolve;
|
|
252
|
+
document.head.appendChild(script);
|
|
253
|
+
});
|
|
254
|
+
}
|
|
157
255
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
let p;
|
|
171
|
-
if (e === "forward")
|
|
172
|
-
if (s === d.length - 1) {
|
|
173
|
-
const x = (h = this.shadowRoot) == null ? void 0 : h.querySelector(".grid");
|
|
174
|
-
x && (x.scrollLeft = 0), setTimeout(() => {
|
|
175
|
-
var w;
|
|
176
|
-
const C = (w = this.shadowRoot) == null ? void 0 : w.querySelector("filter-inputs");
|
|
177
|
-
C && C.focus();
|
|
178
|
-
}, 0);
|
|
179
|
-
return;
|
|
180
|
-
} else
|
|
181
|
-
p = s + 1;
|
|
182
|
-
else if (s === 0) {
|
|
183
|
-
const x = (m = this.shadowRoot) == null ? void 0 : m.querySelector(".grid");
|
|
184
|
-
x && (x.scrollLeft = x.scrollWidth), setTimeout(() => {
|
|
185
|
-
var w;
|
|
186
|
-
const C = Array.from(
|
|
187
|
-
((w = this.shadowRoot) == null ? void 0 : w.querySelectorAll("filter-inputs")) || []
|
|
188
|
-
);
|
|
189
|
-
C.length > 0 && C[C.length - 1].focus();
|
|
190
|
-
}, 0);
|
|
191
|
-
return;
|
|
192
|
-
} else
|
|
193
|
-
p = s - 1;
|
|
194
|
-
d[p].focus();
|
|
195
|
-
}
|
|
196
|
-
// virtualization
|
|
197
|
-
initRowVirtualizer() {
|
|
198
|
-
var t, e, o;
|
|
199
|
-
this.rowVirtualizerController = new K(this, {
|
|
200
|
-
count: ((e = (t = this.table) == null ? void 0 : t.getRowModel()) == null ? void 0 : e.rows.length) || ((o = this.row) == null ? void 0 : o.length) || 1,
|
|
201
|
-
getScrollElement: () => this.tableContainerRef.value,
|
|
202
|
-
estimateSize: () => this.getRowHeight(),
|
|
203
|
-
overscan: 5,
|
|
204
|
-
initialOffset: this.currentScrollTop,
|
|
205
|
-
enabled: this.enableRowVirtualization
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
initTable() {
|
|
209
|
-
this.tableController = new nt(this);
|
|
210
|
-
}
|
|
211
|
-
initColumnVirtualizer() {
|
|
212
|
-
var t;
|
|
213
|
-
this.columnVirtualizerController = new K(this, {
|
|
214
|
-
horizontal: !0,
|
|
215
|
-
count: ((t = this.table) == null ? void 0 : t.getVisibleLeafColumns().length) || this.columns.length || 1,
|
|
216
|
-
getScrollElement: () => this.tableContainerRef.value,
|
|
217
|
-
estimateSize: (e) => {
|
|
218
|
-
var o;
|
|
219
|
-
return ((o = this.table.getVisibleLeafColumns()[e]) == null ? void 0 : o.getSize()) || 200;
|
|
220
|
-
},
|
|
221
|
-
overscan: 5,
|
|
222
|
-
enabled: this.enableColumnVirtualization
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
handleRowClick(t, e) {
|
|
226
|
-
var s, p;
|
|
227
|
-
(s = this.onRowClick) == null || s.call(this, t, this.table, e), (p = this.onRowFocusChanged) == null || p.call(this, this.table, e.index);
|
|
228
|
-
const o = t.shiftKey, d = t.ctrlKey || t.metaKey;
|
|
229
|
-
if (this.enableRowSelection && e.getCanSelect() && (d || o)) {
|
|
230
|
-
const { rows: g } = this.table.getRowModel();
|
|
231
|
-
if (this.enableMultiRowSelection && o && this.focusedRowIndex !== null && this.focusedRowIndex !== void 0) {
|
|
232
|
-
const [h, m] = [
|
|
233
|
-
Math.min(this.focusedRowIndex, e.index),
|
|
234
|
-
Math.max(this.focusedRowIndex, e.index)
|
|
235
|
-
], x = g.slice(h, m + 1).map((w) => w.id), C = { ...this.rowsSelected };
|
|
236
|
-
x.forEach((w) => C[w] = !0), this.table.setRowSelection(C);
|
|
237
|
-
} else if (d && this.enableMultiRowSelection) {
|
|
238
|
-
const h = { ...this.rowsSelected };
|
|
239
|
-
h[e.id] ? delete h[e.id] : h[e.id] = !0, this.table.setRowSelection(h);
|
|
240
|
-
} else {
|
|
241
|
-
const h = { [e.id]: !0 };
|
|
242
|
-
this.table.setRowSelection(h);
|
|
243
|
-
}
|
|
256
|
+
// row density
|
|
257
|
+
getRowHeight() {
|
|
258
|
+
switch (this.rowDensity) {
|
|
259
|
+
case 'compact':
|
|
260
|
+
return 31;
|
|
261
|
+
case 'standard':
|
|
262
|
+
return 38;
|
|
263
|
+
case 'comfort':
|
|
264
|
+
return 50;
|
|
265
|
+
default:
|
|
266
|
+
return 38;
|
|
267
|
+
}
|
|
244
268
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
if (this.enableRowSelection) {
|
|
256
|
-
if (o === -1 && (o = 0), t.key === "ArrowDown" && t.shiftKey && this.enableMultiRowSelection) {
|
|
257
|
-
t.preventDefault();
|
|
258
|
-
const s = o + 1;
|
|
259
|
-
if (s < e.length) {
|
|
260
|
-
const p = e[s].id;
|
|
261
|
-
this.table.setRowSelection((g) => ({
|
|
262
|
-
...g,
|
|
263
|
-
[p]: !g[p]
|
|
264
|
-
})), this.focusRow(s);
|
|
269
|
+
getButtonSize() {
|
|
270
|
+
switch (this.rowDensity) {
|
|
271
|
+
case 'compact':
|
|
272
|
+
return 'small';
|
|
273
|
+
case 'standard':
|
|
274
|
+
return 'medium';
|
|
275
|
+
case 'comfort':
|
|
276
|
+
return 'large';
|
|
277
|
+
default:
|
|
278
|
+
return 'medium';
|
|
265
279
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
if (
|
|
270
|
-
|
|
271
|
-
this.table.setRowSelection((g) => ({
|
|
272
|
-
...g,
|
|
273
|
-
[p]: !g[p]
|
|
274
|
-
})), this.focusRow(s);
|
|
280
|
+
}
|
|
281
|
+
handleSetDensity(density) {
|
|
282
|
+
this.rowDensity = density;
|
|
283
|
+
if (this.rowDensityChange) {
|
|
284
|
+
this.rowDensityChange(this.table, density);
|
|
275
285
|
}
|
|
276
|
-
} else if (t.key === "ArrowDown" && o < e.length - 1) {
|
|
277
|
-
t.preventDefault();
|
|
278
|
-
const s = o + 1;
|
|
279
|
-
this.focusRow(s);
|
|
280
|
-
} else if (t.key === "ArrowUp" && o > 0) {
|
|
281
|
-
t.preventDefault();
|
|
282
|
-
const s = o - 1;
|
|
283
|
-
this.focusRow(s);
|
|
284
|
-
}
|
|
285
286
|
}
|
|
286
|
-
(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
(
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
287
|
+
handleMouseDown(event, row) {
|
|
288
|
+
if (this.onMouseDown) {
|
|
289
|
+
this.onMouseDown(event, row);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
handleFilterTabNavigation(event) {
|
|
293
|
+
const { direction, currentFilter } = event.detail;
|
|
294
|
+
// Získajte všetky filter-inputs elementy z DOM
|
|
295
|
+
const filterInputs = Array.from(this.shadowRoot?.querySelectorAll('filter-inputs') || []);
|
|
296
|
+
if (filterInputs.length === 0)
|
|
297
|
+
return;
|
|
298
|
+
const currentIndex = filterInputs.indexOf(currentFilter);
|
|
299
|
+
let nextIndex;
|
|
300
|
+
if (direction === 'forward') {
|
|
301
|
+
// Ak je aktuálny filter posledný vo viditeľnom zozname
|
|
302
|
+
if (currentIndex === filterInputs.length - 1) {
|
|
303
|
+
// Scroll na začiatok (ľavá strana)
|
|
304
|
+
const grid = this.shadowRoot?.querySelector('.grid');
|
|
305
|
+
if (grid) {
|
|
306
|
+
grid.scrollLeft = 0;
|
|
307
|
+
}
|
|
308
|
+
// Po vykonaní scrollu čakáme krátko a potom nastavený focus na prvý filter
|
|
309
|
+
setTimeout(() => {
|
|
310
|
+
const firstFilter = this.shadowRoot?.querySelector('filter-inputs');
|
|
311
|
+
if (firstFilter) {
|
|
312
|
+
firstFilter.focus();
|
|
313
|
+
}
|
|
314
|
+
}, 0);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
nextIndex = currentIndex + 1;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
// Podobne môžeme spracovať aj spätnú navigáciu
|
|
323
|
+
if (currentIndex === 0) {
|
|
324
|
+
const grid = this.shadowRoot?.querySelector('.grid');
|
|
325
|
+
if (grid) {
|
|
326
|
+
// Scroll na koniec (pravá strana)
|
|
327
|
+
grid.scrollLeft = grid.scrollWidth;
|
|
328
|
+
}
|
|
329
|
+
setTimeout(() => {
|
|
330
|
+
const filters = Array.from(this.shadowRoot?.querySelectorAll('filter-inputs') || []);
|
|
331
|
+
if (filters.length > 0) {
|
|
332
|
+
filters[filters.length - 1].focus();
|
|
333
|
+
}
|
|
334
|
+
}, 0);
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
nextIndex = currentIndex - 1;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
// Nastav focus na ďalší filter podľa smeru
|
|
342
|
+
filterInputs[nextIndex].focus();
|
|
343
|
+
}
|
|
344
|
+
// virtualization
|
|
345
|
+
initRowVirtualizer() {
|
|
346
|
+
this.rowVirtualizerController = new VirtualizerController(this, {
|
|
347
|
+
count: this.table?.getRowModel()?.rows.length || this.row?.length || 1,
|
|
348
|
+
getScrollElement: () => this.tableContainerRef.value,
|
|
349
|
+
estimateSize: () => this.getRowHeight(),
|
|
350
|
+
overscan: 5,
|
|
351
|
+
initialOffset: this.currentScrollTop,
|
|
352
|
+
enabled: this.enableRowVirtualization,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
initTable() {
|
|
356
|
+
this.tableController = new TableController(this);
|
|
357
|
+
}
|
|
358
|
+
initColumnVirtualizer() {
|
|
359
|
+
this.columnVirtualizerController = new VirtualizerController(this, {
|
|
360
|
+
horizontal: true,
|
|
361
|
+
count: this.table?.getVisibleLeafColumns().length || this.columns.length || 1,
|
|
362
|
+
getScrollElement: () => this.tableContainerRef.value,
|
|
363
|
+
estimateSize: (index) => this.table.getVisibleLeafColumns()[index]?.getSize() || 200,
|
|
364
|
+
overscan: 5,
|
|
365
|
+
enabled: this.enableColumnVirtualization,
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
handleRowClick(event, row) {
|
|
369
|
+
this.onRowClick?.(event, this.table, row);
|
|
370
|
+
this.onRowFocusChanged?.(this.table, row.index);
|
|
371
|
+
const isShift = event.shiftKey;
|
|
372
|
+
const isCtrlOrMeta = event.ctrlKey || event.metaKey;
|
|
373
|
+
if (this.enableRowSelection && row.getCanSelect() && (isCtrlOrMeta || isShift)) {
|
|
374
|
+
const { rows } = this.table.getRowModel();
|
|
375
|
+
if (this.enableMultiRowSelection &&
|
|
376
|
+
isShift &&
|
|
377
|
+
this.focusedRowIndex !== null &&
|
|
378
|
+
this.focusedRowIndex !== undefined) {
|
|
379
|
+
const [start, end] = [
|
|
380
|
+
Math.min(this.focusedRowIndex, row.index),
|
|
381
|
+
Math.max(this.focusedRowIndex, row.index),
|
|
382
|
+
];
|
|
383
|
+
const ids = rows.slice(start, end + 1).map((r) => r.id);
|
|
384
|
+
const selected = { ...this.rowsSelected };
|
|
385
|
+
ids.forEach((id) => (selected[id] = true));
|
|
386
|
+
this.table.setRowSelection(selected);
|
|
387
|
+
}
|
|
388
|
+
else if (isCtrlOrMeta && this.enableMultiRowSelection) {
|
|
389
|
+
// Ctrl/Cmd+Click: toggle row selection
|
|
390
|
+
const selected = { ...this.rowsSelected };
|
|
391
|
+
if (selected[row.id]) {
|
|
392
|
+
delete selected[row.id];
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
selected[row.id] = true;
|
|
396
|
+
}
|
|
397
|
+
this.table.setRowSelection(selected);
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
// Single click: select only this row
|
|
401
|
+
const selected = { [row.id]: true };
|
|
402
|
+
this.table.setRowSelection(selected);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
this.focusedRowIndex = row.index;
|
|
406
|
+
}
|
|
407
|
+
handleRowDoubleClick(row) {
|
|
408
|
+
if (this.onRowDoubleClick) {
|
|
409
|
+
this.onRowDoubleClick(this.table, row);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
handleKeyDown(e) {
|
|
413
|
+
const rows = this.table.getRowModel().rows;
|
|
414
|
+
if (!rows.length)
|
|
415
|
+
return;
|
|
416
|
+
let index = this.focusedRowIndex ?? rows.findIndex((row) => this.rowsSelected[row.id]);
|
|
417
|
+
if (this.enableRowSelection) {
|
|
418
|
+
if (index === -1)
|
|
419
|
+
index = 0;
|
|
420
|
+
if (e.key === 'ArrowDown' && e.shiftKey && this.enableMultiRowSelection) {
|
|
421
|
+
e.preventDefault();
|
|
422
|
+
const nextIndex = index + 1;
|
|
423
|
+
if (nextIndex < rows.length) {
|
|
424
|
+
const nextRowId = rows[nextIndex].id;
|
|
425
|
+
this.table.setRowSelection((prev) => ({
|
|
426
|
+
...prev,
|
|
427
|
+
[nextRowId]: !prev[nextRowId],
|
|
428
|
+
}));
|
|
429
|
+
this.focusRow(nextIndex);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
else if (e.key === 'ArrowUp' && e.shiftKey && this.enableMultiRowSelection) {
|
|
433
|
+
e.preventDefault();
|
|
434
|
+
const prevIndex = index - 1;
|
|
435
|
+
if (prevIndex >= 0) {
|
|
436
|
+
const prevRowId = rows[prevIndex].id;
|
|
437
|
+
this.table.setRowSelection((prev) => ({
|
|
438
|
+
...prev,
|
|
439
|
+
[prevRowId]: !prev[prevRowId],
|
|
440
|
+
}));
|
|
441
|
+
this.focusRow(prevIndex);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
else if (e.key === 'ArrowDown' && index < rows.length - 1) {
|
|
445
|
+
e.preventDefault();
|
|
446
|
+
const nextIndex = index + 1;
|
|
447
|
+
this.focusRow(nextIndex);
|
|
448
|
+
}
|
|
449
|
+
else if (e.key === 'ArrowUp' && index > 0) {
|
|
450
|
+
e.preventDefault();
|
|
451
|
+
const prevIndex = index - 1;
|
|
452
|
+
this.focusRow(prevIndex);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
this.onCellKeyDown?.(e, rows[index]);
|
|
456
|
+
}
|
|
457
|
+
focusRow(index) {
|
|
458
|
+
const rowIndex = index ?? this.focusedRowIndex;
|
|
459
|
+
// Scroll to the row using virtualizer if available
|
|
460
|
+
this.rowVirtualizerController
|
|
461
|
+
?.getVirtualizer()
|
|
462
|
+
.scrollToIndex(rowIndex ?? 0, { align: 'auto' });
|
|
463
|
+
setTimeout(() => {
|
|
464
|
+
const row = this.shadowRoot?.querySelector(`[data-row-index="${rowIndex}"]`);
|
|
465
|
+
// Find the row element in the shadow DOM
|
|
466
|
+
if (this.enableRowVirtualization) {
|
|
467
|
+
if (row) {
|
|
468
|
+
setTimeout(() => {
|
|
469
|
+
row.focus();
|
|
470
|
+
}, 0);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
else {
|
|
474
|
+
if (row) {
|
|
475
|
+
row.focus();
|
|
476
|
+
row.scrollIntoView({ block: 'nearest' });
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
}, 100);
|
|
480
|
+
this.onRowFocusChanged?.(this.table, rowIndex);
|
|
481
|
+
this.focusedRowIndex = rowIndex;
|
|
482
|
+
}
|
|
483
|
+
getTanstackColumns(columns) {
|
|
484
|
+
return columns.map((column) => {
|
|
485
|
+
return {
|
|
486
|
+
id: column.field,
|
|
487
|
+
accessorKey: column.field,
|
|
488
|
+
accessorFn: (originalRow) => (column.type === 'date' ||
|
|
489
|
+
column.type === 'dateTime' ||
|
|
490
|
+
column.type === 'dateTimeRange' ||
|
|
491
|
+
column.type === 'dateRange') &&
|
|
492
|
+
!this.server &&
|
|
493
|
+
this.localizeDate
|
|
494
|
+
? column.accessorFn
|
|
495
|
+
? formatDate(column.accessorFn(originalRow), this.userLang || 'cs', column.type === 'date' || column.type === 'dateRange'
|
|
496
|
+
? undefined
|
|
497
|
+
: true, this.dateFormat)
|
|
498
|
+
: formatDate(originalRow[column.field], this.userLang || 'cs', column.type === 'date' || column.type === 'dateRange'
|
|
499
|
+
? undefined
|
|
500
|
+
: true, this.dateFormat)
|
|
501
|
+
: column.accessorFn
|
|
502
|
+
? column.accessorFn(originalRow)
|
|
503
|
+
: originalRow[column.field],
|
|
504
|
+
type: column.type,
|
|
505
|
+
header: column.headerName,
|
|
506
|
+
cell: (props) => {
|
|
507
|
+
const value = props.getValue();
|
|
508
|
+
if (column.type === 'actions') {
|
|
509
|
+
return html `
|
|
322
510
|
<lit-data-grid-row-actions
|
|
323
|
-
.buttons=${
|
|
511
|
+
.buttons=${column.getActions?.(props) || []}
|
|
324
512
|
></lit-data-grid-row-actions>
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
513
|
+
`;
|
|
514
|
+
}
|
|
515
|
+
if (column.type === 'currency') {
|
|
516
|
+
return formatCurrency(value, this.userLang || 'cs');
|
|
517
|
+
}
|
|
518
|
+
return column.cell ? column.cell(props, html, unsafeHTML) : value;
|
|
519
|
+
},
|
|
520
|
+
filterFn: (() => {
|
|
521
|
+
switch (column.type) {
|
|
522
|
+
case 'numberRange':
|
|
523
|
+
return filterFns.inNumberRange;
|
|
524
|
+
case 'select':
|
|
525
|
+
return filterFns.weakEquals;
|
|
526
|
+
case 'multiselect':
|
|
527
|
+
return multiselectFilterFn;
|
|
528
|
+
case 'number':
|
|
529
|
+
case 'currency':
|
|
530
|
+
return filterFns.weakEquals;
|
|
531
|
+
case 'dateRange':
|
|
532
|
+
case 'dateTimeRange':
|
|
533
|
+
return dateRangeFilterFn;
|
|
534
|
+
case 'date':
|
|
535
|
+
case 'dateTime':
|
|
536
|
+
return dateFilterFn;
|
|
537
|
+
case 'string':
|
|
538
|
+
default:
|
|
539
|
+
return filterFns.includesString;
|
|
540
|
+
}
|
|
541
|
+
})(),
|
|
542
|
+
enableSorting: column.enableSorting ?? true,
|
|
543
|
+
enableColumnFilter: this.enableFiltering && (column.enableFilter ?? true),
|
|
544
|
+
size: column.size || this.columnDefaultSize || undefined,
|
|
545
|
+
maxSize: column.maxSize || this.columnDefaultMaxSize || 500,
|
|
546
|
+
minSize: column.minSize || this.columnDefaultMinSize || 100,
|
|
547
|
+
meta: {
|
|
548
|
+
filterVariant: column.type ?? 'string',
|
|
549
|
+
valueOptions: column.valueOptions,
|
|
550
|
+
filterOperators: column.filterOperators,
|
|
551
|
+
},
|
|
552
|
+
aggregationFn: column.columnAggregation ?? undefined,
|
|
553
|
+
enableGrouping: column.enableGrouping ?? true,
|
|
554
|
+
sortDescFirst: column.sortDescFirst || true,
|
|
555
|
+
enableResizing: column.enableResizing ?? true,
|
|
556
|
+
enablePinning: this.enablePinning && (column.enablePinning ?? true),
|
|
557
|
+
aggregatedCell: (props) => {
|
|
558
|
+
const value = props.getValue();
|
|
559
|
+
return column.aggregatedCell
|
|
560
|
+
? column.aggregatedCell(props, html, unsafeHTML)
|
|
561
|
+
: value;
|
|
562
|
+
},
|
|
563
|
+
};
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
getCommonPinningStyles(column) {
|
|
567
|
+
const isPinned = column.getIsPinned();
|
|
568
|
+
if (!isPinned) {
|
|
569
|
+
return {};
|
|
347
570
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
aggregationFn: e.columnAggregation ?? void 0,
|
|
360
|
-
enableGrouping: e.enableGrouping ?? !0,
|
|
361
|
-
sortDescFirst: e.sortDescFirst || !0,
|
|
362
|
-
enableResizing: e.enableResizing ?? !0,
|
|
363
|
-
enablePinning: this.enablePinning && (e.enablePinning ?? !0),
|
|
364
|
-
aggregatedCell: (o) => {
|
|
365
|
-
const d = o.getValue();
|
|
366
|
-
return e.aggregatedCell ? e.aggregatedCell(o, u, j) : d;
|
|
367
|
-
}
|
|
368
|
-
}));
|
|
369
|
-
}
|
|
370
|
-
getCommonPinningStyles(t) {
|
|
371
|
-
const e = t.getIsPinned();
|
|
372
|
-
if (!e)
|
|
373
|
-
return {};
|
|
374
|
-
const o = e === "left" && t.getIsLastColumn("left");
|
|
375
|
-
return {
|
|
376
|
-
position: e ? "sticky" : "relative",
|
|
377
|
-
left: e === "left" ? `${t.getStart("left")}px` : void 0,
|
|
378
|
-
right: e === "right" ? "0px" : void 0,
|
|
379
|
-
boxShadow: o && t.columnDef.type !== "checkbox" ? "-4px 0 4px -4px gray inset" : void 0,
|
|
380
|
-
zIndex: `${e ? 1 : "auto"}`,
|
|
381
|
-
background: e ? "var(--background-paper, #fff)" : void 0
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
togglePin(t) {
|
|
385
|
-
t.column.getIsPinned() ? t.column.pin(!1) : t.column.pin("left");
|
|
386
|
-
}
|
|
387
|
-
// export to excel and csv
|
|
388
|
-
exportDataToCsv() {
|
|
389
|
-
const t = this.getAllRowsIncludingGrouped(this.table.getRowModel().rows);
|
|
390
|
-
if (!t || t.length === 0) {
|
|
391
|
-
console.warn("No data to export");
|
|
392
|
-
return;
|
|
571
|
+
const isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
|
|
572
|
+
return {
|
|
573
|
+
position: isPinned ? 'sticky' : 'relative',
|
|
574
|
+
left: isPinned === 'left' ? `${column.getStart('left')}px` : undefined,
|
|
575
|
+
right: isPinned === 'right' ? `0px` : undefined,
|
|
576
|
+
boxShadow: isLastLeftPinnedColumn && column.columnDef.type !== 'checkbox'
|
|
577
|
+
? '-4px 0 4px -4px gray inset'
|
|
578
|
+
: undefined,
|
|
579
|
+
zIndex: `${isPinned ? 1 : 'auto'}`,
|
|
580
|
+
background: isPinned ? 'var(--background-paper, #fff)' : undefined,
|
|
581
|
+
};
|
|
393
582
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}).join(","));
|
|
402
|
-
o.unshift(e);
|
|
403
|
-
const d = o.join(`
|
|
404
|
-
`), s = new Blob([d], { type: "text/csv;charset=utf-8;" }), p = prompt(R("Zadejte název souboru:"), "data");
|
|
405
|
-
if (!p)
|
|
406
|
-
return;
|
|
407
|
-
const g = URL.createObjectURL(s), h = document.createElement("a");
|
|
408
|
-
h.href = g, h.download = `${p}.csv`, h.click(), URL.revokeObjectURL(g);
|
|
409
|
-
}
|
|
410
|
-
async exportDataToExcel() {
|
|
411
|
-
await this.loadXLSX();
|
|
412
|
-
const t = window.XLSX, e = this.getAllRowsIncludingGrouped(this.table.getRowModel().rows);
|
|
413
|
-
if (!e || e.length === 0) {
|
|
414
|
-
console.warn("No data to export");
|
|
415
|
-
return;
|
|
583
|
+
togglePin(header) {
|
|
584
|
+
if (header.column.getIsPinned()) {
|
|
585
|
+
header.column.pin(false); // Odpinovanie
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
header.column.pin('left'); // Pripnutie doľava
|
|
589
|
+
}
|
|
416
590
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
591
|
+
// export to excel and csv
|
|
592
|
+
exportDataToCsv() {
|
|
593
|
+
const rows = this.getAllRowsIncludingGrouped(this.table.getRowModel().rows); // Získanie všetkých riadkov vrátane skupín
|
|
594
|
+
if (!rows || rows.length === 0) {
|
|
595
|
+
console.warn('No data to export');
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
// Generovanie hlavičky CSV zo stĺpcov
|
|
599
|
+
const header = this.columns
|
|
600
|
+
.map((col) => col.headerName || '') // Získanie názvov stĺpcov
|
|
601
|
+
.join(',');
|
|
602
|
+
// Generovanie dát pre CSV
|
|
603
|
+
const csvRows = rows.map((row) => {
|
|
604
|
+
return this.columns
|
|
605
|
+
.map((col) => {
|
|
606
|
+
const accessor = col.field; // Získanie kľúča pre hodnotu
|
|
607
|
+
if (row.getIsGrouped?.()) {
|
|
608
|
+
// Ak je skupinový riadok, pridaj počet záznamov do prvej bunky
|
|
609
|
+
if (col.field === row.groupingColumnId) {
|
|
610
|
+
return `"${row.getValue(col.field)} (${row.subRows.length})"`;
|
|
611
|
+
}
|
|
612
|
+
return ''; // Ostatné stĺpce v skupinovom riadku prázdne
|
|
613
|
+
}
|
|
614
|
+
const value = row.getValue?.(accessor) || ''; // Získanie hodnoty pre normálny riadok
|
|
615
|
+
return typeof value === 'string'
|
|
616
|
+
? `"${value.replace(/"/g, '""')}"` // Ošetrenie dvojitých úvodzoviek
|
|
617
|
+
: value;
|
|
618
|
+
})
|
|
619
|
+
.join(',');
|
|
620
|
+
});
|
|
621
|
+
// Pridanie hlavičky na začiatok CSV
|
|
622
|
+
csvRows.unshift(header);
|
|
623
|
+
// Vytvorenie CSV súboru
|
|
624
|
+
const csvContent = csvRows.join('\n');
|
|
625
|
+
const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
|
|
626
|
+
// Export do súboru
|
|
627
|
+
const fileName = prompt(msg('Zadejte název souboru:'), 'data');
|
|
628
|
+
// Ak používateľ stlačí Cancel, export sa zruší
|
|
629
|
+
if (!fileName) {
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
// Stiahnutie CSV súboru
|
|
633
|
+
const url = URL.createObjectURL(blob);
|
|
634
|
+
const link = document.createElement('a');
|
|
635
|
+
link.href = url;
|
|
636
|
+
link.download = `${fileName}.csv`;
|
|
637
|
+
link.click();
|
|
638
|
+
URL.revokeObjectURL(url);
|
|
639
|
+
}
|
|
640
|
+
async exportDataToExcel() {
|
|
641
|
+
await this.loadXLSX(); // Ensure XLSX is loaded
|
|
642
|
+
const XLSX = window.XLSX;
|
|
643
|
+
const rows = this.getAllRowsIncludingGrouped(this.table.getRowModel().rows); // Získanie všetkých riadkov vrátane skupín
|
|
644
|
+
if (!rows || rows.length === 0) {
|
|
645
|
+
console.warn('No data to export');
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
// Príprava dát pre Excel
|
|
649
|
+
const data = rows.map((row) => {
|
|
650
|
+
const formattedRow = {};
|
|
651
|
+
this.columns.forEach((col) => {
|
|
652
|
+
const columnName = col.headerName || ''; // Dynamický názov stĺpca
|
|
653
|
+
const accessor = col.field; // Dynamický kľúč pre hodnoty
|
|
654
|
+
if (row.getIsGrouped?.()) {
|
|
655
|
+
// Skupinový riadok
|
|
656
|
+
if (col.field === row.groupingColumnId) {
|
|
657
|
+
// Pridanie názvu skupiny a počtu záznamov
|
|
658
|
+
formattedRow[columnName] =
|
|
659
|
+
`${row.getValue(accessor)} (${row.subRows.length})`;
|
|
660
|
+
}
|
|
661
|
+
else {
|
|
662
|
+
// Ostatné stĺpce prázdne
|
|
663
|
+
formattedRow[columnName] = '';
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
else if (accessor) {
|
|
667
|
+
// Normálny riadok
|
|
668
|
+
formattedRow[columnName] = row.getValue?.(accessor) || '';
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
return formattedRow;
|
|
672
|
+
});
|
|
673
|
+
// Vytvorenie pracovného listu a zošita
|
|
674
|
+
const worksheet = XLSX.utils.json_to_sheet(data); // Konverzia dát do Excel formátu
|
|
675
|
+
// Automatické prispôsobenie šírky stĺpcov
|
|
676
|
+
const colWidths = this.columns.map((col, colIndex) => {
|
|
677
|
+
const maxContentLength = Math.max(col.headerName?.length || 10, // Dĺžka názvu stĺpca
|
|
678
|
+
...data.map((row) => row[col.headerName || '']?.toString().length || 0));
|
|
679
|
+
return { wch: maxContentLength + 2 }; // Pridanie extra priestoru
|
|
680
|
+
});
|
|
681
|
+
worksheet['!cols'] = colWidths; // Nastavenie šírky stĺpcov
|
|
682
|
+
const workbook = XLSX.utils.book_new(); // Nový Excel zošit
|
|
683
|
+
XLSX.utils.book_append_sheet(workbook, worksheet, 'Data'); // Pridanie dát do zošita
|
|
684
|
+
// Export do súboru
|
|
685
|
+
const fileName = prompt(msg('Zadejte název souboru:'), 'data');
|
|
686
|
+
// Ak používateľ stlačí Cancel, export sa zruší
|
|
687
|
+
if (!fileName) {
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
XLSX.writeFile(workbook, `${fileName}.xlsx`);
|
|
691
|
+
}
|
|
692
|
+
getAllRowsIncludingGrouped(rows) {
|
|
693
|
+
const allRows = [];
|
|
694
|
+
rows.forEach((row) => {
|
|
695
|
+
if (row.getIsGrouped?.()) {
|
|
696
|
+
allRows.push(row);
|
|
697
|
+
if (row.subRows && row.subRows.length > 0) {
|
|
698
|
+
allRows.push(...this.getAllRowsIncludingGrouped(row.subRows));
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
else {
|
|
702
|
+
allRows.push(row);
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
return allRows.filter((row, index, self) => index === self.findIndex((r) => r.id === row.id));
|
|
706
|
+
}
|
|
707
|
+
startScroll(direction) {
|
|
708
|
+
const grid = this.tableContainerRef.value;
|
|
709
|
+
if (!grid)
|
|
710
|
+
return;
|
|
711
|
+
const scrollAmount = direction === 'left' ? -15 : 15;
|
|
712
|
+
const scroll = () => {
|
|
713
|
+
grid.scrollLeft += scrollAmount;
|
|
714
|
+
this.updateScrollState();
|
|
715
|
+
this.scrollInterval = requestAnimationFrame(scroll);
|
|
716
|
+
};
|
|
717
|
+
this.scrollInterval = requestAnimationFrame(scroll);
|
|
718
|
+
}
|
|
719
|
+
stopScroll() {
|
|
720
|
+
if (this.scrollInterval) {
|
|
721
|
+
cancelAnimationFrame(this.scrollInterval);
|
|
722
|
+
this.scrollInterval = null;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
// centralize your “at end” logic
|
|
726
|
+
_atScrollEnd(container) {
|
|
727
|
+
const thresh = this.scrollEndThreshold ?? 100;
|
|
728
|
+
// if not scrollable OR within threshold of bottom
|
|
729
|
+
return (container.scrollHeight <= container.clientHeight ||
|
|
730
|
+
container.scrollTop + container.clientHeight >= container.scrollHeight - thresh);
|
|
731
|
+
}
|
|
732
|
+
_maybeTriggerScrollEnd() {
|
|
733
|
+
if (this._atScrollEnd(this._container) &&
|
|
734
|
+
this.onRowsScrollEnd &&
|
|
735
|
+
!this.isLoading &&
|
|
736
|
+
!this.scrollToEnd) {
|
|
737
|
+
this.scrollToEnd = true;
|
|
738
|
+
this.onRowsScrollEnd();
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
handleScroll(_event) {
|
|
742
|
+
// every scroll, re‑test
|
|
743
|
+
this._maybeTriggerScrollEnd();
|
|
744
|
+
}
|
|
745
|
+
// handleScroll(event: Event) {
|
|
746
|
+
// const container = event.target as HTMLElement;
|
|
747
|
+
// if (
|
|
748
|
+
// container.scrollTop + container.clientHeight >=
|
|
749
|
+
// container.scrollHeight - (this.scrollEndThreshold || 100) &&
|
|
750
|
+
// this.onRowsScrollEnd &&
|
|
751
|
+
// !this.isLoading &&
|
|
752
|
+
// !this.scrollToEnd
|
|
753
|
+
// ) {
|
|
754
|
+
// this.scrollToEnd = true;
|
|
755
|
+
// this.onRowsScrollEnd();
|
|
756
|
+
// }
|
|
757
|
+
// }
|
|
758
|
+
handleGetTotalNumber() {
|
|
759
|
+
if (this.getTotalNumberFn) {
|
|
760
|
+
this.getTotalNumberFn();
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
toggleCustomPopover() {
|
|
764
|
+
this.isOpen = !this.isOpen;
|
|
765
|
+
}
|
|
766
|
+
closePopover() {
|
|
767
|
+
this.isOpen = false;
|
|
768
|
+
}
|
|
769
|
+
toggleColumn(field) {
|
|
770
|
+
this.columnVisibility = {
|
|
771
|
+
...this.columnVisibility,
|
|
772
|
+
[field]: !(this.columnVisibility?.[field] ?? true),
|
|
773
|
+
};
|
|
774
|
+
this.table.setColumnVisibility(this.columnVisibility);
|
|
775
|
+
}
|
|
776
|
+
onSettingsChangedCallback(value) {
|
|
777
|
+
if (value?.enableSorting !== undefined) {
|
|
778
|
+
this.enableSorting = value.enableSorting;
|
|
779
|
+
}
|
|
780
|
+
if (value?.enableFiltering !== undefined) {
|
|
781
|
+
this.enableFiltering = value.enableFiltering;
|
|
782
|
+
}
|
|
783
|
+
if (value?.columnDefaultSize !== undefined) {
|
|
784
|
+
this.columnDefaultSize = value.columnDefaultSize;
|
|
785
|
+
}
|
|
786
|
+
if (value?.columnGroupedColor !== undefined) {
|
|
787
|
+
this.columnGroupedColor = value.columnGroupedColor;
|
|
788
|
+
}
|
|
789
|
+
if (value?.rowAggregationColor !== undefined) {
|
|
790
|
+
this.rowAggregationColor = value.rowAggregationColor;
|
|
791
|
+
}
|
|
792
|
+
if (value?.enableGrouping !== undefined) {
|
|
793
|
+
this.enableGrouping = value.enableGrouping;
|
|
794
|
+
}
|
|
795
|
+
if (value?.exportData !== undefined) {
|
|
796
|
+
this.exportData = value.exportData;
|
|
797
|
+
}
|
|
798
|
+
if (value?.actionButtonsInMenu !== undefined) {
|
|
799
|
+
this.actionButtonsInMenu = value.actionButtonsInMenu;
|
|
800
|
+
}
|
|
801
|
+
if (value?.hideFooter !== undefined) {
|
|
802
|
+
this.hideFooter = value.hideFooter;
|
|
803
|
+
}
|
|
804
|
+
if (value?.enableColumnPinning !== undefined) {
|
|
805
|
+
this.enableColumnPinning = value.enableColumnPinning;
|
|
806
|
+
}
|
|
807
|
+
this.initTable();
|
|
808
|
+
this.requestUpdate();
|
|
809
|
+
if (this.onSettingsChanged) {
|
|
810
|
+
this.dispatchEvent(new CustomEvent('onSettingsChanged', {
|
|
811
|
+
bubbles: true,
|
|
812
|
+
composed: true,
|
|
813
|
+
detail: value,
|
|
814
|
+
}));
|
|
815
|
+
this.onSettingsChanged?.(value);
|
|
816
|
+
}
|
|
516
817
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
818
|
+
_onRowMouseDown(event, row) {
|
|
819
|
+
this.handleMouseDown(event, row);
|
|
820
|
+
// do not highlight cell text if multirow selection is enabled and shift key is pressed
|
|
821
|
+
if (event.shiftKey) {
|
|
822
|
+
if (event.currentTarget) {
|
|
823
|
+
event.currentTarget.classList.add('no-select');
|
|
824
|
+
}
|
|
825
|
+
// Optionally, clear existing selection:
|
|
826
|
+
const selection = window.getSelection();
|
|
827
|
+
if (selection) {
|
|
828
|
+
selection.removeAllRanges();
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
_onRowMouseUp(event) {
|
|
833
|
+
event.currentTarget.classList.remove('no-select');
|
|
834
|
+
}
|
|
835
|
+
_rowUnselectAll(table) {
|
|
836
|
+
table.resetRowSelection();
|
|
837
|
+
this.focusedRowIndex = 0;
|
|
838
|
+
}
|
|
839
|
+
render() {
|
|
840
|
+
const filteredColumns = this.columns?.filter((col) => {
|
|
841
|
+
const name = col.headerName?.toLowerCase() || col.field.toLowerCase();
|
|
842
|
+
return name.includes(this.filterText);
|
|
843
|
+
}) || [];
|
|
844
|
+
// checbox column for multiple selection
|
|
845
|
+
const checkboxColumn = this.enableMultiRowSelection
|
|
846
|
+
? [
|
|
847
|
+
{
|
|
848
|
+
id: 'checkboxForMultiselect',
|
|
849
|
+
type: 'checkbox',
|
|
850
|
+
minSize: 30,
|
|
851
|
+
size: 30,
|
|
852
|
+
enablePinning: false,
|
|
853
|
+
enableResizing: false,
|
|
854
|
+
header: ({ table }) => html `
|
|
538
855
|
<div style="position: absolute; left: 0; bottom: 0; margin: 0.65rem 0;">
|
|
539
856
|
<lit-checkbox
|
|
540
857
|
type="checkbox"
|
|
541
|
-
.onChange="${() =>
|
|
542
|
-
|
|
543
|
-
|
|
858
|
+
.onChange="${() => table.getIsSomeRowsSelected()
|
|
859
|
+
? this._rowUnselectAll(table)
|
|
860
|
+
: table.toggleAllRowsSelected()}"
|
|
861
|
+
.checked="${table.getIsAllRowsSelected()}"
|
|
862
|
+
.indeterminate="${table.getIsSomeRowsSelected()}"
|
|
544
863
|
></lit-checkbox>
|
|
545
864
|
</div>
|
|
546
865
|
`,
|
|
547
|
-
|
|
866
|
+
cell: ({ table, row }) => html `
|
|
548
867
|
<div
|
|
549
868
|
style="padding: 0.1875rem 0px 0px 0px"
|
|
550
|
-
@click=${(
|
|
869
|
+
@click=${(e) => e.stopPropagation()}
|
|
551
870
|
>
|
|
552
871
|
<lit-checkbox
|
|
553
872
|
type="checkbox"
|
|
554
|
-
.onChange="${(
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
873
|
+
.onChange="${(e) => {
|
|
874
|
+
e.stopPropagation();
|
|
875
|
+
row.toggleSelected(e.target.checked);
|
|
876
|
+
}}"
|
|
877
|
+
.checked="${row.getIsSelected()}"
|
|
878
|
+
?disabled="${!row.getCanSelect()}"
|
|
879
|
+
.indeterminate="${row.getIsSomeSelected()}"
|
|
560
880
|
></lit-checkbox>
|
|
561
881
|
</div>
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
columnResizeMode: "onChange",
|
|
569
|
-
columnResizeDirection: "ltr",
|
|
570
|
-
defaultColumn: {
|
|
571
|
-
size: this.columnDefaultSize || void 0,
|
|
572
|
-
//starting column size
|
|
573
|
-
minSize: this.columnDefaultMinSize || 100,
|
|
574
|
-
//enforced during column resizing
|
|
575
|
-
maxSize: this.columnDefaultMaxSize || 500
|
|
576
|
-
//enforced during column resizing
|
|
577
|
-
},
|
|
578
|
-
initialState: {
|
|
579
|
-
// columnFilters: [...(this.initialFiltering || [])],
|
|
580
|
-
// sorting: [...(this.initialSorting || [])],
|
|
581
|
-
// expanded: { ...this.initialRowExpanded },
|
|
582
|
-
grouping: [...this.initialGroups || []],
|
|
583
|
-
columnVisibility: { ...this.initialColumnVisibility },
|
|
584
|
-
columnPinning: {
|
|
585
|
-
left: [...this.leftPinnedColumns || [], "checkboxForMultiselect"],
|
|
586
|
-
right: ["actions"]
|
|
882
|
+
`,
|
|
883
|
+
},
|
|
884
|
+
]
|
|
885
|
+
: [];
|
|
886
|
+
if (getLocale() !== this.userLang) {
|
|
887
|
+
setLocale(this.userLang || 'cs');
|
|
587
888
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
889
|
+
this.table = this.tableController.table({
|
|
890
|
+
data: this.rows || [],
|
|
891
|
+
columns: [...checkboxColumn, ...this.getTanstackColumns(this.getColumns)],
|
|
892
|
+
columnResizeMode: 'onChange',
|
|
893
|
+
columnResizeDirection: 'ltr',
|
|
894
|
+
defaultColumn: {
|
|
895
|
+
size: this.columnDefaultSize || undefined, //starting column size
|
|
896
|
+
minSize: this.columnDefaultMinSize || 100, //enforced during column resizing
|
|
897
|
+
maxSize: this.columnDefaultMaxSize || 500, //enforced during column resizing
|
|
898
|
+
},
|
|
899
|
+
initialState: {
|
|
900
|
+
// columnFilters: [...(this.initialFiltering || [])],
|
|
901
|
+
// sorting: [...(this.initialSorting || [])],
|
|
902
|
+
// expanded: { ...this.initialRowExpanded },
|
|
903
|
+
grouping: [...(this.initialGroups || [])],
|
|
904
|
+
columnVisibility: { ...this.initialColumnVisibility },
|
|
905
|
+
columnPinning: {
|
|
906
|
+
left: [...(this.leftPinnedColumns || []), 'checkboxForMultiselect'],
|
|
907
|
+
right: ['actions'],
|
|
908
|
+
},
|
|
909
|
+
},
|
|
910
|
+
state: {
|
|
911
|
+
columnVisibility: this.columnVisibility,
|
|
912
|
+
// columnFilters: this.server ? this.filtersServer : this.filters,
|
|
913
|
+
columnFilters: this.initialFiltering,
|
|
914
|
+
sorting: this.initialSorting,
|
|
915
|
+
rowSelection: this.rowsSelected,
|
|
916
|
+
columnSizing: this.columnSizing,
|
|
917
|
+
expanded: this.initialRowExpanded,
|
|
918
|
+
columnOrder: this.columnOrder,
|
|
919
|
+
},
|
|
920
|
+
filterFns: {
|
|
921
|
+
dateRangeFilterFn: dateRangeFilterFn,
|
|
922
|
+
dateFilterFn: dateFilterFn,
|
|
923
|
+
multiselectFilterFn: multiselectFilterFn,
|
|
924
|
+
},
|
|
925
|
+
// debugTable: true,
|
|
926
|
+
enableRowSelection: this.enableRowSelection,
|
|
927
|
+
enableMultiRowSelection: this.enableMultiRowSelection,
|
|
928
|
+
enableColumnPinning: this.enableColumnPinning,
|
|
929
|
+
enableGrouping: this.enableGrouping,
|
|
930
|
+
manualFiltering: this.server,
|
|
931
|
+
manualSorting: this.server,
|
|
932
|
+
enableSorting: this.enableSorting,
|
|
933
|
+
getRowId: (row, index) => this.getRowId ? this.getRowId(row, index) : index.toString(),
|
|
934
|
+
// groupedColumnMode: 'reorder',
|
|
935
|
+
getCoreRowModel: getCoreRowModel(),
|
|
936
|
+
getSortedRowModel: getSortedRowModel(),
|
|
937
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
938
|
+
getFacetedRowModel: getFacetedRowModel(),
|
|
939
|
+
getGroupedRowModel: getGroupedRowModel(),
|
|
940
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
941
|
+
getFacetedUniqueValues: getFacetedUniqueValues(),
|
|
942
|
+
onColumnFiltersChange: (updaterOrValue) => {
|
|
943
|
+
this.currentScrollTop = 0;
|
|
944
|
+
const scrollElement = this.tableContainerRef.value;
|
|
945
|
+
if (scrollElement) {
|
|
946
|
+
scrollElement.scrollTop = 0;
|
|
947
|
+
}
|
|
948
|
+
const filtersState = typeof updaterOrValue === 'function'
|
|
949
|
+
? updaterOrValue(this.table.getState().columnFilters)
|
|
950
|
+
: updaterOrValue;
|
|
951
|
+
this.initialFiltering = filtersState;
|
|
952
|
+
if (this.onColumnFiltersChanged) {
|
|
953
|
+
this.onColumnFiltersChanged(this.table, filtersState);
|
|
954
|
+
}
|
|
955
|
+
},
|
|
956
|
+
onSortingChange: (updaterOrValue) => {
|
|
957
|
+
this.currentScrollTop = 0;
|
|
958
|
+
const scrollElement = this.tableContainerRef.value;
|
|
959
|
+
if (scrollElement) {
|
|
960
|
+
scrollElement.scrollTop = 0;
|
|
961
|
+
}
|
|
962
|
+
const sortingState = typeof updaterOrValue === 'function'
|
|
963
|
+
? updaterOrValue(this.table.getState().sorting)
|
|
964
|
+
: updaterOrValue;
|
|
965
|
+
this.initialSorting = sortingState;
|
|
966
|
+
if (this.onColumnSortChanged) {
|
|
967
|
+
this.onColumnSortChanged(this.table, sortingState);
|
|
968
|
+
}
|
|
969
|
+
},
|
|
970
|
+
onRowSelectionChange: (updaterOrValue) => {
|
|
971
|
+
const rowSelection = typeof updaterOrValue === 'function'
|
|
972
|
+
? updaterOrValue(this.rowsSelected)
|
|
973
|
+
: updaterOrValue;
|
|
974
|
+
this.rowsSelected = rowSelection;
|
|
975
|
+
if (this.onRowSelectionChanged) {
|
|
976
|
+
this.onRowSelectionChanged(this.table, rowSelection);
|
|
977
|
+
}
|
|
978
|
+
},
|
|
979
|
+
onColumnSizingChange: (updaterOrValue) => {
|
|
980
|
+
const columnSizingState = typeof updaterOrValue === 'function'
|
|
981
|
+
? updaterOrValue(this.table.getState().columnSizing)
|
|
982
|
+
: updaterOrValue;
|
|
983
|
+
this.columnSizing = columnSizingState;
|
|
984
|
+
if (this.onColumnResize) {
|
|
985
|
+
this.onColumnResize(this.table, columnSizingState);
|
|
986
|
+
}
|
|
987
|
+
},
|
|
988
|
+
onExpandedChange: (updaterOrValue) => {
|
|
989
|
+
const rowExpanded = typeof updaterOrValue === 'function'
|
|
990
|
+
? updaterOrValue(this.initialRowExpanded)
|
|
991
|
+
: updaterOrValue;
|
|
992
|
+
this.initialRowExpanded = _.isEmpty(rowExpanded)
|
|
993
|
+
? this.initialRowExpanded
|
|
994
|
+
: rowExpanded;
|
|
995
|
+
this.requestUpdate();
|
|
996
|
+
// if (this.onColumnResize) {
|
|
997
|
+
// this.onColumnResize(this.table, columnSizingState);
|
|
998
|
+
// }
|
|
999
|
+
},
|
|
1000
|
+
onColumnOrderChange: (updaterOrValue) => {
|
|
1001
|
+
const newOrder = typeof updaterOrValue === 'function'
|
|
1002
|
+
? updaterOrValue(this.columnOrder)
|
|
1003
|
+
: updaterOrValue;
|
|
1004
|
+
this.columnOrder = newOrder;
|
|
1005
|
+
this.render();
|
|
1006
|
+
if (this.onColumnOrderChanged) {
|
|
1007
|
+
this.onColumnOrderChanged(this.table, newOrder);
|
|
1008
|
+
}
|
|
1009
|
+
},
|
|
1010
|
+
onColumnVisibilityChange: (updaterOrValue) => {
|
|
1011
|
+
const columnVisibility = typeof updaterOrValue === 'function'
|
|
1012
|
+
? updaterOrValue(this.table.getState().columnVisibility)
|
|
1013
|
+
: updaterOrValue;
|
|
1014
|
+
this.columnVisibility = columnVisibility;
|
|
1015
|
+
if (this.onColumnVisibilityChanged) {
|
|
1016
|
+
this.onColumnVisibilityChanged(this.table, columnVisibility);
|
|
1017
|
+
}
|
|
1018
|
+
},
|
|
1019
|
+
});
|
|
1020
|
+
this.rowsCount = this.table.getRowModel().rows.length;
|
|
1021
|
+
// Ak virtualizácia nie je povolená, použijeme celý zoznam riadkov alebo stĺpcov
|
|
1022
|
+
const rowVirtualizer = this.enableRowVirtualization
|
|
1023
|
+
? this.rowVirtualizerController?.getVirtualizer()
|
|
1024
|
+
: null;
|
|
1025
|
+
const columnVirtualizer = this.enableColumnVirtualization
|
|
1026
|
+
? this.columnVirtualizerController?.getVirtualizer()
|
|
1027
|
+
: null;
|
|
1028
|
+
const virtualColumns = columnVirtualizer?.getVirtualItems() ?? [];
|
|
1029
|
+
// Get table rows (either virtualized or all)
|
|
1030
|
+
const { rows } = this.table.getRowModel();
|
|
1031
|
+
const rowItems = rowVirtualizer
|
|
1032
|
+
? rowVirtualizer.getVirtualItems()
|
|
1033
|
+
: rows.map((_, index) => ({
|
|
1034
|
+
key: index,
|
|
1035
|
+
index,
|
|
1036
|
+
start: index * this.getRowHeight(),
|
|
1037
|
+
end: (index + 1) * this.getRowHeight(),
|
|
1038
|
+
size: this.getRowHeight(),
|
|
1039
|
+
lane: 0,
|
|
1040
|
+
}));
|
|
1041
|
+
// Calculate padding for virtualization
|
|
1042
|
+
let virtualPaddingLeft;
|
|
1043
|
+
let virtualPaddingRight;
|
|
1044
|
+
if (columnVirtualizer && virtualColumns?.length && this.enableColumnVirtualization) {
|
|
1045
|
+
virtualPaddingLeft = virtualColumns[0]?.start ?? 0;
|
|
1046
|
+
virtualPaddingRight =
|
|
1047
|
+
columnVirtualizer.getTotalSize() -
|
|
1048
|
+
(virtualColumns[virtualColumns.length - 1]?.end ?? 0);
|
|
1049
|
+
}
|
|
1050
|
+
let isMobile = window.matchMedia('(max-width: 600px)').matches;
|
|
1051
|
+
return html `
|
|
668
1052
|
<div class="data-grid__wrapper">
|
|
669
|
-
${this.isScrollable && !
|
|
1053
|
+
${this.isScrollable && !isMobile
|
|
1054
|
+
? html `
|
|
670
1055
|
<lit-icon-button
|
|
671
1056
|
class="scroll-button left"
|
|
672
1057
|
.disabled="${this.disableScrollLeft}"
|
|
673
|
-
@pointerdown="${() => this.startScroll(
|
|
1058
|
+
@pointerdown="${() => this.startScroll('left')}"
|
|
674
1059
|
@pointerup="${this.stopScroll}"
|
|
675
1060
|
@pointerleave="${this.stopScroll}"
|
|
676
1061
|
size="small"
|
|
@@ -681,7 +1066,7 @@ let n = class extends tt {
|
|
|
681
1066
|
<lit-icon-button
|
|
682
1067
|
class="scroll-button right"
|
|
683
1068
|
.disabled="${this.disableScrollRight}"
|
|
684
|
-
@pointerdown="${() => this.startScroll(
|
|
1069
|
+
@pointerdown="${() => this.startScroll('right')}"
|
|
685
1070
|
@pointerup="${this.stopScroll}"
|
|
686
1071
|
@pointerleave="${this.stopScroll}"
|
|
687
1072
|
size="small"
|
|
@@ -689,175 +1074,233 @@ let n = class extends tt {
|
|
|
689
1074
|
icon="arrowRight"
|
|
690
1075
|
>
|
|
691
1076
|
</lit-icon-button>
|
|
692
|
-
`
|
|
1077
|
+
`
|
|
1078
|
+
: null}
|
|
693
1079
|
|
|
694
|
-
<div class="grid" ${
|
|
1080
|
+
<div class="grid" ${ref(this.tableContainerRef)}>
|
|
695
1081
|
<table
|
|
696
1082
|
part="dataGrid-table"
|
|
697
1083
|
style="width: ${this.table.getCenterTotalSize()}px"
|
|
698
1084
|
>
|
|
699
1085
|
<thead
|
|
700
1086
|
part="dataGrid-header"
|
|
701
|
-
style="height: ${this.enableFiltering ?
|
|
1087
|
+
style="height: ${this.enableFiltering ? '4rem' : '1.625rem'};"
|
|
702
1088
|
>
|
|
703
|
-
${
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
${h ? u`
|
|
1089
|
+
${repeat(this.table.getHeaderGroups(), (headerGroup) => headerGroup.id, (headerGroup) => {
|
|
1090
|
+
const headerColumns = this.enableColumnVirtualization
|
|
1091
|
+
? virtualColumns.map((vc) => headerGroup.headers[vc.index])
|
|
1092
|
+
: headerGroup.headers;
|
|
1093
|
+
const newHeaderColumns = this.enableColumnVirtualization
|
|
1094
|
+
? [
|
|
1095
|
+
...headerGroup.headers.filter((hc) => hc.column.getIsPinned()),
|
|
1096
|
+
...headerColumns.filter((hc) => !hc.column.getIsPinned()),
|
|
1097
|
+
]
|
|
1098
|
+
: headerColumns;
|
|
1099
|
+
return html `
|
|
1100
|
+
<tr class="head" data-index="${headerGroup.id}">
|
|
1101
|
+
${virtualPaddingLeft
|
|
1102
|
+
? html `
|
|
718
1103
|
<th
|
|
719
|
-
style=" display: flex; width: ${
|
|
1104
|
+
style=" display: flex; width: ${virtualPaddingLeft}px;"
|
|
720
1105
|
></th>
|
|
721
|
-
`
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
1106
|
+
`
|
|
1107
|
+
: ''}
|
|
1108
|
+
${repeat(newHeaderColumns, (header) => header.id, (header, index) => {
|
|
1109
|
+
const column = header.column;
|
|
1110
|
+
const style = {
|
|
1111
|
+
visibility: column.columnDef.type === 'actions'
|
|
1112
|
+
? 'hidden'
|
|
1113
|
+
: 'visible',
|
|
1114
|
+
...this.getCommonPinningStyles(header.column),
|
|
1115
|
+
width: `${column?.getSize()}px`,
|
|
1116
|
+
flexGrow: `${column.columnDef.size === undefined ? 1 : 'unset'}`,
|
|
1117
|
+
};
|
|
1118
|
+
const filterVariant = column.columnDef.meta?.filterVariant;
|
|
1119
|
+
const filterOperators = column?.columnDef?.meta?.filterOperators ||
|
|
1120
|
+
getOperatorsByColumnType(filterVariant);
|
|
1121
|
+
const value = column?.getFilterValue()?.value ||
|
|
1122
|
+
column?.getFilterValue() ||
|
|
1123
|
+
'';
|
|
1124
|
+
const operator = column?.getFilterValue()?.operator ||
|
|
1125
|
+
filterOperators[0]?.value;
|
|
1126
|
+
let valueOptions = [];
|
|
1127
|
+
if (filterVariant === 'select' ||
|
|
1128
|
+
filterVariant === 'multiselect') {
|
|
1129
|
+
if (column?.columnDef?.meta.valueOptions ||
|
|
1130
|
+
this.server) {
|
|
1131
|
+
valueOptions =
|
|
1132
|
+
column?.columnDef?.meta
|
|
1133
|
+
.valueOptions || [];
|
|
1134
|
+
}
|
|
1135
|
+
else {
|
|
1136
|
+
const sortedUniqueValues = Array.from(column
|
|
1137
|
+
?.getFacetedUniqueValues()
|
|
1138
|
+
.keys())
|
|
1139
|
+
.sort()
|
|
1140
|
+
.slice(0, 5000);
|
|
1141
|
+
valueOptions = sortedUniqueValues.map((value) => ({
|
|
1142
|
+
value,
|
|
1143
|
+
label: value,
|
|
1144
|
+
}));
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
return html `
|
|
743
1148
|
<th
|
|
744
1149
|
class="head"
|
|
745
|
-
style="${
|
|
746
|
-
colspan="${
|
|
747
|
-
data-index="${
|
|
1150
|
+
style="${styleMap(style)}"
|
|
1151
|
+
colspan="${header.colSpan}"
|
|
1152
|
+
data-index="${header.id}"
|
|
748
1153
|
>
|
|
749
|
-
${
|
|
1154
|
+
${header.isPlaceholder
|
|
1155
|
+
? ''
|
|
1156
|
+
: html `
|
|
750
1157
|
<div
|
|
751
|
-
class="resizer ${this
|
|
752
|
-
|
|
1158
|
+
class="resizer ${this
|
|
1159
|
+
.table.options
|
|
1160
|
+
.columnResizeDirection} ${header.column.getIsResizing()
|
|
1161
|
+
? 'is-resizing'
|
|
1162
|
+
: ''}"
|
|
1163
|
+
style="transform: ${this
|
|
1164
|
+
.table.options
|
|
1165
|
+
.columnResizeMode ===
|
|
1166
|
+
'onEnd' &&
|
|
1167
|
+
header.column.getIsResizing()
|
|
1168
|
+
? `translateX(${(this.table
|
|
1169
|
+
.options
|
|
1170
|
+
.columnResizeDirection ===
|
|
1171
|
+
'rtl'
|
|
1172
|
+
? -1
|
|
1173
|
+
: 1) *
|
|
1174
|
+
(this.table.getState()
|
|
1175
|
+
.columnSizingInfo
|
|
1176
|
+
.deltaOffset ??
|
|
1177
|
+
0)}px)`
|
|
1178
|
+
: ''}"
|
|
753
1179
|
>
|
|
754
1180
|
<div class="header">
|
|
755
|
-
${
|
|
1181
|
+
${header.column.getIsFiltered()
|
|
1182
|
+
? html `
|
|
756
1183
|
<div
|
|
757
1184
|
class="filterCirclePoint"
|
|
758
1185
|
></div>
|
|
759
|
-
`
|
|
1186
|
+
`
|
|
1187
|
+
: ''}
|
|
760
1188
|
<div
|
|
761
1189
|
class="column-header"
|
|
762
|
-
@click=${
|
|
1190
|
+
@click=${header.column.getToggleSortingHandler()}
|
|
763
1191
|
>
|
|
764
1192
|
<lit-overflow-tooltip
|
|
765
|
-
label="${
|
|
1193
|
+
label="${header
|
|
1194
|
+
.column
|
|
1195
|
+
.columnDef
|
|
1196
|
+
.header}"
|
|
766
1197
|
>
|
|
767
|
-
${
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
1198
|
+
${flexRender(header
|
|
1199
|
+
.column
|
|
1200
|
+
.columnDef
|
|
1201
|
+
.header, header.getContext())}
|
|
771
1202
|
</lit-overflow-tooltip>
|
|
772
1203
|
</div>
|
|
773
1204
|
|
|
774
1205
|
<div
|
|
775
1206
|
class="icons-group-pin"
|
|
776
1207
|
>
|
|
777
|
-
${
|
|
1208
|
+
${header.column.getCanSort()
|
|
1209
|
+
? header.column.getIsSorted()
|
|
1210
|
+
? header.column.getIsSorted() ===
|
|
1211
|
+
'asc'
|
|
1212
|
+
? html `<slot
|
|
778
1213
|
name="iconSortUp"
|
|
779
1214
|
><lit-icon
|
|
780
1215
|
class="cursor"
|
|
781
|
-
@click=${
|
|
1216
|
+
@click=${header.column.getToggleSortingHandler()}
|
|
782
1217
|
size="0.75rem"
|
|
783
1218
|
icon="chevronUpFilled"
|
|
784
1219
|
></lit-icon
|
|
785
|
-
></slot>`
|
|
1220
|
+
></slot>`
|
|
1221
|
+
: html `<slot
|
|
786
1222
|
name="iconSortDown"
|
|
787
1223
|
>
|
|
788
1224
|
<lit-icon
|
|
789
1225
|
class="cursor"
|
|
790
|
-
@click=${
|
|
1226
|
+
@click=${header.column.getToggleSortingHandler()}
|
|
791
1227
|
size="0.75rem"
|
|
792
1228
|
icon="chevronDownFilled"
|
|
793
1229
|
></lit-icon>
|
|
794
|
-
</slot>`
|
|
1230
|
+
</slot>`
|
|
1231
|
+
: html `<div
|
|
795
1232
|
class="sortFilled"
|
|
796
1233
|
>
|
|
797
1234
|
<lit-icon
|
|
798
1235
|
class="cursor"
|
|
799
|
-
@click=${
|
|
1236
|
+
@click=${header.column.getToggleSortingHandler()}
|
|
800
1237
|
size="0.75rem"
|
|
801
1238
|
icon="sortFilled"
|
|
802
1239
|
></lit-icon>
|
|
803
|
-
</div>`
|
|
1240
|
+
</div>`
|
|
1241
|
+
: html `<div></div>`}
|
|
804
1242
|
<div class="flex">
|
|
805
|
-
${this
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
)}"
|
|
811
|
-
.header="${c}"
|
|
812
|
-
.table="${this.table}"
|
|
813
|
-
></lit-data-grid-action-buttons-popover>
|
|
814
|
-
` : u`
|
|
815
|
-
${c.column.getCanPin() ? u`
|
|
1243
|
+
${!this
|
|
1244
|
+
.actionButtonsInMenu
|
|
1245
|
+
? html `
|
|
1246
|
+
${header.column.getCanPin()
|
|
1247
|
+
? html `
|
|
816
1248
|
<lit-icon-button
|
|
817
|
-
@click="${() => this.togglePin(
|
|
818
|
-
c
|
|
819
|
-
)}"
|
|
1249
|
+
@click="${() => this.togglePin(header)}"
|
|
820
1250
|
size="small"
|
|
821
1251
|
variant="text"
|
|
822
1252
|
icon="pin"
|
|
823
|
-
.active="${
|
|
1253
|
+
.active="${header.column.getIsPinned()}"
|
|
824
1254
|
>
|
|
825
1255
|
</lit-icon-button>
|
|
826
1256
|
<simple-tooltip
|
|
827
1257
|
placement="bottom"
|
|
828
|
-
>${
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
"Připnout sloupec vlevo"
|
|
832
|
-
)}
|
|
1258
|
+
>${header.column.getIsPinned()
|
|
1259
|
+
? msg('Zrušit připnutí sloupce')
|
|
1260
|
+
: msg('Připnout sloupec vlevo')}
|
|
833
1261
|
</simple-tooltip>
|
|
834
|
-
`
|
|
835
|
-
|
|
1262
|
+
`
|
|
1263
|
+
: ''}
|
|
1264
|
+
${header.column.getCanGroup()
|
|
1265
|
+
? html `
|
|
836
1266
|
<lit-icon-button
|
|
837
|
-
@click="${
|
|
1267
|
+
@click="${header.column.getToggleGroupingHandler()}"
|
|
838
1268
|
size="small"
|
|
839
1269
|
variant="text"
|
|
840
|
-
.active="${
|
|
1270
|
+
.active="${header.column.getIsGrouped()}"
|
|
841
1271
|
icon="agregation"
|
|
842
1272
|
>
|
|
843
1273
|
</lit-icon-button>
|
|
844
1274
|
<simple-tooltip
|
|
845
1275
|
placement="bottom"
|
|
846
1276
|
>
|
|
847
|
-
${
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
"Seskupit sloupec"
|
|
851
|
-
)}</simple-tooltip
|
|
1277
|
+
${header.column.getIsGrouped()
|
|
1278
|
+
? msg('Zrušit seskupení')
|
|
1279
|
+
: msg('Seskupit sloupec')}</simple-tooltip
|
|
852
1280
|
>
|
|
853
|
-
`
|
|
1281
|
+
`
|
|
1282
|
+
: ''}
|
|
1283
|
+
`
|
|
1284
|
+
: html `
|
|
1285
|
+
<lit-data-grid-action-buttons-popover
|
|
1286
|
+
.group="${header.column.getToggleGroupingHandler()}"
|
|
1287
|
+
.pin="${() => this.togglePin(header)}"
|
|
1288
|
+
.header="${header}"
|
|
1289
|
+
.table="${this
|
|
1290
|
+
.table}"
|
|
1291
|
+
></lit-data-grid-action-buttons-popover>
|
|
854
1292
|
`}
|
|
855
|
-
${this
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
1293
|
+
${this
|
|
1294
|
+
.enableColumnOrdering &&
|
|
1295
|
+
!header.column.getIsPinned() &&
|
|
1296
|
+
!header.column.getIsGrouped() &&
|
|
1297
|
+
![
|
|
1298
|
+
'checkbox',
|
|
1299
|
+
'actions',
|
|
1300
|
+
].includes(header
|
|
1301
|
+
.column
|
|
1302
|
+
.id)
|
|
1303
|
+
? html `<div
|
|
861
1304
|
class="drag-handle"
|
|
862
1305
|
>
|
|
863
1306
|
<lit-icon
|
|
@@ -867,235 +1310,296 @@ let n = class extends tt {
|
|
|
867
1310
|
</div>
|
|
868
1311
|
<simple-tooltip
|
|
869
1312
|
placement="bottom"
|
|
870
|
-
>${
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
> ` : null}
|
|
1313
|
+
>${msg('Přesunout sloupec')}</simple-tooltip
|
|
1314
|
+
> `
|
|
1315
|
+
: null}
|
|
874
1316
|
</div>
|
|
875
1317
|
</div>
|
|
876
1318
|
</div>
|
|
877
1319
|
</div>
|
|
878
|
-
${
|
|
1320
|
+
${header.column.getCanFilter()
|
|
1321
|
+
? html `
|
|
879
1322
|
<div>
|
|
880
1323
|
<filter-inputs
|
|
881
|
-
.minFilterCharacters=${this
|
|
882
|
-
|
|
883
|
-
.
|
|
884
|
-
.
|
|
885
|
-
|
|
886
|
-
.
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
.
|
|
1324
|
+
.minFilterCharacters=${this
|
|
1325
|
+
.minFilterCharacters}
|
|
1326
|
+
.column=${header.column}
|
|
1327
|
+
.dateFormat=${this
|
|
1328
|
+
.dateFormat}
|
|
1329
|
+
.userLang=${this
|
|
1330
|
+
.userLang}
|
|
1331
|
+
@filter-tab=${this
|
|
1332
|
+
.handleFilterTabNavigation}
|
|
1333
|
+
.server=${this
|
|
1334
|
+
.server}
|
|
1335
|
+
.value="${value}"
|
|
1336
|
+
.operator="${operator}"
|
|
1337
|
+
.filterVariant="${filterVariant}"
|
|
1338
|
+
.filterOperators="${filterOperators}"
|
|
891
1339
|
></filter-inputs>
|
|
892
1340
|
</div>
|
|
893
|
-
`
|
|
1341
|
+
`
|
|
1342
|
+
: null}
|
|
894
1343
|
`}
|
|
895
1344
|
<div
|
|
896
1345
|
class="resize-handle"
|
|
897
|
-
@dblclick="${(
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
@mousedown="${(
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
@touchstart="${(
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
1346
|
+
@dblclick="${(event) => {
|
|
1347
|
+
if (event.target.classList.contains('resize-handle')) {
|
|
1348
|
+
header.column.resetSize();
|
|
1349
|
+
}
|
|
1350
|
+
}}"
|
|
1351
|
+
@mousedown="${(event) => {
|
|
1352
|
+
event.preventDefault();
|
|
1353
|
+
event.stopPropagation();
|
|
1354
|
+
if (event.target.classList.contains('resize-handle')) {
|
|
1355
|
+
header.getResizeHandler()(event);
|
|
1356
|
+
}
|
|
1357
|
+
}}"
|
|
1358
|
+
@touchstart="${(event) => {
|
|
1359
|
+
event.preventDefault();
|
|
1360
|
+
event.stopPropagation();
|
|
1361
|
+
if (event.target.classList.contains('resize-handle')) {
|
|
1362
|
+
header.getResizeHandler()(event);
|
|
1363
|
+
}
|
|
1364
|
+
}}"
|
|
916
1365
|
></div>
|
|
917
1366
|
</th>
|
|
918
1367
|
`;
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
1368
|
+
})}
|
|
1369
|
+
${virtualPaddingRight
|
|
1370
|
+
? html `
|
|
922
1371
|
<th
|
|
923
|
-
style=" display: flex; width: ${
|
|
1372
|
+
style=" display: flex; width: ${virtualPaddingRight}px;"
|
|
924
1373
|
></th>
|
|
925
|
-
`
|
|
1374
|
+
`
|
|
1375
|
+
: ''}
|
|
926
1376
|
</tr>
|
|
927
1377
|
`;
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
1378
|
+
})}
|
|
1379
|
+
${this.isLoading
|
|
1380
|
+
? html `
|
|
931
1381
|
<div style="position: absolute; bottom: 0px; width: 100%;">
|
|
932
1382
|
<lit-loading-bar></lit-loading-bar>
|
|
933
1383
|
</div>
|
|
934
|
-
`
|
|
1384
|
+
`
|
|
1385
|
+
: ''}
|
|
935
1386
|
</thead>
|
|
936
1387
|
|
|
937
1388
|
<tbody
|
|
938
1389
|
@keydown=${this.handleKeyDown}
|
|
939
1390
|
tabindex="0"
|
|
940
1391
|
part="dataGrid-body"
|
|
941
|
-
style="height: ${
|
|
1392
|
+
style="height: ${rowVirtualizer &&
|
|
1393
|
+
this.table.getRowModel().rows.length > 0
|
|
1394
|
+
? rowVirtualizer.getTotalSize() + 'px'
|
|
1395
|
+
: 'auto'};"
|
|
942
1396
|
>
|
|
943
|
-
${
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
1397
|
+
${rows.length > 0
|
|
1398
|
+
? repeat(rowItems, (item) => item.key, (item) => {
|
|
1399
|
+
const row = rows[item.index];
|
|
1400
|
+
const visibleCells = row?.getVisibleCells();
|
|
1401
|
+
const bodyColumns = this.enableColumnVirtualization
|
|
1402
|
+
? virtualColumns?.map((vc) => visibleCells && visibleCells[vc.index])
|
|
1403
|
+
: visibleCells;
|
|
1404
|
+
const pinnedColumns = visibleCells?.filter((bc) => bc.column.getIsPinned()) || [];
|
|
1405
|
+
const newBodyColumns = this.enableColumnVirtualization
|
|
1406
|
+
? [...new Set([...pinnedColumns, ...bodyColumns])]
|
|
1407
|
+
: bodyColumns;
|
|
1408
|
+
const rowStyle = {
|
|
1409
|
+
transform: rowVirtualizer
|
|
1410
|
+
? `translateY(${item.start}px)`
|
|
1411
|
+
: 'none',
|
|
1412
|
+
height: `${this.getRowHeight()}px`,
|
|
1413
|
+
lineHeight: `${this.getRowHeight()}px`,
|
|
1414
|
+
position: rowVirtualizer ? 'absolute' : 'relative',
|
|
1415
|
+
};
|
|
1416
|
+
return row
|
|
1417
|
+
? html `
|
|
958
1418
|
<tr
|
|
959
|
-
tabindex=${this.enableRowSelection
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
data-index="${
|
|
963
|
-
|
|
964
|
-
|
|
1419
|
+
tabindex=${this.enableRowSelection
|
|
1420
|
+
? '0'
|
|
1421
|
+
: undefined}
|
|
1422
|
+
data-row-index="${row.index}"
|
|
1423
|
+
class="${this.rowsSelected[row.id]
|
|
1424
|
+
? 'selected body'
|
|
1425
|
+
: 'body'}"
|
|
1426
|
+
data-index="${item.index}"
|
|
1427
|
+
@click="${row.getIsGrouped()
|
|
1428
|
+
? row.getToggleExpandedHandler()
|
|
1429
|
+
: (e) => this.handleRowClick(e, row)}"
|
|
1430
|
+
@mousedown=${(e) => this._onRowMouseDown(e, row)}
|
|
965
1431
|
@mouseup=${this._onRowMouseUp}
|
|
966
1432
|
@mouseleave=${this._onRowMouseUp}
|
|
967
|
-
@contextmenu=${(
|
|
968
|
-
@dblclick="${() => this.handleRowDoubleClick(
|
|
969
|
-
style="${
|
|
970
|
-
${
|
|
971
|
-
|
|
972
|
-
|
|
1433
|
+
@contextmenu=${(e) => e.preventDefault()}
|
|
1434
|
+
@dblclick="${() => this.handleRowDoubleClick(row)}"
|
|
1435
|
+
style="${styleMap(rowStyle)}"
|
|
1436
|
+
${ref((node) => {
|
|
1437
|
+
if (node &&
|
|
1438
|
+
this.enableRowVirtualization &&
|
|
1439
|
+
rowVirtualizer) {
|
|
1440
|
+
// Only measure element if virtualization is enabled
|
|
1441
|
+
rowVirtualizer.measureElement(node);
|
|
1442
|
+
}
|
|
1443
|
+
})}
|
|
973
1444
|
>
|
|
974
|
-
${
|
|
1445
|
+
${virtualPaddingLeft
|
|
1446
|
+
? html `
|
|
975
1447
|
<th
|
|
976
|
-
style=" display: flex; width: ${
|
|
1448
|
+
style=" display: flex; width: ${virtualPaddingLeft}px;"
|
|
977
1449
|
></th>
|
|
978
|
-
`
|
|
1450
|
+
`
|
|
1451
|
+
: ''}
|
|
979
1452
|
<!-- Cells for each row -->
|
|
980
|
-
${
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
${f.getIsGrouped() ? u`<div
|
|
1453
|
+
${repeat(newBodyColumns, (cell) => cell.key, (cell) => {
|
|
1454
|
+
const buttonSize = this.getButtonSize();
|
|
1455
|
+
const { column } = cell;
|
|
1456
|
+
const style = {
|
|
1457
|
+
...this.getCommonPinningStyles(cell.column),
|
|
1458
|
+
width: `${cell.column?.getSize()}px`,
|
|
1459
|
+
flexGrow: `${column.columnDef.size === undefined ? 1 : 'unset'}`,
|
|
1460
|
+
background: this.getCellBackgroundColor(cell),
|
|
1461
|
+
lineHeight: `${this.getRowHeight()}px`,
|
|
1462
|
+
padding: column.columnDef.type ===
|
|
1463
|
+
'actions' ||
|
|
1464
|
+
column.columnDef.type ===
|
|
1465
|
+
'checkbox'
|
|
1466
|
+
? '0'
|
|
1467
|
+
: '0px 14px',
|
|
1468
|
+
};
|
|
1469
|
+
return html `
|
|
1470
|
+
<td style="${styleMap(style)}">
|
|
1471
|
+
${cell.getIsGrouped()
|
|
1472
|
+
? html `<div
|
|
1001
1473
|
class="grouped-column"
|
|
1002
1474
|
>
|
|
1003
1475
|
<lit-icon
|
|
1004
1476
|
class="grouped-column--icon-button"
|
|
1005
1477
|
size="1.25rem"
|
|
1006
|
-
icon="${
|
|
1478
|
+
icon="${row.getIsExpanded()
|
|
1479
|
+
? 'chevronDownFilled'
|
|
1480
|
+
: 'chevron'}"
|
|
1007
1481
|
></lit-icon>
|
|
1008
1482
|
<div
|
|
1009
1483
|
class="grouped-column--label"
|
|
1010
1484
|
>
|
|
1011
1485
|
<lit-overflow-tooltip
|
|
1012
|
-
label=${
|
|
1486
|
+
label=${cell.getValue()}
|
|
1013
1487
|
>
|
|
1014
|
-
${
|
|
1488
|
+
${cell.getValue()}
|
|
1015
1489
|
</lit-overflow-tooltip>
|
|
1016
1490
|
</div>
|
|
1017
1491
|
<lit-pill
|
|
1018
1492
|
class="grouped-column--pill"
|
|
1019
1493
|
style="margin-left: 0.5rem"
|
|
1020
|
-
count="${
|
|
1494
|
+
count="${row
|
|
1495
|
+
.subRows
|
|
1496
|
+
.length}"
|
|
1021
1497
|
></lit-pill>
|
|
1022
|
-
</div> `
|
|
1498
|
+
</div> `
|
|
1499
|
+
: cell.getIsAggregated()
|
|
1500
|
+
? html `
|
|
1023
1501
|
<div
|
|
1024
1502
|
style="flex-grow:1"
|
|
1025
1503
|
>
|
|
1026
|
-
${
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1504
|
+
${flexRender(cell
|
|
1505
|
+
.column
|
|
1506
|
+
.columnDef
|
|
1507
|
+
.aggregatedCell ??
|
|
1508
|
+
cell
|
|
1509
|
+
.column
|
|
1510
|
+
.columnDef
|
|
1511
|
+
.cell, cell.getContext())}
|
|
1030
1512
|
</div>
|
|
1031
|
-
`
|
|
1513
|
+
`
|
|
1514
|
+
: cell.getIsPlaceholder()
|
|
1515
|
+
? null
|
|
1516
|
+
: html `<lit-overflow-tooltip
|
|
1032
1517
|
placement="right"
|
|
1033
|
-
label=${
|
|
1034
|
-
>${
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1518
|
+
label=${cell.getValue()}
|
|
1519
|
+
>${flexRender(cell
|
|
1520
|
+
.column
|
|
1521
|
+
.columnDef
|
|
1522
|
+
.cell, cell.getContext())}</lit-overflow-tooltip
|
|
1038
1523
|
>`}
|
|
1039
1524
|
</td>
|
|
1040
1525
|
`;
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1526
|
+
})}
|
|
1527
|
+
${virtualPaddingRight
|
|
1528
|
+
? html `
|
|
1044
1529
|
<th
|
|
1045
|
-
style=" display: flex; width: ${
|
|
1530
|
+
style=" display: flex; width: ${virtualPaddingRight}px;"
|
|
1046
1531
|
></th>
|
|
1047
|
-
`
|
|
1532
|
+
`
|
|
1533
|
+
: ''}
|
|
1048
1534
|
</tr>
|
|
1049
|
-
`
|
|
1050
|
-
|
|
1051
|
-
|
|
1535
|
+
`
|
|
1536
|
+
: null;
|
|
1537
|
+
})
|
|
1538
|
+
: null}
|
|
1052
1539
|
</tbody>
|
|
1053
1540
|
</table>
|
|
1054
|
-
${this.hideFooter
|
|
1541
|
+
${!this.hideFooter
|
|
1542
|
+
? html `
|
|
1055
1543
|
<slot
|
|
1056
1544
|
part="dataGrid-footer"
|
|
1057
1545
|
name="dataGridFooter"
|
|
1058
1546
|
class="footer-container"
|
|
1059
1547
|
>
|
|
1060
1548
|
<div class="numberCount">
|
|
1061
|
-
${
|
|
1549
|
+
${msg('Počet záznamů')}:
|
|
1062
1550
|
${this.table.getRowModel().rows.length}
|
|
1063
1551
|
<pre>/</pre>
|
|
1064
|
-
${this.server
|
|
1065
|
-
|
|
1552
|
+
${this.server
|
|
1553
|
+
? this.totalNumberRows
|
|
1554
|
+
? this.totalNumberRows
|
|
1555
|
+
: '?'
|
|
1556
|
+
: this.table.getRowModel().rows.length}
|
|
1557
|
+
${this.server
|
|
1558
|
+
? html `<lit-icon-button
|
|
1066
1559
|
icon="reload"
|
|
1067
1560
|
size="mini"
|
|
1068
1561
|
variant="text"
|
|
1069
1562
|
@click="${() => this.handleGetTotalNumber()}"
|
|
1070
1563
|
style="margin-left: 0.2rem; margin-top: -0.1rem"
|
|
1071
|
-
></lit-icon-button>`
|
|
1564
|
+
></lit-icon-button>`
|
|
1565
|
+
: ''}
|
|
1072
1566
|
</div>
|
|
1073
1567
|
<div class="right-actions">
|
|
1074
1568
|
<lit-data-grid-density-popover
|
|
1075
1569
|
.density="${this.rowDensity}"
|
|
1076
|
-
.setDensity="${(
|
|
1570
|
+
.setDensity="${(density) => this.handleSetDensity(density)}"
|
|
1077
1571
|
>
|
|
1078
1572
|
</lit-data-grid-density-popover>
|
|
1079
1573
|
<lit-responsive-button
|
|
1080
1574
|
size="medium"
|
|
1081
1575
|
variant="text"
|
|
1082
|
-
label=${
|
|
1576
|
+
label=${msg('Přizpůsobit sloupce')}
|
|
1083
1577
|
icon="columns"
|
|
1084
1578
|
@click=${() => this.table.resetColumnSizing()}
|
|
1085
1579
|
></lit-responsive-button>
|
|
1086
|
-
${this.exportData
|
|
1580
|
+
${this.exportData
|
|
1581
|
+
? html `
|
|
1087
1582
|
<lit-data-grid-export-popover
|
|
1088
|
-
.exportToCsv="${typeof this.exportExcelFn
|
|
1089
|
-
|
|
1583
|
+
.exportToCsv="${typeof this.exportExcelFn ===
|
|
1584
|
+
'function'
|
|
1585
|
+
? () => this.exportCsvFn && this.exportCsvFn()
|
|
1586
|
+
: () => this.exportDataToCsv()}"
|
|
1587
|
+
.exportToExcel="${typeof this.exportExcelFn ===
|
|
1588
|
+
'function'
|
|
1589
|
+
? () => this.exportExcelFn &&
|
|
1590
|
+
this.exportExcelFn()
|
|
1591
|
+
: () => this.exportDataToExcel()}"
|
|
1090
1592
|
.disabledButtons="${this.isLoading}"
|
|
1091
1593
|
>
|
|
1092
1594
|
</lit-data-grid-export-popover>
|
|
1093
|
-
`
|
|
1094
|
-
|
|
1595
|
+
`
|
|
1596
|
+
: null}
|
|
1597
|
+
${this.enableSettings
|
|
1598
|
+
? html `
|
|
1095
1599
|
<div>
|
|
1096
1600
|
<lit-responsive-button
|
|
1097
1601
|
variant="dashed"
|
|
1098
|
-
label="${
|
|
1602
|
+
label="${msg('Přiřadit sloupec')}"
|
|
1099
1603
|
icon="add"
|
|
1100
1604
|
style="display: inline-block"
|
|
1101
1605
|
@click="${this.toggleCustomPopover}"
|
|
@@ -1103,9 +1607,9 @@ let n = class extends tt {
|
|
|
1103
1607
|
|
|
1104
1608
|
<simple-popper
|
|
1105
1609
|
.showing=${this.isOpen}
|
|
1106
|
-
.placement=${
|
|
1107
|
-
.manualOpening=${
|
|
1108
|
-
.maxWidthAsTarget=${
|
|
1610
|
+
.placement=${'top-end'}
|
|
1611
|
+
.manualOpening=${true}
|
|
1612
|
+
.maxWidthAsTarget=${false}
|
|
1109
1613
|
.onClose=${() => this.closePopover()}
|
|
1110
1614
|
>
|
|
1111
1615
|
<div
|
|
@@ -1114,55 +1618,57 @@ let n = class extends tt {
|
|
|
1114
1618
|
>
|
|
1115
1619
|
<lit-input
|
|
1116
1620
|
.value=${this.filterText}
|
|
1117
|
-
.onInput=${(
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1621
|
+
.onInput=${(value) => {
|
|
1622
|
+
this.filterText =
|
|
1623
|
+
value?.toLowerCase?.() ||
|
|
1624
|
+
'';
|
|
1625
|
+
}}
|
|
1121
1626
|
.onClear=${() => {
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
placeholder="${
|
|
1125
|
-
"Zadejte název sloupce"
|
|
1126
|
-
)}"
|
|
1627
|
+
this.filterText = '';
|
|
1628
|
+
}}
|
|
1629
|
+
placeholder="${msg('Zadejte název sloupce')}"
|
|
1127
1630
|
></lit-input>
|
|
1128
1631
|
</div>
|
|
1129
1632
|
<lit-menu tabindex="0">
|
|
1130
|
-
${this.columns
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1633
|
+
${this.columns
|
|
1634
|
+
.filter((col) => {
|
|
1635
|
+
const name = col?.headerName?.toLowerCase() ||
|
|
1636
|
+
col?.field.toLowerCase();
|
|
1637
|
+
return name.includes(this.filterText);
|
|
1638
|
+
})
|
|
1639
|
+
.sort((a, b) => {
|
|
1640
|
+
const aUnderscore = a.field.startsWith('_');
|
|
1641
|
+
const bUnderscore = b.field.startsWith('_');
|
|
1642
|
+
if (aUnderscore && !bUnderscore)
|
|
1643
|
+
return 1;
|
|
1644
|
+
if (!aUnderscore && bUnderscore)
|
|
1645
|
+
return -1;
|
|
1646
|
+
return (a.headerName || a.field).localeCompare(b.headerName || b.field);
|
|
1647
|
+
})
|
|
1648
|
+
.map((col) => html `
|
|
1144
1649
|
<lit-menu-item
|
|
1145
|
-
.onClick=${() => this.toggleColumn(
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
.isActive=${((r = this.columnVisibility) == null ? void 0 : r[i == null ? void 0 : i.field]) !== !1}
|
|
1650
|
+
.onClick=${() => this.toggleColumn(col?.field)}
|
|
1651
|
+
.isActive=${!(this
|
|
1652
|
+
.columnVisibility?.[col?.field] === false)}
|
|
1149
1653
|
>
|
|
1150
1654
|
<span
|
|
1151
1655
|
class="menu-item--multiple"
|
|
1152
1656
|
>
|
|
1153
1657
|
<lit-checkbox
|
|
1154
1658
|
class="cursor"
|
|
1155
|
-
.checked=${(
|
|
1659
|
+
.checked=${!(this
|
|
1660
|
+
.columnVisibility?.[col
|
|
1661
|
+
?.field] === false)}
|
|
1156
1662
|
></lit-checkbox>
|
|
1157
|
-
${
|
|
1663
|
+
${col?.headerName ||
|
|
1664
|
+
col?.field}
|
|
1158
1665
|
</span>
|
|
1159
1666
|
</lit-menu-item>
|
|
1160
|
-
|
|
1161
|
-
}
|
|
1162
|
-
)}
|
|
1667
|
+
`)}
|
|
1163
1668
|
</lit-menu>
|
|
1164
1669
|
|
|
1165
|
-
${
|
|
1670
|
+
${isEqual(filteredColumns.length, 0)
|
|
1671
|
+
? html `
|
|
1166
1672
|
<div
|
|
1167
1673
|
style="display: flex; flex-direction: column; align-items: center; padding: 1rem;"
|
|
1168
1674
|
>
|
|
@@ -1172,10 +1678,11 @@ let n = class extends tt {
|
|
|
1172
1678
|
<not-found></not-found>
|
|
1173
1679
|
</div>
|
|
1174
1680
|
<div>
|
|
1175
|
-
${
|
|
1681
|
+
${msg('Nenalezeno')}
|
|
1176
1682
|
</div>
|
|
1177
1683
|
</div>
|
|
1178
|
-
`
|
|
1684
|
+
`
|
|
1685
|
+
: null}
|
|
1179
1686
|
</simple-popper>
|
|
1180
1687
|
|
|
1181
1688
|
<lit-icon-button
|
|
@@ -1186,42 +1693,49 @@ let n = class extends tt {
|
|
|
1186
1693
|
></lit-icon-button>
|
|
1187
1694
|
<data-grid-settings
|
|
1188
1695
|
.onClose="${() => {
|
|
1189
|
-
|
|
1190
|
-
|
|
1696
|
+
this.isOpenModal = false;
|
|
1697
|
+
}}"
|
|
1191
1698
|
.isOpenModal="${this.isOpenModal}"
|
|
1192
1699
|
.enableFiltering="${this.enableFiltering}"
|
|
1193
1700
|
.enableSorting="${this.enableSorting}"
|
|
1194
|
-
.columnDefaultSize="${this
|
|
1195
|
-
|
|
1196
|
-
.
|
|
1701
|
+
.columnDefaultSize="${this
|
|
1702
|
+
.columnDefaultSize}"
|
|
1703
|
+
.columnGroupedColor="${this
|
|
1704
|
+
.columnGroupedColor}"
|
|
1705
|
+
.rowAggregationColor="${this
|
|
1706
|
+
.rowAggregationColor}"
|
|
1197
1707
|
.enableGrouping="${this.enableGrouping}"
|
|
1198
|
-
.enableColumnPinning="${this
|
|
1708
|
+
.enableColumnPinning="${this
|
|
1709
|
+
.enableColumnPinning}"
|
|
1199
1710
|
.exportData="${this.exportData}"
|
|
1200
|
-
.actionButtonsInMenu="${this
|
|
1711
|
+
.actionButtonsInMenu="${this
|
|
1712
|
+
.actionButtonsInMenu}"
|
|
1201
1713
|
.hideFooter="${this.hideFooter}"
|
|
1202
|
-
.onSettingsChangedModal="${this.onSettingsChangedCallback.bind(
|
|
1203
|
-
this
|
|
1204
|
-
)}"
|
|
1714
|
+
.onSettingsChangedModal="${this.onSettingsChangedCallback.bind(this)}"
|
|
1205
1715
|
></data-grid-settings>
|
|
1206
1716
|
</div>
|
|
1207
|
-
`
|
|
1717
|
+
`
|
|
1718
|
+
: null}
|
|
1208
1719
|
</div>
|
|
1209
1720
|
</slot>
|
|
1210
|
-
`
|
|
1721
|
+
`
|
|
1722
|
+
: ''}
|
|
1211
1723
|
</div>
|
|
1212
|
-
${this.table.getRowModel().rows.length < 1 && !this.isLoading
|
|
1724
|
+
${this.table.getRowModel().rows.length < 1 && !this.isLoading
|
|
1725
|
+
? html ` <div class="data-grid__empty">
|
|
1213
1726
|
<div style="max-height: 7.125rem; max-width: 7.125rem">
|
|
1214
1727
|
<not-found></not-found>
|
|
1215
1728
|
</div>
|
|
1216
|
-
<div class="data-grid__empty-text">${
|
|
1217
|
-
</div>`
|
|
1729
|
+
<div class="data-grid__empty-text">${msg('Nic dalšího tu není')}</div>
|
|
1730
|
+
</div>`
|
|
1731
|
+
: null}
|
|
1218
1732
|
</div>
|
|
1219
1733
|
`;
|
|
1220
|
-
|
|
1734
|
+
}
|
|
1221
1735
|
};
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1736
|
+
LitDataGridTanstack.styles = [
|
|
1737
|
+
// styles,
|
|
1738
|
+
css `
|
|
1225
1739
|
*,
|
|
1226
1740
|
*::before,
|
|
1227
1741
|
*::after {
|
|
@@ -1507,227 +2021,226 @@ n.styles = [
|
|
|
1507
2021
|
.data-grid__empty-text {
|
|
1508
2022
|
color: var(--text-primary, #5d6371);
|
|
1509
2023
|
}
|
|
1510
|
-
|
|
2024
|
+
`,
|
|
1511
2025
|
];
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
],
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
],
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
],
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
],
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
],
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
],
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
],
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
],
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
],
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
],
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
],
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
],
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
],
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
],
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
],
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
],
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
],
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
],
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
],
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
],
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
],
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
],
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
],
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
],
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
],
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
],
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
],
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
],
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
],
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
],
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
],
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
],
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
],
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
],
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
],
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
],
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
],
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
],
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
],
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
],
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
],
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
],
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
],
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
],
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
],
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
],
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
],
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
],
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
],
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
],
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
],
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
],
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
],
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
],
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
],
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
],
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
],
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
],
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
],
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
],
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
],
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
],
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
],
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
],
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
],
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
],
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
],
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
],
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
],
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
],
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
],
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
],
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
],
|
|
1731
|
-
export {
|
|
1732
|
-
|
|
1733
|
-
};
|
|
2026
|
+
__decorate([
|
|
2027
|
+
property({ type: Array, reflect: true })
|
|
2028
|
+
], LitDataGridTanstack.prototype, "row", void 0);
|
|
2029
|
+
__decorate([
|
|
2030
|
+
property({ type: Array })
|
|
2031
|
+
], LitDataGridTanstack.prototype, "columns", void 0);
|
|
2032
|
+
__decorate([
|
|
2033
|
+
property({ type: Number })
|
|
2034
|
+
], LitDataGridTanstack.prototype, "columnDefaultSize", void 0);
|
|
2035
|
+
__decorate([
|
|
2036
|
+
property({ type: Number })
|
|
2037
|
+
], LitDataGridTanstack.prototype, "columnDefaultMinSize", void 0);
|
|
2038
|
+
__decorate([
|
|
2039
|
+
property({ type: Number })
|
|
2040
|
+
], LitDataGridTanstack.prototype, "columnDefaultMaxSize", void 0);
|
|
2041
|
+
__decorate([
|
|
2042
|
+
property({ type: String })
|
|
2043
|
+
], LitDataGridTanstack.prototype, "columnGroupedColor", void 0);
|
|
2044
|
+
__decorate([
|
|
2045
|
+
property({ type: String })
|
|
2046
|
+
], LitDataGridTanstack.prototype, "rowAggregationColor", void 0);
|
|
2047
|
+
__decorate([
|
|
2048
|
+
property({ type: Boolean })
|
|
2049
|
+
], LitDataGridTanstack.prototype, "enableRowVirtualization", void 0);
|
|
2050
|
+
__decorate([
|
|
2051
|
+
property({ type: Boolean })
|
|
2052
|
+
], LitDataGridTanstack.prototype, "enableColumnVirtualization", void 0);
|
|
2053
|
+
__decorate([
|
|
2054
|
+
property({ type: Boolean })
|
|
2055
|
+
], LitDataGridTanstack.prototype, "enableColumnPinning", void 0);
|
|
2056
|
+
__decorate([
|
|
2057
|
+
property({ type: Boolean })
|
|
2058
|
+
], LitDataGridTanstack.prototype, "enableColumnOrdering", void 0);
|
|
2059
|
+
__decorate([
|
|
2060
|
+
property({ type: Boolean })
|
|
2061
|
+
], LitDataGridTanstack.prototype, "enableGrouping", void 0);
|
|
2062
|
+
__decorate([
|
|
2063
|
+
property({ type: Boolean })
|
|
2064
|
+
], LitDataGridTanstack.prototype, "enablePinning", void 0);
|
|
2065
|
+
__decorate([
|
|
2066
|
+
property({ type: Boolean })
|
|
2067
|
+
], LitDataGridTanstack.prototype, "exportData", void 0);
|
|
2068
|
+
__decorate([
|
|
2069
|
+
property({ type: Boolean })
|
|
2070
|
+
], LitDataGridTanstack.prototype, "actionButtonsInMenu", void 0);
|
|
2071
|
+
__decorate([
|
|
2072
|
+
property({ type: String })
|
|
2073
|
+
], LitDataGridTanstack.prototype, "id", void 0);
|
|
2074
|
+
__decorate([
|
|
2075
|
+
property({ type: Array })
|
|
2076
|
+
], LitDataGridTanstack.prototype, "initialGroups", void 0);
|
|
2077
|
+
__decorate([
|
|
2078
|
+
property({ type: Array })
|
|
2079
|
+
], LitDataGridTanstack.prototype, "initialSorting", void 0);
|
|
2080
|
+
__decorate([
|
|
2081
|
+
property({ type: Object })
|
|
2082
|
+
], LitDataGridTanstack.prototype, "initialColumnVisibility", void 0);
|
|
2083
|
+
__decorate([
|
|
2084
|
+
property({ type: Object })
|
|
2085
|
+
], LitDataGridTanstack.prototype, "initialRowExpanded", void 0);
|
|
2086
|
+
__decorate([
|
|
2087
|
+
property({ type: Object })
|
|
2088
|
+
], LitDataGridTanstack.prototype, "columnSizing", void 0);
|
|
2089
|
+
__decorate([
|
|
2090
|
+
property({ type: Array })
|
|
2091
|
+
], LitDataGridTanstack.prototype, "leftPinnedColumns", void 0);
|
|
2092
|
+
__decorate([
|
|
2093
|
+
property({ type: Array })
|
|
2094
|
+
], LitDataGridTanstack.prototype, "rightPinnedColumns", void 0);
|
|
2095
|
+
__decorate([
|
|
2096
|
+
property({ type: Boolean })
|
|
2097
|
+
], LitDataGridTanstack.prototype, "enableFiltering", void 0);
|
|
2098
|
+
__decorate([
|
|
2099
|
+
property({ type: Boolean })
|
|
2100
|
+
], LitDataGridTanstack.prototype, "enableSorting", void 0);
|
|
2101
|
+
__decorate([
|
|
2102
|
+
property({ type: String })
|
|
2103
|
+
], LitDataGridTanstack.prototype, "userLang", void 0);
|
|
2104
|
+
__decorate([
|
|
2105
|
+
property({ type: String })
|
|
2106
|
+
], LitDataGridTanstack.prototype, "dateFormat", void 0);
|
|
2107
|
+
__decorate([
|
|
2108
|
+
property({ type: Boolean })
|
|
2109
|
+
], LitDataGridTanstack.prototype, "isLoading", void 0);
|
|
2110
|
+
__decorate([
|
|
2111
|
+
property({ type: Boolean })
|
|
2112
|
+
], LitDataGridTanstack.prototype, "enableRowSelection", void 0);
|
|
2113
|
+
__decorate([
|
|
2114
|
+
property({ type: Array })
|
|
2115
|
+
], LitDataGridTanstack.prototype, "initialFiltering", void 0);
|
|
2116
|
+
__decorate([
|
|
2117
|
+
property({ type: Boolean })
|
|
2118
|
+
], LitDataGridTanstack.prototype, "server", void 0);
|
|
2119
|
+
__decorate([
|
|
2120
|
+
property({ type: Number })
|
|
2121
|
+
], LitDataGridTanstack.prototype, "scrollEndThreshold", void 0);
|
|
2122
|
+
__decorate([
|
|
2123
|
+
property({ type: String })
|
|
2124
|
+
], LitDataGridTanstack.prototype, "rowDensity", void 0);
|
|
2125
|
+
__decorate([
|
|
2126
|
+
property({ type: Boolean })
|
|
2127
|
+
], LitDataGridTanstack.prototype, "enableMultiRowSelection", void 0);
|
|
2128
|
+
__decorate([
|
|
2129
|
+
property({ type: Number })
|
|
2130
|
+
], LitDataGridTanstack.prototype, "totalNumberRows", void 0);
|
|
2131
|
+
__decorate([
|
|
2132
|
+
property({ type: Number })
|
|
2133
|
+
], LitDataGridTanstack.prototype, "minFilterCharacters", void 0);
|
|
2134
|
+
__decorate([
|
|
2135
|
+
property({ type: Boolean })
|
|
2136
|
+
], LitDataGridTanstack.prototype, "localizeDate", void 0);
|
|
2137
|
+
__decorate([
|
|
2138
|
+
property({ type: Boolean })
|
|
2139
|
+
], LitDataGridTanstack.prototype, "rowsSelected", void 0);
|
|
2140
|
+
__decorate([
|
|
2141
|
+
property({ type: Boolean })
|
|
2142
|
+
], LitDataGridTanstack.prototype, "enableSettings", void 0);
|
|
2143
|
+
__decorate([
|
|
2144
|
+
property({ attribute: false })
|
|
2145
|
+
], LitDataGridTanstack.prototype, "onSettingsChanged", void 0);
|
|
2146
|
+
__decorate([
|
|
2147
|
+
property({ type: Function })
|
|
2148
|
+
], LitDataGridTanstack.prototype, "onRowClick", void 0);
|
|
2149
|
+
__decorate([
|
|
2150
|
+
property({ type: Function })
|
|
2151
|
+
], LitDataGridTanstack.prototype, "onRowsScrollEnd", void 0);
|
|
2152
|
+
__decorate([
|
|
2153
|
+
property({ type: Function })
|
|
2154
|
+
], LitDataGridTanstack.prototype, "onRowDoubleClick", void 0);
|
|
2155
|
+
__decorate([
|
|
2156
|
+
property({ type: Function })
|
|
2157
|
+
], LitDataGridTanstack.prototype, "rowDensityChange", void 0);
|
|
2158
|
+
__decorate([
|
|
2159
|
+
property({ type: Function })
|
|
2160
|
+
], LitDataGridTanstack.prototype, "exportExcelFn", void 0);
|
|
2161
|
+
__decorate([
|
|
2162
|
+
property({ type: Function })
|
|
2163
|
+
], LitDataGridTanstack.prototype, "exportCsvFn", void 0);
|
|
2164
|
+
__decorate([
|
|
2165
|
+
property({ type: Function })
|
|
2166
|
+
], LitDataGridTanstack.prototype, "getTotalNumberFn", void 0);
|
|
2167
|
+
__decorate([
|
|
2168
|
+
property({ type: Function })
|
|
2169
|
+
], LitDataGridTanstack.prototype, "onCellKeyDown", void 0);
|
|
2170
|
+
__decorate([
|
|
2171
|
+
property({ type: Function })
|
|
2172
|
+
], LitDataGridTanstack.prototype, "getRowId", void 0);
|
|
2173
|
+
__decorate([
|
|
2174
|
+
property({ type: Function })
|
|
2175
|
+
], LitDataGridTanstack.prototype, "onColumnResize", void 0);
|
|
2176
|
+
__decorate([
|
|
2177
|
+
property({ type: Boolean })
|
|
2178
|
+
], LitDataGridTanstack.prototype, "onColumnFiltersChanged", void 0);
|
|
2179
|
+
__decorate([
|
|
2180
|
+
property({ type: Boolean })
|
|
2181
|
+
], LitDataGridTanstack.prototype, "onColumnSortChanged", void 0);
|
|
2182
|
+
__decorate([
|
|
2183
|
+
property({ type: Function })
|
|
2184
|
+
], LitDataGridTanstack.prototype, "onRowSelectionChanged", void 0);
|
|
2185
|
+
__decorate([
|
|
2186
|
+
property({ type: Function })
|
|
2187
|
+
], LitDataGridTanstack.prototype, "onColumnOrderChanged", void 0);
|
|
2188
|
+
__decorate([
|
|
2189
|
+
property({ type: Boolean })
|
|
2190
|
+
], LitDataGridTanstack.prototype, "hideFooter", void 0);
|
|
2191
|
+
__decorate([
|
|
2192
|
+
property({ type: Object })
|
|
2193
|
+
], LitDataGridTanstack.prototype, "columnVisibility", void 0);
|
|
2194
|
+
__decorate([
|
|
2195
|
+
property({ type: Function })
|
|
2196
|
+
], LitDataGridTanstack.prototype, "onColumnVisibilityChanged", void 0);
|
|
2197
|
+
__decorate([
|
|
2198
|
+
property({ type: Function })
|
|
2199
|
+
], LitDataGridTanstack.prototype, "onMouseDown", void 0);
|
|
2200
|
+
__decorate([
|
|
2201
|
+
property({ type: Function })
|
|
2202
|
+
], LitDataGridTanstack.prototype, "onRowFocusChanged", void 0);
|
|
2203
|
+
__decorate([
|
|
2204
|
+
property({ type: Number })
|
|
2205
|
+
], LitDataGridTanstack.prototype, "focusedRowIndex", void 0);
|
|
2206
|
+
__decorate([
|
|
2207
|
+
property({ type: Boolean })
|
|
2208
|
+
], LitDataGridTanstack.prototype, "autoFocus", void 0);
|
|
2209
|
+
__decorate([
|
|
2210
|
+
state()
|
|
2211
|
+
], LitDataGridTanstack.prototype, "rowsCount", void 0);
|
|
2212
|
+
__decorate([
|
|
2213
|
+
state()
|
|
2214
|
+
], LitDataGridTanstack.prototype, "isScrollable", void 0);
|
|
2215
|
+
__decorate([
|
|
2216
|
+
state()
|
|
2217
|
+
], LitDataGridTanstack.prototype, "disableScrollLeft", void 0);
|
|
2218
|
+
__decorate([
|
|
2219
|
+
state()
|
|
2220
|
+
], LitDataGridTanstack.prototype, "disableScrollRight", void 0);
|
|
2221
|
+
__decorate([
|
|
2222
|
+
state()
|
|
2223
|
+
], LitDataGridTanstack.prototype, "columnOrder", void 0);
|
|
2224
|
+
__decorate([
|
|
2225
|
+
state()
|
|
2226
|
+
], LitDataGridTanstack.prototype, "table", void 0);
|
|
2227
|
+
__decorate([
|
|
2228
|
+
state()
|
|
2229
|
+
], LitDataGridTanstack.prototype, "isOpen", void 0);
|
|
2230
|
+
__decorate([
|
|
2231
|
+
state()
|
|
2232
|
+
], LitDataGridTanstack.prototype, "filterText", void 0);
|
|
2233
|
+
__decorate([
|
|
2234
|
+
state()
|
|
2235
|
+
], LitDataGridTanstack.prototype, "isOpenModal", void 0);
|
|
2236
|
+
__decorate([
|
|
2237
|
+
query('tbody')
|
|
2238
|
+
], LitDataGridTanstack.prototype, "tableBody", void 0);
|
|
2239
|
+
__decorate([
|
|
2240
|
+
query('.grid')
|
|
2241
|
+
], LitDataGridTanstack.prototype, "_container", void 0);
|
|
2242
|
+
LitDataGridTanstack = __decorate([
|
|
2243
|
+
customElement('lit-data-grid-tanstack')
|
|
2244
|
+
], LitDataGridTanstack);
|
|
2245
|
+
export { LitDataGridTanstack };
|
|
2246
|
+
//# sourceMappingURL=lit-data-grid-tanstack.js.map
|