overview-components 1.0.79 → 1.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/dist/assets/generated/locales/de.js +70 -72
  2. package/dist/assets/generated/locales/de.js.map +1 -0
  3. package/dist/assets/generated/locales/en.js +70 -72
  4. package/dist/assets/generated/locales/en.js.map +1 -0
  5. package/dist/assets/generated/locales/fr.js +70 -72
  6. package/dist/assets/generated/locales/fr.js.map +1 -0
  7. package/dist/assets/generated/locales/hr.js +70 -72
  8. package/dist/assets/generated/locales/hr.js.map +1 -0
  9. package/dist/assets/generated/locales/it.js +70 -72
  10. package/dist/assets/generated/locales/it.js.map +1 -0
  11. package/dist/assets/generated/locales/pl.js +70 -72
  12. package/dist/assets/generated/locales/pl.js.map +1 -0
  13. package/dist/assets/generated/locales/ro.js +70 -72
  14. package/dist/assets/generated/locales/ro.js.map +1 -0
  15. package/dist/assets/generated/locales/sk.js +70 -72
  16. package/dist/assets/generated/locales/sk.js.map +1 -0
  17. package/dist/assets/generated/locales/sr.js +70 -72
  18. package/dist/assets/generated/locales/sr.js.map +1 -0
  19. package/dist/assets/icons/iconGlyphs.js +678 -679
  20. package/dist/assets/icons/iconGlyphs.js.map +1 -0
  21. package/dist/assets/illustration/delete-illustration.js +96 -0
  22. package/dist/assets/illustration/delete-illustration.js.map +1 -0
  23. package/dist/assets/illustration/no-content.js +167 -0
  24. package/dist/assets/illustration/no-content.js.map +1 -0
  25. package/dist/assets/illustration/no-preview.js +133 -0
  26. package/dist/assets/illustration/no-preview.js.map +1 -0
  27. package/dist/assets/illustration/not-found.js +106 -0
  28. package/dist/assets/illustration/not-found.js.map +1 -0
  29. package/dist/assets/illustration/settings-illustration.js +176 -0
  30. package/dist/assets/illustration/settings-illustration.js.map +1 -0
  31. package/dist/components/components-settings/attachments-tab-settings.js +226 -0
  32. package/dist/components/components-settings/attachments-tab-settings.js.map +1 -0
  33. package/dist/components/components-settings/data-grid-settings.js +318 -0
  34. package/dist/components/components-settings/data-grid-settings.js.map +1 -0
  35. package/dist/components/components-settings/section-tab-settings.js +269 -0
  36. package/dist/components/components-settings/section-tab-settings.js.map +1 -0
  37. package/dist/components/components-settings/tabs-overview-settings.js +439 -0
  38. package/dist/components/components-settings/tabs-overview-settings.js.map +1 -0
  39. package/dist/components/lit-attachments-tab.js +432 -271
  40. package/dist/components/lit-attachments-tab.js.map +1 -0
  41. package/dist/components/lit-badge.js +40 -40
  42. package/dist/components/lit-badge.js.map +1 -0
  43. package/dist/components/lit-case-variables-tab.js +497 -382
  44. package/dist/components/lit-case-variables-tab.js.map +1 -0
  45. package/dist/components/lit-chart.js +406 -378
  46. package/dist/components/lit-chart.js.map +1 -0
  47. package/dist/components/lit-data-grid-tanstack.js +1663 -1150
  48. package/dist/components/lit-data-grid-tanstack.js.map +1 -0
  49. package/dist/components/lit-filter-modal.js +230 -198
  50. package/dist/components/lit-filter-modal.js.map +1 -0
  51. package/dist/components/lit-multiselect-item.js +477 -301
  52. package/dist/components/lit-multiselect-item.js.map +1 -0
  53. package/dist/components/lit-section-tab.js +85 -73
  54. package/dist/components/lit-section-tab.js.map +1 -0
  55. package/dist/components/lit-tabs-overview.js +232 -191
  56. package/dist/components/lit-tabs-overview.js.map +1 -0
  57. package/dist/components/modals/lit-confirm-modal.js +120 -0
  58. package/dist/components/modals/lit-confirm-modal.js.map +1 -0
  59. package/dist/components/modals/lit-delete-modal.js +128 -0
  60. package/dist/components/modals/lit-delete-modal.js.map +1 -0
  61. package/dist/components/react-wrappers/attachments-tab.js +8 -13
  62. package/dist/components/react-wrappers/attachments-tab.js.map +1 -0
  63. package/dist/components/react-wrappers/badge.js +8 -13
  64. package/dist/components/react-wrappers/badge.js.map +1 -0
  65. package/dist/components/react-wrappers/button.js +8 -13
  66. package/dist/components/react-wrappers/button.js.map +1 -0
  67. package/dist/components/react-wrappers/case-variables-tab.js +8 -13
  68. package/dist/components/react-wrappers/case-variables-tab.js.map +1 -0
  69. package/dist/components/react-wrappers/chart.js +8 -13
  70. package/dist/components/react-wrappers/chart.js.map +1 -0
  71. package/dist/components/react-wrappers/data-grid-tanstack.js +8 -13
  72. package/dist/components/react-wrappers/data-grid-tanstack.js.map +1 -0
  73. package/dist/components/react-wrappers/filter-modal.js +8 -13
  74. package/dist/components/react-wrappers/filter-modal.js.map +1 -0
  75. package/dist/components/react-wrappers/progress-bar.js +8 -13
  76. package/dist/components/react-wrappers/progress-bar.js.map +1 -0
  77. package/dist/components/react-wrappers/section-tab.js +8 -13
  78. package/dist/components/react-wrappers/section-tab.js.map +1 -0
  79. package/dist/components/react-wrappers/tabs-overview.js +8 -13
  80. package/dist/components/react-wrappers/tabs-overview.js.map +1 -0
  81. package/dist/data/translations.js +2763 -0
  82. package/dist/data/translations.js.map +1 -0
  83. package/dist/index.js +107 -113
  84. package/dist/index.js.map +1 -0
  85. package/dist/schemas/index.js +17 -0
  86. package/dist/schemas/index.js.map +1 -0
  87. package/dist/schemas/lit-attachments-tab-document.schema.js +20 -0
  88. package/dist/schemas/lit-attachments-tab-document.schema.js.map +1 -0
  89. package/dist/schemas/lit-attachments-tab-settings-value.schema.js +15 -0
  90. package/dist/schemas/lit-attachments-tab-settings-value.schema.js.map +1 -0
  91. package/dist/schemas/lit-attachments-tab.schema.js +32 -0
  92. package/dist/schemas/lit-attachments-tab.schema.js.map +1 -0
  93. package/dist/schemas/lit-case-variables-tab-cell.schema.js +43 -0
  94. package/dist/schemas/lit-case-variables-tab-cell.schema.js.map +1 -0
  95. package/dist/schemas/lit-case-variables-tab-rows.schema.js +6 -0
  96. package/dist/schemas/lit-case-variables-tab-rows.schema.js.map +1 -0
  97. package/dist/schemas/lit-case-variables-tab.schema.js +24 -0
  98. package/dist/schemas/lit-case-variables-tab.schema.js.map +1 -0
  99. package/dist/schemas/lit-data-grid-tanstack-column-array.schema.js +6 -0
  100. package/dist/schemas/lit-data-grid-tanstack-column-array.schema.js.map +1 -0
  101. package/dist/schemas/lit-data-grid-tanstack-column-custom-filter-array.schema.js +6 -0
  102. package/dist/schemas/lit-data-grid-tanstack-column-custom-filter-array.schema.js.map +1 -0
  103. package/dist/schemas/lit-data-grid-tanstack-column-custom-filter.schema.js +11 -0
  104. package/dist/schemas/lit-data-grid-tanstack-column-custom-filter.schema.js.map +1 -0
  105. package/dist/schemas/lit-data-grid-tanstack-column.schema.js +55 -0
  106. package/dist/schemas/lit-data-grid-tanstack-column.schema.js.map +1 -0
  107. package/dist/schemas/lit-data-grid-tanstack.schema.js +99 -0
  108. package/dist/schemas/lit-data-grid-tanstack.schema.js.map +1 -0
  109. package/dist/schemas/lit-section-tab-schema.js +24 -0
  110. package/dist/schemas/lit-section-tab-schema.js.map +1 -0
  111. package/dist/schemas/lit-tabs-overview-tab-array.schema.js +6 -0
  112. package/dist/schemas/lit-tabs-overview-tab-array.schema.js.map +1 -0
  113. package/dist/schemas/lit-tabs-overview-tab.schema.js +32 -0
  114. package/dist/schemas/lit-tabs-overview-tab.schema.js.map +1 -0
  115. package/dist/schemas/lit-tabs-overview.schema.js +29 -0
  116. package/dist/schemas/lit-tabs-overview.schema.js.map +1 -0
  117. package/dist/scripts/translate-locales.js +69 -0
  118. package/dist/scripts/translate-locales.js.map +1 -0
  119. package/dist/shared/filter-inputs.js +335 -234
  120. package/dist/shared/filter-inputs.js.map +1 -0
  121. package/dist/shared/lit-button.js +80 -66
  122. package/dist/shared/lit-button.js.map +1 -0
  123. package/dist/shared/lit-case-variables-tab-cell.js +127 -108
  124. package/dist/shared/lit-case-variables-tab-cell.js.map +1 -0
  125. package/dist/shared/lit-checkbox.js +94 -78
  126. package/dist/shared/lit-checkbox.js.map +1 -0
  127. package/dist/shared/lit-custom-popper.js +84 -66
  128. package/dist/shared/lit-custom-popper.js.map +1 -0
  129. package/dist/shared/lit-data-grid-action-buttons-popover.js +178 -141
  130. package/dist/shared/lit-data-grid-action-buttons-popover.js.map +1 -0
  131. package/dist/shared/lit-data-grid-density-popover.js +54 -49
  132. package/dist/shared/lit-data-grid-density-popover.js.map +1 -0
  133. package/dist/shared/lit-data-grid-export-popover.js +43 -41
  134. package/dist/shared/lit-data-grid-export-popover.js.map +1 -0
  135. package/dist/shared/lit-data-grid-operators-popover.js +90 -70
  136. package/dist/shared/lit-data-grid-operators-popover.js.map +1 -0
  137. package/dist/shared/lit-data-grid-row-actions.js +54 -51
  138. package/dist/shared/lit-data-grid-row-actions.js.map +1 -0
  139. package/dist/shared/lit-date-picker.js +451 -370
  140. package/dist/shared/lit-date-picker.js.map +1 -0
  141. package/dist/shared/lit-icon-button.js +66 -52
  142. package/dist/shared/lit-icon-button.js.map +1 -0
  143. package/dist/shared/lit-icon.js +261 -259
  144. package/dist/shared/lit-icon.js.map +1 -0
  145. package/dist/shared/lit-input.js +143 -115
  146. package/dist/shared/lit-input.js.map +1 -0
  147. package/dist/shared/lit-label.js +63 -55
  148. package/dist/shared/lit-label.js.map +1 -0
  149. package/dist/shared/lit-loader.js +26 -27
  150. package/dist/shared/lit-loader.js.map +1 -0
  151. package/dist/shared/lit-loading-bar.js +57 -24
  152. package/dist/shared/lit-loading-bar.js.map +1 -0
  153. package/dist/shared/lit-menu-item.js +56 -51
  154. package/dist/shared/lit-menu-item.js.map +1 -0
  155. package/dist/shared/lit-menu.js +22 -20
  156. package/dist/shared/lit-menu.js.map +1 -0
  157. package/dist/shared/lit-modal-body.js +9 -15
  158. package/dist/shared/lit-modal-body.js.map +1 -0
  159. package/dist/shared/lit-modal-footer.js +17 -20
  160. package/dist/shared/lit-modal-footer.js.map +1 -0
  161. package/dist/shared/lit-modal-header.js +24 -27
  162. package/dist/shared/lit-modal-header.js.map +1 -0
  163. package/dist/shared/lit-modal.js +112 -71
  164. package/dist/shared/lit-modal.js.map +1 -0
  165. package/dist/shared/lit-overflow-tooltip.js +86 -68
  166. package/dist/shared/lit-overflow-tooltip.js.map +1 -0
  167. package/dist/shared/lit-pill.js +39 -37
  168. package/dist/shared/lit-pill.js.map +1 -0
  169. package/dist/shared/lit-progress-bar.js +33 -35
  170. package/dist/shared/lit-progress-bar.js.map +1 -0
  171. package/dist/shared/lit-responsive-button.js +74 -64
  172. package/dist/shared/lit-responsive-button.js.map +1 -0
  173. package/dist/shared/lit-select-field.js +266 -183
  174. package/dist/shared/lit-select-field.js.map +1 -0
  175. package/dist/shared/lit-select.js +276 -202
  176. package/dist/shared/lit-select.js.map +1 -0
  177. package/dist/shared/lit-settings.js +68 -51
  178. package/dist/shared/lit-settings.js.map +1 -0
  179. package/dist/shared/lit-text-field.js +99 -82
  180. package/dist/shared/lit-text-field.js.map +1 -0
  181. package/dist/shared/lit-toggle.js +74 -65
  182. package/dist/shared/lit-toggle.js.map +1 -0
  183. package/dist/shared/lit-tooltip.js +113 -84
  184. package/dist/shared/lit-tooltip.js.map +1 -0
  185. package/dist/shared/simple-popper.js +229 -149
  186. package/dist/shared/simple-popper.js.map +1 -0
  187. package/dist/shared/simple-tooltip.js +198 -124
  188. package/dist/shared/simple-tooltip.js.map +1 -0
  189. package/dist/shared/styles/button-shared-styles.js +4 -8
  190. package/dist/shared/styles/button-shared-styles.js.map +1 -0
  191. package/dist/styles.js +3 -8
  192. package/dist/styles.js.map +1 -0
  193. package/dist/utils/currency.js +15 -12
  194. package/dist/utils/currency.js.map +1 -0
  195. package/dist/utils/custom-filters.js +80 -46
  196. package/dist/utils/custom-filters.js.map +1 -0
  197. package/dist/utils/date.js +21 -14
  198. package/dist/utils/date.js.map +1 -0
  199. package/dist/utils/getOperatorByType.js +65 -51
  200. package/dist/utils/getOperatorByType.js.map +1 -0
  201. package/dist/utils/getOverviewValue.js +177 -0
  202. package/dist/utils/getOverviewValue.js.map +1 -0
  203. package/dist/utils/localization.js +429 -412
  204. package/dist/utils/localization.js.map +1 -0
  205. package/dist/utils/utils.js +12 -10
  206. package/dist/utils/utils.js.map +1 -0
  207. package/dist/utils/validate-json-schema.js +8 -0
  208. package/dist/utils/validate-json-schema.js.map +1 -0
  209. package/dist/validators/validator.js +7 -0
  210. package/dist/validators/validator.js.map +1 -0
  211. package/package.json +2 -2
@@ -1,243 +1,344 @@
1
- import "../node_modules/@lit/reactive-element/reactive-element.js";
2
- import { html as p } from "../node_modules/lit-html/lit-html.js";
3
- import { LitElement as y } from "../node_modules/lit-element/lit-element.js";
4
- import d from "lodash";
5
- import { msg as m } from "../node_modules/@lit/localize/init/install.js";
6
- import "../node_modules/@lit/localize/init/runtime.js";
7
- import { customElement as v } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
8
- import { property as h } from "../node_modules/@lit/reactive-element/decorators/property.js";
9
- import { state as f } from "../node_modules/@lit/reactive-element/decorators/state.js";
10
- /* empty css */
11
- import { debounce as c } from "../utils/utils.js";
12
- import { css as $ } from "../node_modules/@lit/reactive-element/css-tag.js";
13
- var g = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (e, t, s, r) => {
14
- for (var i = r > 1 ? void 0 : r ? b(t, s) : t, a = e.length - 1, l; a >= 0; a--)
15
- (l = e[a]) && (i = (r ? l(t, s, i) : l(i)) || i);
16
- return r && i && g(t, s, i), i;
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;
17
6
  };
18
- let n = class extends y {
19
- constructor() {
20
- super(), this.minFilterCharacters = 0, this.server = !1, this.value = void 0, this.operator = void 0, this.filterOperators = [], this.valueOptions = [], this.filterVariant = [], this.isClickInside = !1, this.handleSetOperator = (e, t) => {
21
- var s, r, i;
22
- this.operator = (s = this.filterOperators.find((a) => a.value === e)) == null ? void 0 : s.value, ["isEmpty", "isNotEmpty"].includes(e) ? (this.value = null, (r = this.column) == null || r.setFilterValue({ value: this.value, operator: e })) : this.value && !(t != null && t.silent) && ((i = this.column) == null || i.setFilterValue({
23
- value: this.value,
24
- operator: this.operator
25
- }));
26
- }, this.debouncedSetTextFilter = c((e) => {
27
- this.checkNumberOfCharacters(e, () => {
28
- this.handleSetFilter(e);
29
- });
30
- }), this.debouncedSetNumberFilter = c((e) => {
31
- this.handleSetFilter(e);
32
- });
33
- }
34
- checkNumberOfCharacters(e, t) {
35
- (d.isEmpty(e) || e.length >= this.minFilterCharacters) && t();
36
- }
37
- updated(e) {
38
- var t, s, r, i, a;
39
- if (e.has("column") && (this.filterVariant === "select" || this.filterVariant === "multiselect"))
40
- if ((s = (t = this.column) == null ? void 0 : t.columnDef) != null && s.meta.valueOptions || this.server)
41
- this.valueOptions = ((i = (r = this.column) == null ? void 0 : r.columnDef) == null ? void 0 : i.meta.valueOptions) || [];
42
- else {
43
- const l = Array.from(
44
- (a = this.column) == null ? void 0 : a.getFacetedUniqueValues().keys()
45
- ).sort().slice(0, 5e3);
46
- this.valueOptions = l.map((u) => ({
47
- value: u,
48
- label: u
49
- }));
50
- }
51
- }
52
- handleSetFilter(e) {
53
- var t, s, r;
54
- this.value = e, d.isEmpty(e) ? (r = this.column) == null || r.setFilterValue() : this.server ? (t = this.column) == null || t.setFilterValue({ value: this.value, operator: this.operator }) : (s = this.column) == null || s.setFilterValue(this.value);
55
- }
56
- handleClearFilter() {
57
- var e;
58
- this.server && (this.operator = this.filterOperators[0].value), this.value = null, (e = this.column) == null || e.setFilterValue();
59
- }
60
- handleDateChange(e) {
61
- d.isEqual(e, this.value) || this.handleSetFilter(e);
62
- }
63
- handleStartDateChange(e) {
64
- this.startDate = e, this.handleFilterDateRangeChange();
65
- }
66
- handleEndDateChange(e) {
67
- this.endDate = e, this.handleFilterDateRangeChange();
68
- }
69
- handleFilterDateRangeChange() {
70
- !this.startDate && !this.endDate ? this.handleSetFilter(void 0) : this.handleSetFilter({ startDate: this.startDate, endDate: this.endDate });
71
- }
72
- handleKeyDown(e) {
73
- if (e.key === "Enter") {
74
- const t = e.target;
75
- t && (this.handleSetFilter(t.value), this.requestUpdate());
76
- } else if (e.key === "Tab") {
77
- const t = this.getFocusableElements();
78
- if (t.length <= 1) {
79
- e.preventDefault(), this.dispatchEvent(
80
- new CustomEvent("filter-tab", {
81
- bubbles: !0,
82
- composed: !0,
83
- detail: {
84
- direction: e.shiftKey ? "backward" : "forward",
85
- currentFilter: this
7
+ import { LitElement, html, css } from 'lit';
8
+ import _ from 'lodash';
9
+ import { msg } from '@lit/localize';
10
+ import { customElement, property, state } from 'lit/decorators.js';
11
+ import 'air-datepicker/air-datepicker.css';
12
+ // components
13
+ import './lit-icon.js';
14
+ import './lit-icon-button.js';
15
+ import './lit-select.js';
16
+ import './lit-date-picker.js';
17
+ import './lit-data-grid-operators-popover.js';
18
+ import './lit-input.js';
19
+ import { debounce } from '../utils/utils.js';
20
+ let FilterInputs = class FilterInputs extends LitElement {
21
+ constructor() {
22
+ super();
23
+ this.minFilterCharacters = 0;
24
+ this.server = false;
25
+ this.value = undefined;
26
+ this.operator = undefined;
27
+ this.filterOperators = [];
28
+ this.valueOptions = [];
29
+ this.filterVariant = [];
30
+ this.isClickInside = false;
31
+ this.handleSetOperator = (value, opt) => {
32
+ this.operator = this.filterOperators.find((item) => item.value === value)?.value;
33
+ if (['isEmpty', 'isNotEmpty'].includes(value)) {
34
+ this.value = null;
35
+ this.column?.setFilterValue({ value: this.value, operator: value });
86
36
  }
87
- })
88
- );
89
- return;
90
- }
91
- const s = e.target, r = t.indexOf(s);
92
- if (e.shiftKey && r === 0 || !e.shiftKey && r === t.length - 1)
93
- e.preventDefault(), this.dispatchEvent(
94
- new CustomEvent("filter-tab", {
95
- bubbles: !0,
96
- composed: !0,
97
- detail: {
98
- direction: e.shiftKey ? "backward" : "forward",
99
- currentFilter: this
37
+ else {
38
+ if (this.value && !opt?.silent) {
39
+ this.column?.setFilterValue({
40
+ value: this.value,
41
+ operator: this.operator,
42
+ });
43
+ }
100
44
  }
101
- })
102
- );
103
- else {
104
- e.preventDefault();
105
- const i = e.shiftKey ? r - 1 : r + 1;
106
- t[i].focus();
107
- }
45
+ };
46
+ // Create debounced methods with 500ms delay
47
+ this.debouncedSetTextFilter = debounce((value) => {
48
+ this.checkNumberOfCharacters(value, () => {
49
+ this.handleSetFilter(value);
50
+ });
51
+ });
52
+ this.debouncedSetNumberFilter = debounce((value) => {
53
+ this.handleSetFilter(value);
54
+ });
108
55
  }
109
- }
110
- // Improved getFocusableElements to find all actual focusable elements
111
- getFocusableElements() {
112
- var i, a, l;
113
- const e = [], t = (i = this.shadowRoot) == null ? void 0 : i.querySelectorAll("lit-input");
114
- t && t.forEach((u) => e.push(u));
115
- const s = (a = this.shadowRoot) == null ? void 0 : a.querySelectorAll("lit-select");
116
- s && s.forEach((u) => e.push(u));
117
- const r = (l = this.shadowRoot) == null ? void 0 : l.querySelectorAll("lit-date-picker");
118
- return r && r.forEach((u) => e.push(u)), e;
119
- }
120
- focus() {
121
- var t;
122
- const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector(
123
- "lit-input, lit-select, lit-date-picker"
124
- );
125
- e == null || e.focus();
126
- }
127
- render() {
128
- return this.filterVariant === "numberRange" ? this.renderNumberRangeInput() : this.filterVariant === "select" ? this.renderSelectInput() : this.filterVariant === "multiselect" ? this.renderSelectInput(!0) : this.filterVariant === "number" ? this.renderNumberInput() : this.filterVariant === "currency" ? this.renderNumberInput() : this.filterVariant === "date" ? this.renderDateInput() : this.filterVariant === "dateTime" ? this.renderDateInput() : this.filterVariant === "dateRange" ? this.renderDateRangeInput() : this.filterVariant === "dateTimeRange" ? this.renderDateRangeInput() : this.renderTextInput();
129
- }
130
- renderNumberRangeInput() {
131
- var t, s;
132
- const e = c(
133
- (r, i) => {
134
- this.handleSetFilter([r, i]);
135
- }
136
- );
137
- return p`
56
+ checkNumberOfCharacters(value, cf) {
57
+ if (!_.isEmpty(value)) {
58
+ if (value.length >= this.minFilterCharacters) {
59
+ cf();
60
+ }
61
+ }
62
+ else {
63
+ cf();
64
+ }
65
+ }
66
+ updated(changedProperties) {
67
+ if (changedProperties.has('column')) {
68
+ if (this.filterVariant === 'select' || this.filterVariant === 'multiselect') {
69
+ if (this.column?.columnDef?.meta.valueOptions || this.server) {
70
+ this.valueOptions = this.column?.columnDef?.meta.valueOptions || [];
71
+ }
72
+ else {
73
+ const sortedUniqueValues = Array.from(this.column?.getFacetedUniqueValues().keys())
74
+ .sort()
75
+ .slice(0, 5000);
76
+ this.valueOptions = sortedUniqueValues.map((value) => ({
77
+ value,
78
+ label: value,
79
+ }));
80
+ }
81
+ }
82
+ }
83
+ }
84
+ handleSetFilter(value) {
85
+ this.value = value;
86
+ if (!_.isEmpty(value)) {
87
+ if (this.server) {
88
+ this.column?.setFilterValue({ value: this.value, operator: this.operator });
89
+ }
90
+ else {
91
+ this.column?.setFilterValue(this.value);
92
+ }
93
+ }
94
+ else {
95
+ this.column?.setFilterValue();
96
+ }
97
+ }
98
+ handleClearFilter() {
99
+ if (this.server) {
100
+ this.operator = this.filterOperators[0].value;
101
+ }
102
+ this.value = null;
103
+ this.column?.setFilterValue();
104
+ }
105
+ handleDateChange(value) {
106
+ if (!_.isEqual(value, this.value)) {
107
+ this.handleSetFilter(value);
108
+ }
109
+ }
110
+ handleStartDateChange(value) {
111
+ this.startDate = value;
112
+ this.handleFilterDateRangeChange();
113
+ }
114
+ handleEndDateChange(value) {
115
+ this.endDate = value;
116
+ this.handleFilterDateRangeChange();
117
+ }
118
+ handleFilterDateRangeChange() {
119
+ if (!this.startDate && !this.endDate) {
120
+ this.handleSetFilter(undefined);
121
+ }
122
+ else {
123
+ this.handleSetFilter({ startDate: this.startDate, endDate: this.endDate });
124
+ }
125
+ }
126
+ handleKeyDown(event) {
127
+ if (event.key === 'Enter') {
128
+ const target = event.target;
129
+ if (target) {
130
+ this.handleSetFilter(target.value);
131
+ this.requestUpdate();
132
+ }
133
+ }
134
+ else if (event.key === 'Tab') {
135
+ // Get all focusable elements within this filter
136
+ const focusableElements = this.getFocusableElements();
137
+ if (focusableElements.length <= 1) {
138
+ // If there's only one or no focusable element, proceed with filter-to-filter navigation
139
+ event.preventDefault();
140
+ this.dispatchEvent(new CustomEvent('filter-tab', {
141
+ bubbles: true,
142
+ composed: true,
143
+ detail: {
144
+ direction: event.shiftKey ? 'backward' : 'forward',
145
+ currentFilter: this,
146
+ },
147
+ }));
148
+ return;
149
+ }
150
+ // If there are multiple elements (like in range filters), handle internal navigation
151
+ const currentElement = event.target;
152
+ const currentIndex = focusableElements.indexOf(currentElement);
153
+ // If Shift+Tab on first element or Tab on last element, move to next/previous filter
154
+ if ((event.shiftKey && currentIndex === 0) ||
155
+ (!event.shiftKey && currentIndex === focusableElements.length - 1)) {
156
+ event.preventDefault();
157
+ this.dispatchEvent(new CustomEvent('filter-tab', {
158
+ bubbles: true,
159
+ composed: true,
160
+ detail: {
161
+ direction: event.shiftKey ? 'backward' : 'forward',
162
+ currentFilter: this,
163
+ },
164
+ }));
165
+ }
166
+ else {
167
+ // Otherwise, just move to the next/previous internal element
168
+ event.preventDefault();
169
+ const nextIndex = event.shiftKey ? currentIndex - 1 : currentIndex + 1;
170
+ focusableElements[nextIndex].focus();
171
+ }
172
+ }
173
+ }
174
+ // Improved getFocusableElements to find all actual focusable elements
175
+ getFocusableElements() {
176
+ const elements = [];
177
+ // Check for regular inputs
178
+ const inputs = this.shadowRoot?.querySelectorAll('lit-input');
179
+ if (inputs) {
180
+ inputs.forEach((input) => elements.push(input));
181
+ }
182
+ // Check for lit-select components
183
+ const selects = this.shadowRoot?.querySelectorAll('lit-select');
184
+ if (selects) {
185
+ selects.forEach((select) => elements.push(select));
186
+ }
187
+ // Check for lit-date-picker components
188
+ const datePickers = this.shadowRoot?.querySelectorAll('lit-date-picker');
189
+ if (datePickers) {
190
+ datePickers.forEach((datePicker) => elements.push(datePicker));
191
+ }
192
+ return elements;
193
+ }
194
+ focus() {
195
+ const firstFocusable = this.shadowRoot?.querySelector('lit-input, lit-select, lit-date-picker');
196
+ firstFocusable?.focus();
197
+ }
198
+ render() {
199
+ if (this.filterVariant === 'numberRange') {
200
+ return this.renderNumberRangeInput();
201
+ }
202
+ else if (this.filterVariant === 'select') {
203
+ return this.renderSelectInput();
204
+ }
205
+ else if (this.filterVariant === 'multiselect') {
206
+ return this.renderSelectInput(true);
207
+ }
208
+ else if (this.filterVariant === 'number') {
209
+ return this.renderNumberInput();
210
+ }
211
+ else if (this.filterVariant === 'currency') {
212
+ return this.renderNumberInput();
213
+ }
214
+ else if (this.filterVariant === 'date') {
215
+ return this.renderDateInput();
216
+ }
217
+ else if (this.filterVariant === 'dateTime') {
218
+ return this.renderDateInput();
219
+ }
220
+ else if (this.filterVariant === 'dateRange') {
221
+ return this.renderDateRangeInput();
222
+ }
223
+ else if (this.filterVariant === 'dateTimeRange') {
224
+ return this.renderDateRangeInput();
225
+ }
226
+ else {
227
+ return this.renderTextInput();
228
+ }
229
+ }
230
+ renderNumberRangeInput() {
231
+ const debouncedSetRangeFilter = debounce((min, max) => {
232
+ this.handleSetFilter([min, max]);
233
+ });
234
+ return html `
138
235
  <div class="range">
139
236
  <lit-input
140
237
  class="range-fields"
141
238
  type="number"
142
239
  .server="${this.server}"
143
- .value="${((t = this.value) == null ? void 0 : t[0]) || ""}"
240
+ .value="${this.value?.[0] || ''}"
144
241
  placeholder="Min"
145
- .onInput=${(r) => {
146
- var l;
147
- const i = r ? Number(r) : void 0, a = (l = this.value) == null ? void 0 : l[1];
148
- e(i, a);
149
- }}
242
+ .onInput=${(val) => {
243
+ const min = val ? Number(val) : undefined;
244
+ const currentMax = this.value?.[1];
245
+ debouncedSetRangeFilter(min, currentMax);
246
+ }}
150
247
  .onClear="${() => {
151
- this.handleClearFilter();
152
- }}"
153
- @keydown=${(r) => this.handleKeyDown(r)}
248
+ this.handleClearFilter();
249
+ }}"
250
+ @keydown=${(e) => this.handleKeyDown(e)}
154
251
  ></lit-input>
155
252
 
156
253
  <lit-input
157
254
  class="range-fields"
158
255
  type="number"
159
256
  .server="${this.server}"
160
- .value="${((s = this.value) == null ? void 0 : s[1]) || ""}"
257
+ .value="${this.value?.[1] || ''}"
161
258
  placeholder="Max"
162
- .onInput=${(r) => {
163
- var l;
164
- const i = r ? Number(r) : void 0, a = (l = this.value) == null ? void 0 : l[0];
165
- e(a, i);
166
- }}
259
+ .onInput=${(val) => {
260
+ const max = val ? Number(val) : undefined;
261
+ const currentMin = this.value?.[0];
262
+ debouncedSetRangeFilter(currentMin, max);
263
+ }}
167
264
  .onClear="${() => {
168
- this.handleClearFilter();
169
- }}"
170
- @keydown=${(r) => this.handleKeyDown(r)}
265
+ this.handleClearFilter();
266
+ }}"
267
+ @keydown=${(e) => this.handleKeyDown(e)}
171
268
  ></lit-input>
172
269
  </div>
173
270
  `;
174
- }
175
- renderSelectInput(e = !1) {
176
- return p`
271
+ }
272
+ renderSelectInput(multiselect = false) {
273
+ return html `
177
274
  <lit-select
178
275
  id=${this.column.id}
179
- .value="${typeof this.value == "number" ? this.value.toString() : this.value || []}"
276
+ .value="${typeof this.value === 'number'
277
+ ? this.value.toString()
278
+ : this.value || []}"
180
279
  .server="${this.server}"
181
280
  .options="${this.valueOptions}"
182
- .onChange="${(t) => {
183
- const s = t.length === 0 ? void 0 : t;
184
- this.handleSetFilter(s);
185
- }}"
186
- .multiple="${e}"
187
- @keydown=${(t) => this.handleKeyDown(t)}
281
+ .onChange="${(selectedValue) => {
282
+ const filterValue = selectedValue.length === 0 ? undefined : selectedValue;
283
+ this.handleSetFilter(filterValue);
284
+ }}"
285
+ .multiple="${multiselect}"
286
+ @keydown=${(e) => this.handleKeyDown(e)}
188
287
  .setOperator="${this.handleSetOperator}"
189
288
  .operator="${this.operator}"
190
289
  .filterOperators="${this.filterOperators}"
191
290
  ></lit-select>
192
291
  `;
193
- }
194
- renderNumberInput() {
195
- return p`
292
+ }
293
+ renderNumberInput() {
294
+ return html `
196
295
  <lit-input
197
296
  type="number"
198
- .value="${this.value || ""}"
297
+ .value="${this.value || ''}"
199
298
  .server="${this.server}"
200
- .onInput=${(e) => this.debouncedSetNumberFilter(e)}
299
+ .onInput=${(val) => this.debouncedSetNumberFilter(val)}
201
300
  .onClear="${() => {
202
- this.handleClearFilter();
203
- }}"
301
+ this.handleClearFilter();
302
+ }}"
204
303
  @keydown=${(e) => this.handleKeyDown(e)}
205
304
  .setOperator="${this.handleSetOperator}"
206
305
  .operator="${this.operator}"
207
- .disabled="${this.server && ["isEmpty", "isNotEmpty"].includes(this.operator)}"
306
+ .disabled="${this.server &&
307
+ ['isEmpty', 'isNotEmpty'].includes(this.operator)}"
208
308
  .filterOperators="${this.filterOperators}"
209
309
  ></lit-input>
210
310
  `;
211
- }
212
- renderDateInput() {
213
- return p`
311
+ }
312
+ renderDateInput() {
313
+ return html `
214
314
  <lit-date-picker
215
315
  class="datePicker"
216
316
  .server="${this.server}"
217
- .pickerVariant=${this.filterVariant || ""}
317
+ .pickerVariant=${this.filterVariant || ''}
218
318
  .value=${this.value}
219
319
  .dateFormat=${this.dateFormat}
220
320
  .userLang=${this.userLang}
221
- .onChange="${(e) => this.handleDateChange(e)}"
321
+ .onChange="${(value) => this.handleDateChange(value)}"
222
322
  @keydown=${(e) => this.handleKeyDown(e)}
223
323
  .setOperator="${this.handleSetOperator}"
224
324
  .operator="${this.operator}"
225
- .disabled="${this.server && ["isEmpty", "isNotEmpty"].includes(this.operator)}"
226
- .range="${["fromTo"].includes(this.operator)}"
325
+ .disabled="${this.server &&
326
+ ['isEmpty', 'isNotEmpty'].includes(this.operator)}"
327
+ .range="${['fromTo'].includes(this.operator)}"
227
328
  .filterOperators="${this.filterOperators}"
228
329
  ></lit-date-picker>
229
330
  `;
230
- }
231
- renderDateRangeInput() {
232
- return p`
331
+ }
332
+ renderDateRangeInput() {
333
+ return html `
233
334
  <div class="range">
234
335
  <lit-date-picker
235
336
  class="range-fields"
236
337
  .server="${this.server}"
237
338
  .dateFormat=${this.dateFormat}
238
339
  .userLang=${this.userLang}
239
- placeholder=${m("Od")}
240
- .onChange="${(e) => this.handleStartDateChange(e)}"
340
+ placeholder=${msg('Od')}
341
+ .onChange="${(value) => this.handleStartDateChange(value)}"
241
342
  @keydown=${(e) => this.handleKeyDown(e)}
242
343
  ></lit-date-picker>
243
344
 
@@ -246,32 +347,33 @@ let n = class extends y {
246
347
  .server="${this.server}"
247
348
  .dateFormat=${this.dateFormat}
248
349
  .userLang=${this.userLang}
249
- placeholder=${m("Do")}
250
- .onChange="${(e) => this.handleEndDateChange(e)}"
350
+ placeholder=${msg('Do')}
351
+ .onChange="${(value) => this.handleEndDateChange(value)}"
251
352
  @keydown=${(e) => this.handleKeyDown(e)}
252
353
  ></lit-date-picker>
253
354
  </div>
254
355
  `;
255
- }
256
- renderTextInput() {
257
- return p`
356
+ }
357
+ renderTextInput() {
358
+ return html `
258
359
  <lit-input
259
360
  .value="${this.value}"
260
361
  .server="${this.server}"
261
- .onInput=${(e) => this.debouncedSetTextFilter(e)}
362
+ .onInput=${(val) => this.debouncedSetTextFilter(val)}
262
363
  .onClear="${() => {
263
- this.handleClearFilter();
264
- }}"
364
+ this.handleClearFilter();
365
+ }}"
265
366
  @keydown=${(e) => this.handleKeyDown(e)}
266
367
  .setOperator="${this.handleSetOperator}"
267
368
  .operator="${this.operator}"
268
- .disabled="${this.server && ["isEmpty", "isNotEmpty"].includes(this.operator)}"
369
+ .disabled="${this.server &&
370
+ ['isEmpty', 'isNotEmpty'].includes(this.operator)}"
269
371
  .filterOperators="${this.filterOperators}"
270
372
  ></lit-input>
271
373
  `;
272
- }
374
+ }
273
375
  };
274
- n.styles = $`
376
+ FilterInputs.styles = css `
275
377
  .range {
276
378
  display: flex;
277
379
  gap: 0.3125rem;
@@ -282,45 +384,44 @@ n.styles = $`
282
384
  min-width: 70px;
283
385
  }
284
386
  `;
285
- o([
286
- h({ type: Object })
287
- ], n.prototype, "column", 2);
288
- o([
289
- h({ type: String })
290
- ], n.prototype, "dateFormat", 2);
291
- o([
292
- h({ type: String })
293
- ], n.prototype, "userLang", 2);
294
- o([
295
- h({ type: Number })
296
- ], n.prototype, "minFilterCharacters", 2);
297
- o([
298
- h({ type: Boolean })
299
- ], n.prototype, "server", 2);
300
- o([
301
- h({ type: Object })
302
- ], n.prototype, "value", 2);
303
- o([
304
- h({ type: String })
305
- ], n.prototype, "operator", 2);
306
- o([
307
- h({ type: Array })
308
- ], n.prototype, "filterOperators", 2);
309
- o([
310
- h({ type: Array })
311
- ], n.prototype, "valueOptions", 2);
312
- o([
313
- f()
314
- ], n.prototype, "startDate", 2);
315
- o([
316
- f()
317
- ], n.prototype, "endDate", 2);
318
- o([
319
- f()
320
- ], n.prototype, "filterVariant", 2);
321
- n = o([
322
- v("filter-inputs")
323
- ], n);
324
- export {
325
- n as FilterInputs
326
- };
387
+ __decorate([
388
+ property({ type: Object })
389
+ ], FilterInputs.prototype, "column", void 0);
390
+ __decorate([
391
+ property({ type: String })
392
+ ], FilterInputs.prototype, "dateFormat", void 0);
393
+ __decorate([
394
+ property({ type: String })
395
+ ], FilterInputs.prototype, "userLang", void 0);
396
+ __decorate([
397
+ property({ type: Number })
398
+ ], FilterInputs.prototype, "minFilterCharacters", void 0);
399
+ __decorate([
400
+ property({ type: Boolean })
401
+ ], FilterInputs.prototype, "server", void 0);
402
+ __decorate([
403
+ property({ type: Object })
404
+ ], FilterInputs.prototype, "value", void 0);
405
+ __decorate([
406
+ property({ type: String })
407
+ ], FilterInputs.prototype, "operator", void 0);
408
+ __decorate([
409
+ property({ type: Array })
410
+ ], FilterInputs.prototype, "filterOperators", void 0);
411
+ __decorate([
412
+ property({ type: Array })
413
+ ], FilterInputs.prototype, "valueOptions", void 0);
414
+ __decorate([
415
+ state()
416
+ ], FilterInputs.prototype, "startDate", void 0);
417
+ __decorate([
418
+ state()
419
+ ], FilterInputs.prototype, "endDate", void 0);
420
+ __decorate([
421
+ state()
422
+ ], FilterInputs.prototype, "filterVariant", void 0);
423
+ FilterInputs = __decorate([
424
+ customElement('filter-inputs')
425
+ ], FilterInputs);
426
+ export { FilterInputs };
427
+ //# sourceMappingURL=filter-inputs.js.map