overview-components 1.1.173 → 1.1.175
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/components/lit-data-grid-tanstack.d.ts +2 -0
- package/dist/components/lit-data-grid-tanstack.d.ts.map +1 -1
- package/dist/components/lit-data-grid-tanstack.js +123 -97
- package/dist/components/lit-data-grid-tanstack.js.map +1 -1
- package/dist/shared/filter-inputs.d.ts +1 -0
- package/dist/shared/filter-inputs.d.ts.map +1 -1
- package/dist/shared/filter-inputs.js +18 -7
- package/dist/shared/filter-inputs.js.map +1 -1
- package/dist/shared/lit-data-grid-density-popover.d.ts +6 -3
- package/dist/shared/lit-data-grid-density-popover.d.ts.map +1 -1
- package/dist/shared/lit-data-grid-density-popover.js +52 -30
- package/dist/shared/lit-data-grid-density-popover.js.map +1 -1
- package/dist/shared/lit-data-grid-export-popover.d.ts +6 -3
- package/dist/shared/lit-data-grid-export-popover.d.ts.map +1 -1
- package/dist/shared/lit-data-grid-export-popover.js +45 -21
- package/dist/shared/lit-data-grid-export-popover.js.map +1 -1
- package/dist/shared/lit-data-grid-operators-popover.d.ts +5 -6
- package/dist/shared/lit-data-grid-operators-popover.d.ts.map +1 -1
- package/dist/shared/lit-data-grid-operators-popover.js +40 -38
- package/dist/shared/lit-data-grid-operators-popover.js.map +1 -1
- package/dist/shared/lit-data-grid-row-actions.d.ts +18 -14
- package/dist/shared/lit-data-grid-row-actions.d.ts.map +1 -1
- package/dist/shared/lit-data-grid-row-actions.js +129 -59
- package/dist/shared/lit-data-grid-row-actions.js.map +1 -1
- package/dist/shared/lit-input.d.ts.map +1 -1
- package/dist/shared/lit-input.js +2 -0
- package/dist/shared/lit-input.js.map +1 -1
- package/dist/shared/lit-select.d.ts +1 -0
- package/dist/shared/lit-select.d.ts.map +1 -1
- package/dist/shared/lit-select.js +49 -40
- package/dist/shared/lit-select.js.map +1 -1
- package/dist/shared/simple-popper.d.ts +23 -1
- package/dist/shared/simple-popper.d.ts.map +1 -1
- package/dist/shared/simple-popper.js +51 -0
- package/dist/shared/simple-popper.js.map +1 -1
- package/package.json +1 -1
|
@@ -152,6 +152,7 @@ export declare class LitDataGridTanstack extends LitElement {
|
|
|
152
152
|
private lastSelectedIndex;
|
|
153
153
|
tableBody: HTMLDivElement;
|
|
154
154
|
_container: HTMLElement;
|
|
155
|
+
private settingsReference?;
|
|
155
156
|
private getLocaleLang;
|
|
156
157
|
get rows(): any[];
|
|
157
158
|
get getColumns(): Column[];
|
|
@@ -191,6 +192,7 @@ export declare class LitDataGridTanstack extends LitElement {
|
|
|
191
192
|
handleGetTotalNumber(): void;
|
|
192
193
|
private toggleCustomPopover;
|
|
193
194
|
private closePopover;
|
|
195
|
+
private renderColumnSettingsContent;
|
|
194
196
|
private toggleColumn;
|
|
195
197
|
private onSettingsChangedCallback;
|
|
196
198
|
static styles: import("lit").CSSResult[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lit-data-grid-tanstack.d.ts","sourceRoot":"","sources":["../../src/components/lit-data-grid-tanstack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAK5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAcH,YAAY,EACZ,eAAe,EAClB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,4BAA4B,CAAC;AACpC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,8BAA8B,CAAC;AACtC,OAAO,yBAAyB,CAAC;AACjC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,2CAA2C,CAAC;AACnD,OAAO,mDAAmD,CAAC;AAC3D,OAAO,qCAAqC,CAAC;AAC7C,OAAO,4CAA4C,CAAC;AACpD,OAAO,8BAA8B,CAAC;AACtC,OAAO,wCAAwC,CAAC;AAChD,OAAO,6BAA6B,CAAC;AACrC,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B;IAoB9B,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,eAAe;IA0DjB,iBAAiB;IA+DvB,OAAO,CAAC,0BAA0B;IAoBlC,OAAO,CAAC,kBAAkB,CAexB;IAEF,OAAO,CAAC,iBAAiB,CAWvB;IAEF,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,sBAAsB;IAY9B,YAAY,CAAC,MAAM,EAAE,KAAK;IAK1B,oBAAoB;YAMN,mBAAmB;IAmBjC,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,2BAA2B;IAyEnC,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,yBAAyB;IAwDjC,MAAM,CAAC,MAAM,4BAiTX;IAEF,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG;IAc3C,aAAa,CAAC,KAAK,EAAE,GAAG;IAIxB,eAAe,CAAC,KAAK,EAAE,GAAG;IAK1B,MAAM;CAuqCT;AAKD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,wBAAwB,EAAE,mBAAmB,CAAC;KACjD;CACJ"}
|
|
@@ -38,6 +38,7 @@ import { dateFilterFn, multiselectFilterFn, dateRangeFilterFn } from '../utils/c
|
|
|
38
38
|
import { setLocale, getLocale, LOCALE_LANGS } from '../utils/localization.js';
|
|
39
39
|
import { getOperatorsByColumnType } from '../utils/getOperatorByType.js';
|
|
40
40
|
import { tooltip, overflowTooltip } from '../shared/simple-tooltip.js';
|
|
41
|
+
import { openSharedPopper, closeSharedPopper, isSharedPopperOpenFor, renderSharedPopperContent, } from '../shared/simple-popper.js';
|
|
41
42
|
import { renderIcon } from '../shared/icon-svg.js';
|
|
42
43
|
export class LitDataGridTanstack extends LitElement {
|
|
43
44
|
constructor() {
|
|
@@ -185,6 +186,8 @@ export class LitDataGridTanstack extends LitElement {
|
|
|
185
186
|
if (this.resizeTimeout) {
|
|
186
187
|
clearTimeout(this.resizeTimeout);
|
|
187
188
|
}
|
|
189
|
+
// Close the column-settings menu if this grid currently owns the shared popper.
|
|
190
|
+
closeSharedPopper(this.settingsReference);
|
|
188
191
|
}
|
|
189
192
|
updated(changedProperties) {
|
|
190
193
|
if (changedProperties.has('userLang')) {
|
|
@@ -229,6 +232,13 @@ export class LitDataGridTanstack extends LitElement {
|
|
|
229
232
|
// Use setTimeout to ensure DOM is updated
|
|
230
233
|
setTimeout(() => this._maybeTriggerScrollEnd(), 100);
|
|
231
234
|
}
|
|
235
|
+
// The column-settings menu is rendered imperatively into the shared
|
|
236
|
+
// popper; keep it in sync with search text / column visibility while open.
|
|
237
|
+
if (this.isOpen && this.settingsReference) {
|
|
238
|
+
renderSharedPopperContent(this.settingsReference, this.renderColumnSettingsContent(), {
|
|
239
|
+
host: this,
|
|
240
|
+
});
|
|
241
|
+
}
|
|
232
242
|
}
|
|
233
243
|
firstUpdated() {
|
|
234
244
|
const grid = this.tableContainerRef.value;
|
|
@@ -870,11 +880,96 @@ export class LitDataGridTanstack extends LitElement {
|
|
|
870
880
|
this.getTotalNumberFn();
|
|
871
881
|
}
|
|
872
882
|
}
|
|
873
|
-
toggleCustomPopover() {
|
|
874
|
-
|
|
883
|
+
async toggleCustomPopover() {
|
|
884
|
+
await this.updateComplete;
|
|
885
|
+
if (!this.settingsReference)
|
|
886
|
+
return;
|
|
887
|
+
if (isSharedPopperOpenFor(this.settingsReference)) {
|
|
888
|
+
this.closePopover();
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
this.isOpen = true;
|
|
892
|
+
openSharedPopper({
|
|
893
|
+
target: this.settingsReference,
|
|
894
|
+
placement: 'top-end',
|
|
895
|
+
content: this.renderColumnSettingsContent(),
|
|
896
|
+
onClose: () => {
|
|
897
|
+
this.isOpen = false;
|
|
898
|
+
},
|
|
899
|
+
renderOptions: { host: this },
|
|
900
|
+
});
|
|
875
901
|
}
|
|
876
902
|
closePopover() {
|
|
877
903
|
this.isOpen = false;
|
|
904
|
+
closeSharedPopper(this.settingsReference);
|
|
905
|
+
}
|
|
906
|
+
// Searchable column-visibility menu shown in the shared popper. Rendered
|
|
907
|
+
// imperatively, so updated() re-renders it while open to reflect search /
|
|
908
|
+
// checkbox changes.
|
|
909
|
+
renderColumnSettingsContent() {
|
|
910
|
+
const filteredColumns = this.columns?.filter((col) => {
|
|
911
|
+
const name = col[`headerName_${this.userLang}`] ||
|
|
912
|
+
col.headerName ||
|
|
913
|
+
col.field;
|
|
914
|
+
return name.toLowerCase().includes(this.filterText);
|
|
915
|
+
}) || [];
|
|
916
|
+
return html `
|
|
917
|
+
<div class="popper-input" style="position: sticky; top: 0; z-index: 1;">
|
|
918
|
+
<lit-input
|
|
919
|
+
.value=${this.filterText}
|
|
920
|
+
.onInput=${(value) => {
|
|
921
|
+
this.filterText = value?.toLowerCase?.() || '';
|
|
922
|
+
}}
|
|
923
|
+
.onClear=${() => {
|
|
924
|
+
this.filterText = '';
|
|
925
|
+
}}
|
|
926
|
+
placeholder="${msg('Zadejte název sloupce')}"
|
|
927
|
+
></lit-input>
|
|
928
|
+
</div>
|
|
929
|
+
<lit-menu tabindex="0">
|
|
930
|
+
${this.columns
|
|
931
|
+
.filter((col) => {
|
|
932
|
+
const name = col?.headerName?.toLowerCase() || col?.field.toLowerCase();
|
|
933
|
+
return name.includes(this.filterText);
|
|
934
|
+
})
|
|
935
|
+
.sort((a, b) => {
|
|
936
|
+
const aUnderscore = a.field.startsWith('_');
|
|
937
|
+
const bUnderscore = b.field.startsWith('_');
|
|
938
|
+
if (aUnderscore && !bUnderscore)
|
|
939
|
+
return 1;
|
|
940
|
+
if (!aUnderscore && bUnderscore)
|
|
941
|
+
return -1;
|
|
942
|
+
return (a.headerName || a.field).localeCompare(b.headerName || b.field);
|
|
943
|
+
})
|
|
944
|
+
.map((col) => html `
|
|
945
|
+
<lit-menu-item
|
|
946
|
+
.onClick=${() => this.toggleColumn(col?.field)}
|
|
947
|
+
.isActive=${!(this.columnVisibility?.[col?.field] === false)}
|
|
948
|
+
>
|
|
949
|
+
<span class="menu-item--multiple">
|
|
950
|
+
<lit-checkbox
|
|
951
|
+
class="cursor"
|
|
952
|
+
.checked=${!(this.columnVisibility?.[col?.field] === false)}
|
|
953
|
+
></lit-checkbox>
|
|
954
|
+
${col?.headerName || col?.field}
|
|
955
|
+
</span>
|
|
956
|
+
</lit-menu-item>
|
|
957
|
+
`)}
|
|
958
|
+
</lit-menu>
|
|
959
|
+
|
|
960
|
+
${isEqual(filteredColumns.length, 0)
|
|
961
|
+
? html `
|
|
962
|
+
<div
|
|
963
|
+
style="display: flex; flex-direction: column; align-items: center; padding: 1rem;"
|
|
964
|
+
>
|
|
965
|
+
<div style="max-height: 6rem; max-width: 6rem;">
|
|
966
|
+
<not-found></not-found>
|
|
967
|
+
</div>
|
|
968
|
+
<div>${msg('Nenalezeno')}</div>
|
|
969
|
+
</div>
|
|
970
|
+
`
|
|
971
|
+
: null}
|
|
972
|
+
`;
|
|
878
973
|
}
|
|
879
974
|
toggleColumn(field) {
|
|
880
975
|
this.columnVisibility = {
|
|
@@ -956,12 +1051,6 @@ export class LitDataGridTanstack extends LitElement {
|
|
|
956
1051
|
this.focusedRowIndex = 0;
|
|
957
1052
|
}
|
|
958
1053
|
render() {
|
|
959
|
-
const filteredColumns = this.columns?.filter((col) => {
|
|
960
|
-
const name = (col[`headerName_${this.userLang}`] ||
|
|
961
|
-
col.headerName ||
|
|
962
|
-
col.field).toLowerCase();
|
|
963
|
-
return name.includes(this.filterText);
|
|
964
|
-
}) || [];
|
|
965
1054
|
// checbox column for multiple selection
|
|
966
1055
|
const checkboxColumn = this.enableMultiRowSelection
|
|
967
1056
|
? [
|
|
@@ -1004,6 +1093,14 @@ export class LitDataGridTanstack extends LitElement {
|
|
|
1004
1093
|
},
|
|
1005
1094
|
]
|
|
1006
1095
|
: [];
|
|
1096
|
+
// Perf: only build the faceted / grouped+expanded row models when they
|
|
1097
|
+
// can actually be used. The faceted model is expensive because
|
|
1098
|
+
// FilterInputs requests unique values for every filterable column on
|
|
1099
|
+
// mount; the grouped/expanded models only matter when grouping is on.
|
|
1100
|
+
const hasSelectColumn = (this.columns || []).some((c) => c.type === 'select' || c.type === 'multiselect');
|
|
1101
|
+
const hasGroupableColumn = (this.initialGroups?.length ?? 0) > 0 ||
|
|
1102
|
+
((this.enableGrouping ?? true) &&
|
|
1103
|
+
(this.columns || []).some((c) => c.enableGrouping ?? true));
|
|
1007
1104
|
this.table = this.tableController.table({
|
|
1008
1105
|
data: this.rows || [],
|
|
1009
1106
|
columns: [...checkboxColumn, ...this.getTanstackColumns(this.columns || [])],
|
|
@@ -1064,10 +1161,14 @@ export class LitDataGridTanstack extends LitElement {
|
|
|
1064
1161
|
getCoreRowModel: getCoreRowModel(),
|
|
1065
1162
|
getSortedRowModel: getSortedRowModel(),
|
|
1066
1163
|
getFilteredRowModel: getFilteredRowModel(),
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1164
|
+
...(hasSelectColumn && {
|
|
1165
|
+
getFacetedRowModel: getFacetedRowModel(),
|
|
1166
|
+
getFacetedUniqueValues: getFacetedUniqueValues(),
|
|
1167
|
+
}),
|
|
1168
|
+
...(hasGroupableColumn && {
|
|
1169
|
+
getGroupedRowModel: getGroupedRowModel(),
|
|
1170
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
1171
|
+
}),
|
|
1071
1172
|
onColumnFiltersChange: (updaterOrValue) => {
|
|
1072
1173
|
// Preserve expanded state before filtering
|
|
1073
1174
|
const currentExpandedState = this.table.getState().expanded;
|
|
@@ -1340,11 +1441,12 @@ export class LitDataGridTanstack extends LitElement {
|
|
|
1340
1441
|
.valueOptions || [];
|
|
1341
1442
|
}
|
|
1342
1443
|
else {
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1345
|
-
.keys())
|
|
1346
|
-
|
|
1347
|
-
|
|
1444
|
+
const facetedUniqueValues = column?.getFacetedUniqueValues?.();
|
|
1445
|
+
const sortedUniqueValues = facetedUniqueValues
|
|
1446
|
+
? Array.from(facetedUniqueValues.keys())
|
|
1447
|
+
.sort()
|
|
1448
|
+
.slice(0, 5000)
|
|
1449
|
+
: [];
|
|
1348
1450
|
valueOptions = sortedUniqueValues.map((value) => ({
|
|
1349
1451
|
value,
|
|
1350
1452
|
label: value,
|
|
@@ -1865,6 +1967,7 @@ export class LitDataGridTanstack extends LitElement {
|
|
|
1865
1967
|
? html `
|
|
1866
1968
|
<div>
|
|
1867
1969
|
<lit-responsive-button
|
|
1970
|
+
class="settings-reference"
|
|
1868
1971
|
color="secondary"
|
|
1869
1972
|
variant="dashed"
|
|
1870
1973
|
label="${msg('Přiřadit sloupec')}"
|
|
@@ -1873,86 +1976,6 @@ export class LitDataGridTanstack extends LitElement {
|
|
|
1873
1976
|
@click="${this.toggleCustomPopover}"
|
|
1874
1977
|
></lit-responsive-button>
|
|
1875
1978
|
|
|
1876
|
-
<simple-popper
|
|
1877
|
-
.showing=${this.isOpen}
|
|
1878
|
-
.placement=${'top-end'}
|
|
1879
|
-
.manualOpening=${true}
|
|
1880
|
-
.maxWidthAsTarget=${false}
|
|
1881
|
-
.onClose=${() => this.closePopover()}
|
|
1882
|
-
>
|
|
1883
|
-
<div
|
|
1884
|
-
class="popper-input"
|
|
1885
|
-
style="position: sticky; top: 0; z-index: 1;"
|
|
1886
|
-
>
|
|
1887
|
-
<lit-input
|
|
1888
|
-
.value=${this.filterText}
|
|
1889
|
-
.onInput=${(value) => {
|
|
1890
|
-
this.filterText =
|
|
1891
|
-
value?.toLowerCase?.() ||
|
|
1892
|
-
'';
|
|
1893
|
-
}}
|
|
1894
|
-
.onClear=${() => {
|
|
1895
|
-
this.filterText = '';
|
|
1896
|
-
}}
|
|
1897
|
-
placeholder="${msg('Zadejte název sloupce')}"
|
|
1898
|
-
></lit-input>
|
|
1899
|
-
</div>
|
|
1900
|
-
<lit-menu tabindex="0">
|
|
1901
|
-
${this.columns
|
|
1902
|
-
.filter((col) => {
|
|
1903
|
-
const name = col?.headerName?.toLowerCase() ||
|
|
1904
|
-
col?.field.toLowerCase();
|
|
1905
|
-
return name.includes(this.filterText);
|
|
1906
|
-
})
|
|
1907
|
-
.sort((a, b) => {
|
|
1908
|
-
const aUnderscore = a.field.startsWith('_');
|
|
1909
|
-
const bUnderscore = b.field.startsWith('_');
|
|
1910
|
-
if (aUnderscore && !bUnderscore)
|
|
1911
|
-
return 1;
|
|
1912
|
-
if (!aUnderscore && bUnderscore)
|
|
1913
|
-
return -1;
|
|
1914
|
-
return (a.headerName || a.field).localeCompare(b.headerName || b.field);
|
|
1915
|
-
})
|
|
1916
|
-
.map((col) => html `
|
|
1917
|
-
<lit-menu-item
|
|
1918
|
-
.onClick=${() => this.toggleColumn(col?.field)}
|
|
1919
|
-
.isActive=${!(this
|
|
1920
|
-
.columnVisibility?.[col?.field] === false)}
|
|
1921
|
-
>
|
|
1922
|
-
<span
|
|
1923
|
-
class="menu-item--multiple"
|
|
1924
|
-
>
|
|
1925
|
-
<lit-checkbox
|
|
1926
|
-
class="cursor"
|
|
1927
|
-
.checked=${!(this
|
|
1928
|
-
.columnVisibility?.[col
|
|
1929
|
-
?.field] === false)}
|
|
1930
|
-
></lit-checkbox>
|
|
1931
|
-
${col?.headerName ||
|
|
1932
|
-
col?.field}
|
|
1933
|
-
</span>
|
|
1934
|
-
</lit-menu-item>
|
|
1935
|
-
`)}
|
|
1936
|
-
</lit-menu>
|
|
1937
|
-
|
|
1938
|
-
${isEqual(filteredColumns.length, 0)
|
|
1939
|
-
? html `
|
|
1940
|
-
<div
|
|
1941
|
-
style="display: flex; flex-direction: column; align-items: center; padding: 1rem;"
|
|
1942
|
-
>
|
|
1943
|
-
<div
|
|
1944
|
-
style="max-height: 6rem; max-width: 6rem;"
|
|
1945
|
-
>
|
|
1946
|
-
<not-found></not-found>
|
|
1947
|
-
</div>
|
|
1948
|
-
<div>
|
|
1949
|
-
${msg('Nenalezeno')}
|
|
1950
|
-
</div>
|
|
1951
|
-
</div>
|
|
1952
|
-
`
|
|
1953
|
-
: null}
|
|
1954
|
-
</simple-popper>
|
|
1955
|
-
|
|
1956
1979
|
<lit-icon-button
|
|
1957
1980
|
icon="administration"
|
|
1958
1981
|
@click="${this.toggleModal}"
|
|
@@ -2567,6 +2590,9 @@ __decorate([
|
|
|
2567
2590
|
__decorate([
|
|
2568
2591
|
query('.grid')
|
|
2569
2592
|
], LitDataGridTanstack.prototype, "_container", void 0);
|
|
2593
|
+
__decorate([
|
|
2594
|
+
query('.settings-reference')
|
|
2595
|
+
], LitDataGridTanstack.prototype, "settingsReference", void 0);
|
|
2570
2596
|
if (!window.customElements.get('lit-data-grid-tanstack')) {
|
|
2571
2597
|
window.customElements.define('lit-data-grid-tanstack', LitDataGridTanstack);
|
|
2572
2598
|
}
|