overview-components 1.0.65 → 1.0.67

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