arame-data-grid-pro 1.0.6 → 1.0.8

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 (102) hide show
  1. package/README.md +3 -3
  2. package/dist/advanced-filter-table/advanced-filter-data-table.element.d.ts +1 -1
  3. package/dist/advanced-filter-table/expression-engine.d.ts +2 -2
  4. package/dist/advanced-filter-table/index.cjs +5 -5
  5. package/dist/advanced-filter-table/index.cjs.map +1 -1
  6. package/dist/advanced-filter-table/index.js +165 -160
  7. package/dist/advanced-filter-table/index.js.map +1 -1
  8. package/dist/advanced-filter-table/types.d.ts +21 -14
  9. package/dist/{base-table-controller-BXMQn5v2.cjs → base-table-controller-CAWc7Hre.cjs} +2 -2
  10. package/dist/base-table-controller-CAWc7Hre.cjs.map +1 -0
  11. package/dist/{base-table-controller-DWbA88mL.js → base-table-controller-DO-etV2a.js} +3 -2
  12. package/dist/base-table-controller-DO-etV2a.js.map +1 -0
  13. package/dist/calculated-table/calculated-data-table.element.d.ts +2 -2
  14. package/dist/calculated-table/calculation-engine.d.ts +4 -4
  15. package/dist/calculated-table/index.cjs +2 -2
  16. package/dist/calculated-table/index.cjs.map +1 -1
  17. package/dist/calculated-table/index.js +2 -2
  18. package/dist/calculated-table/index.js.map +1 -1
  19. package/dist/calculated-table/types.d.ts +13 -13
  20. package/dist/column-visibility-table/column-visibility-table.element.d.ts +1 -1
  21. package/dist/column-visibility-table/index.cjs +1 -1
  22. package/dist/column-visibility-table/index.cjs.map +1 -1
  23. package/dist/column-visibility-table/index.js +1 -1
  24. package/dist/column-visibility-table/index.js.map +1 -1
  25. package/dist/column-visibility-table/types.d.ts +7 -7
  26. package/dist/common/base-table-controller.d.ts +5 -5
  27. package/dist/common/base-table-types.d.ts +7 -7
  28. package/dist/common/configurable-table-types.d.ts +1 -1
  29. package/dist/common/index.cjs +1 -1
  30. package/dist/common/index.cjs.map +1 -1
  31. package/dist/common/index.js +1 -1
  32. package/dist/common/index.js.map +1 -1
  33. package/dist/common/table-state-manager.d.ts +4 -4
  34. package/dist/common/universal-exporter.d.ts +6 -6
  35. package/dist/context-menu-table/context-menu-data-table.element.d.ts +1 -1
  36. package/dist/context-menu-table/index.cjs +1 -1
  37. package/dist/context-menu-table/index.cjs.map +1 -1
  38. package/dist/context-menu-table/index.js +1 -1
  39. package/dist/context-menu-table/index.js.map +1 -1
  40. package/dist/context-menu-table/types.d.ts +11 -11
  41. package/dist/core/data-engine.d.ts +1 -1
  42. package/dist/editable-table/editable-data-table.element.d.ts +3 -3
  43. package/dist/editable-table/index.cjs +1 -1
  44. package/dist/editable-table/index.cjs.map +1 -1
  45. package/dist/editable-table/index.js +1 -1
  46. package/dist/editable-table/index.js.map +1 -1
  47. package/dist/editable-table/types.d.ts +22 -22
  48. package/dist/expandable-table/expandable-data-table.element.d.ts +1 -1
  49. package/dist/expandable-table/index.cjs +1 -1
  50. package/dist/expandable-table/index.cjs.map +1 -1
  51. package/dist/expandable-table/index.js +40 -39
  52. package/dist/expandable-table/index.js.map +1 -1
  53. package/dist/expandable-table/types.d.ts +8 -8
  54. package/dist/filterable-table/filter-engine.d.ts +1 -1
  55. package/dist/filterable-table/filterable-data-table.element.d.ts +2 -2
  56. package/dist/filterable-table/index.cjs +1 -1
  57. package/dist/filterable-table/index.cjs.map +1 -1
  58. package/dist/filterable-table/index.js +69 -68
  59. package/dist/filterable-table/index.js.map +1 -1
  60. package/dist/filterable-table/types.d.ts +12 -12
  61. package/dist/grouped-table/group-engine.d.ts +2 -2
  62. package/dist/grouped-table/grouped-data-table.element.d.ts +1 -1
  63. package/dist/grouped-table/index.cjs +1 -1
  64. package/dist/grouped-table/index.cjs.map +1 -1
  65. package/dist/grouped-table/index.js +1 -1
  66. package/dist/grouped-table/index.js.map +1 -1
  67. package/dist/grouped-table/types.d.ts +13 -13
  68. package/dist/header-filter-table/filter-engine.d.ts +2 -2
  69. package/dist/header-filter-table/header-filter-data-table.element.d.ts +1 -1
  70. package/dist/header-filter-table/index.cjs +2 -2
  71. package/dist/header-filter-table/index.cjs.map +1 -1
  72. package/dist/header-filter-table/index.js +3 -2
  73. package/dist/header-filter-table/index.js.map +1 -1
  74. package/dist/header-filter-table/types.d.ts +10 -10
  75. package/dist/index.cjs +3 -3
  76. package/dist/index.cjs.map +1 -1
  77. package/dist/index.js +188 -187
  78. package/dist/index.js.map +1 -1
  79. package/dist/infinite-table/index.cjs +1 -1
  80. package/dist/infinite-table/index.cjs.map +1 -1
  81. package/dist/infinite-table/index.js +1 -1
  82. package/dist/infinite-table/index.js.map +1 -1
  83. package/dist/infinite-table/infinite-data-table.element.d.ts +1 -1
  84. package/dist/infinite-table/types.d.ts +11 -11
  85. package/dist/sticky-table/index.cjs +1 -1
  86. package/dist/sticky-table/index.cjs.map +1 -1
  87. package/dist/sticky-table/index.js +1 -1
  88. package/dist/sticky-table/index.js.map +1 -1
  89. package/dist/sticky-table/sticky-data-table.element.d.ts +1 -1
  90. package/dist/sticky-table/types.d.ts +7 -7
  91. package/dist/tree-table/index.cjs +4 -4
  92. package/dist/tree-table/index.cjs.map +1 -1
  93. package/dist/tree-table/index.js +96 -95
  94. package/dist/tree-table/index.js.map +1 -1
  95. package/dist/tree-table/tree-data-table.element.d.ts +1 -1
  96. package/dist/tree-table/tree-engine.d.ts +6 -6
  97. package/dist/tree-table/types.d.ts +11 -11
  98. package/dist/types.d.ts +22 -22
  99. package/dist/ui/pro-data-grid.element.d.ts +1 -1
  100. package/package.json +1 -1
  101. package/dist/base-table-controller-BXMQn5v2.cjs.map +0 -1
  102. package/dist/base-table-controller-DWbA88mL.js.map +0 -1
@@ -1,51 +1,51 @@
1
1
  var E = Object.defineProperty;
2
- var C = (o, c, e) => c in o ? E(o, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[c] = e;
3
- var d = (o, c, e) => C(o, typeof c != "symbol" ? c + "" : c, e);
4
- function _(o) {
5
- return "logic" in o && Array.isArray(o.rules);
2
+ var C = (l, c, e) => c in l ? E(l, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[c] = e;
3
+ var d = (l, c, e) => C(l, typeof c != "symbol" ? c + "" : c, e);
4
+ function _(l) {
5
+ return "logic" in l && Array.isArray(l.rules);
6
6
  }
7
- function N(o, c) {
8
- const e = /* @__PURE__ */ new Date(), t = c.getTime(), s = new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), a = new Date(e.getFullYear(), e.getMonth(), e.getDate(), 23, 59, 59, 999).getTime();
9
- switch (o) {
7
+ function N(l, c) {
8
+ const e = /* @__PURE__ */ new Date(), t = c.getTime(), i = new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime(), a = new Date(e.getFullYear(), e.getMonth(), e.getDate(), 23, 59, 59, 999).getTime();
9
+ switch (l) {
10
10
  case "today":
11
- return t >= s && t <= a;
11
+ return t >= i && t <= a;
12
12
  case "yesterday": {
13
- const r = s - 864e5, i = a - 864e5;
14
- return t >= r && t <= i;
13
+ const s = i - 864e5, r = a - 864e5;
14
+ return t >= s && t <= r;
15
15
  }
16
16
  case "last7Days": {
17
- const r = s - 6048e5;
18
- return t >= r && t <= a;
17
+ const s = i - 6048e5;
18
+ return t >= s && t <= a;
19
19
  }
20
20
  case "last30Days": {
21
- const r = s - 2592e6;
22
- return t >= r && t <= a;
21
+ const s = i - 2592e6;
22
+ return t >= s && t <= a;
23
23
  }
24
24
  case "thisMonth": {
25
- const r = new Date(e.getFullYear(), e.getMonth(), 1).getTime(), i = new Date(e.getFullYear(), e.getMonth() + 1, 0, 23, 59, 59, 999).getTime();
26
- return t >= r && t <= i;
25
+ const s = new Date(e.getFullYear(), e.getMonth(), 1).getTime(), r = new Date(e.getFullYear(), e.getMonth() + 1, 0, 23, 59, 59, 999).getTime();
26
+ return t >= s && t <= r;
27
27
  }
28
28
  case "lastMonth": {
29
- const r = new Date(e.getFullYear(), e.getMonth() - 1, 1).getTime(), i = new Date(e.getFullYear(), e.getMonth(), 0, 23, 59, 59, 999).getTime();
30
- return t >= r && t <= i;
29
+ const s = new Date(e.getFullYear(), e.getMonth() - 1, 1).getTime(), r = new Date(e.getFullYear(), e.getMonth(), 0, 23, 59, 59, 999).getTime();
30
+ return t >= s && t <= r;
31
31
  }
32
32
  case "thisYear": {
33
- const r = new Date(e.getFullYear(), 0, 1).getTime(), i = new Date(e.getFullYear(), 11, 31, 23, 59, 59, 999).getTime();
34
- return t >= r && t <= i;
33
+ const s = new Date(e.getFullYear(), 0, 1).getTime(), r = new Date(e.getFullYear(), 11, 31, 23, 59, 59, 999).getTime();
34
+ return t >= s && t <= r;
35
35
  }
36
36
  default:
37
37
  return !0;
38
38
  }
39
39
  }
40
- function w(o, c, e) {
41
- const t = o[c.field];
40
+ function w(l, c, e) {
41
+ const t = l[c.field];
42
42
  if (c.operator === "custom" && c.customOperatorName && e) {
43
- const r = e.find((i) => i.name === c.customOperatorName);
44
- if (r)
45
- return r.predicate(t, c.value, o);
43
+ const s = e.find((r) => r.name === c.customOperatorName);
44
+ if (s)
45
+ return s.predicate(t, c.value, l);
46
46
  }
47
- const { operator: s, value: a } = c;
48
- switch (s) {
47
+ const { operator: i, value: a } = c;
48
+ switch (i) {
49
49
  case "equals":
50
50
  return String(t).toLowerCase() === String(a).toLowerCase();
51
51
  case "notEquals":
@@ -59,88 +59,89 @@ function w(o, c, e) {
59
59
  case "endsWith":
60
60
  return String(t).toLowerCase().endsWith(String(a).toLowerCase().trim());
61
61
  case "greaterThan": {
62
- const r = Number(t), i = Number(a);
63
- return isNaN(r) || isNaN(i) ? !1 : r > i;
62
+ const s = Number(t), r = Number(a);
63
+ return isNaN(s) || isNaN(r) ? !1 : s > r;
64
64
  }
65
65
  case "greaterThanOrEqual": {
66
- const r = Number(t), i = Number(a);
67
- return isNaN(r) || isNaN(i) ? !1 : r >= i;
66
+ const s = Number(t), r = Number(a);
67
+ return isNaN(s) || isNaN(r) ? !1 : s >= r;
68
68
  }
69
69
  case "lessThan": {
70
- const r = Number(t), i = Number(a);
71
- return isNaN(r) || isNaN(i) ? !1 : r < i;
70
+ const s = Number(t), r = Number(a);
71
+ return isNaN(s) || isNaN(r) ? !1 : s < r;
72
72
  }
73
73
  case "lessThanOrEqual": {
74
- const r = Number(t), i = Number(a);
75
- return isNaN(r) || isNaN(i) ? !1 : r <= i;
74
+ const s = Number(t), r = Number(a);
75
+ return isNaN(s) || isNaN(r) ? !1 : s <= r;
76
76
  }
77
77
  case "between": {
78
- const r = Number(t);
79
- if (isNaN(r)) return !1;
80
- const i = Number(a == null ? void 0 : a.min), n = Number(a == null ? void 0 : a.max);
81
- return !(!isNaN(i) && r < i || !isNaN(n) && r > n);
78
+ const s = Number(t);
79
+ if (isNaN(s)) return !1;
80
+ const r = Number(a == null ? void 0 : a.min), n = Number(a == null ? void 0 : a.max);
81
+ return !(!isNaN(r) && s < r || !isNaN(n) && s > n);
82
82
  }
83
83
  case "in":
84
- return (Array.isArray(a) ? a : [a]).some((i) => String(i).toLowerCase() === String(t).toLowerCase());
84
+ return (Array.isArray(a) ? a : [a]).some((r) => String(r).toLowerCase() === String(t).toLowerCase());
85
85
  case "notIn":
86
- return !(Array.isArray(a) ? a : [a]).some((i) => String(i).toLowerCase() === String(t).toLowerCase());
86
+ return !(Array.isArray(a) ? a : [a]).some((r) => String(r).toLowerCase() === String(t).toLowerCase());
87
87
  case "dateBefore": {
88
88
  if (!t || !a) return !1;
89
- const r = new Date(t).getTime(), i = new Date(a).getTime();
90
- return !isNaN(r) && !isNaN(i) && r < i;
89
+ const s = new Date(t).getTime(), r = new Date(a).getTime();
90
+ return !isNaN(s) && !isNaN(r) && s < r;
91
91
  }
92
92
  case "dateAfter": {
93
93
  if (!t || !a) return !1;
94
- const r = new Date(t).getTime(), i = new Date(a).getTime();
95
- return !isNaN(r) && !isNaN(i) && r > i;
94
+ const s = new Date(t).getTime(), r = new Date(a).getTime();
95
+ return !isNaN(s) && !isNaN(r) && s > r;
96
96
  }
97
97
  case "dateOn": {
98
98
  if (!t || !a) return !1;
99
- const r = new Date(t), i = new Date(a);
100
- return r.toISOString().split("T")[0] === i.toISOString().split("T")[0];
99
+ const s = new Date(t), r = new Date(a);
100
+ return s.toISOString().split("T")[0] === r.toISOString().split("T")[0];
101
101
  }
102
102
  case "dateBetween": {
103
103
  if (!t || !a) return !1;
104
- const r = new Date(t).getTime();
105
- if (isNaN(r)) return !1;
106
- if (a.start) {
107
- const i = new Date(a.start).getTime();
108
- if (r < i) return !1;
104
+ const s = new Date(t).getTime();
105
+ if (isNaN(s)) return !1;
106
+ const r = a;
107
+ if (r != null && r.start) {
108
+ const n = new Date(r.start).getTime();
109
+ if (s < n) return !1;
109
110
  }
110
- if (a.end) {
111
- const i = new Date(a.end).setHours(23, 59, 59, 999);
112
- if (r > i) return !1;
111
+ if (r != null && r.end) {
112
+ const n = new Date(r.end).setHours(23, 59, 59, 999);
113
+ if (s > n) return !1;
113
114
  }
114
115
  return !0;
115
116
  }
116
117
  case "dateRelative": {
117
118
  if (!t || !a) return !1;
118
- const r = new Date(t);
119
- return isNaN(r.getTime()) ? !1 : N(a, r);
119
+ const s = new Date(t);
120
+ return isNaN(s.getTime()) ? !1 : N(a, s);
120
121
  }
121
122
  default:
122
123
  return !0;
123
124
  }
124
125
  }
125
- function y(o, c, e) {
126
- return !c || !c.rules || c.rules.length === 0 ? !0 : c.logic === "AND" ? c.rules.every((t) => _(t) ? y(o, t, e) : w(o, t, e)) : c.rules.some((t) => _(t) ? y(o, t, e) : w(o, t, e));
126
+ function y(l, c, e) {
127
+ return !c || !c.rules || c.rules.length === 0 ? !0 : c.logic === "AND" ? c.rules.every((t) => _(t) ? y(l, t, e) : w(l, t, e)) : c.rules.some((t) => _(t) ? y(l, t, e) : w(l, t, e));
127
128
  }
128
- function v(o) {
129
+ function v(l) {
129
130
  const c = [];
130
- if (!o || !o.rules) return c;
131
- for (const e of o.rules)
131
+ if (!l || !l.rules) return c;
132
+ for (const e of l.rules)
132
133
  _(e) ? c.push(...v(e)) : c.push(e);
133
134
  return c;
134
135
  }
135
- function L(o) {
136
+ function L(l) {
136
137
  try {
137
- return JSON.stringify(o);
138
+ return JSON.stringify(l);
138
139
  } catch {
139
140
  return "";
140
141
  }
141
142
  }
142
- function S(o, c) {
143
- const e = c.find((i) => String(i.key) === o.field), t = e ? e.header : o.field, a = {
143
+ function S(l, c) {
144
+ const e = c.find((r) => String(r.key) === l.field), t = e ? e.header : l.field, a = {
144
145
  equals: "=",
145
146
  notEquals: "≠",
146
147
  contains: "contains",
@@ -159,9 +160,13 @@ function S(o, c) {
159
160
  dateOn: "on",
160
161
  dateBetween: "between",
161
162
  dateRelative: "is"
162
- }[o.operator] || o.operator;
163
- let r = String(o.value);
164
- return typeof o.value == "object" && o.value !== null && (o.value.min !== void 0 || o.value.max !== void 0 ? r = `${o.value.min ?? 0} .. ${o.value.max ?? "∞"}` : o.value.start || o.value.end ? r = `${o.value.start ?? ""} .. ${o.value.end ?? ""}` : r = JSON.stringify(o.value)), `${t} ${a} ${r}`;
163
+ }[l.operator] || l.operator;
164
+ let s = String(l.value);
165
+ if (typeof l.value == "object" && l.value !== null) {
166
+ const r = l.value;
167
+ r && (r.min !== void 0 || r.max !== void 0) ? s = `${r.min ?? 0} .. ${r.max ?? "∞"}` : r && (r.start || r.end) ? s = `${r.start ?? ""} .. ${r.end ?? ""}` : s = JSON.stringify(l.value);
168
+ }
169
+ return `${t} ${a} ${s}`;
165
170
  }
166
171
  class k extends HTMLElement {
167
172
  constructor() {
@@ -221,16 +226,16 @@ class k extends HTMLElement {
221
226
  this.loadPersistedPresets(), this.renderDomStructure(), this.setupEventListeners(), this._options.dataLoader ? this.fetchServerData() : this.refresh();
222
227
  }
223
228
  disconnectedCallback() {
224
- this._abortController && this._abortController.abort(), this._searchDebounceTimer && clearTimeout(this._searchDebounceTimer);
229
+ this._abortController && this._abortController.abort(), this._searchDebounceTimer && this._searchDebounceTimer && clearTimeout(this._searchDebounceTimer);
225
230
  }
226
- attributeChangedCallback(e, t, s) {
227
- if (e === "search-term" && s !== null)
228
- this.setSearchTerm(s);
229
- else if (e === "page" && s !== null) {
230
- const a = parseInt(s, 10);
231
+ attributeChangedCallback(e, t, i) {
232
+ if (e === "search-term" && i !== null)
233
+ this.setSearchTerm(i);
234
+ else if (e === "page" && i !== null) {
235
+ const a = parseInt(i, 10);
231
236
  !isNaN(a) && a > 0 && this.setPage(a);
232
- } else if (e === "page-size" && s !== null) {
233
- const a = parseInt(s, 10);
237
+ } else if (e === "page-size" && i !== null) {
238
+ const a = parseInt(i, 10);
234
239
  !isNaN(a) && a > 0 && this.setPageSize(a);
235
240
  }
236
241
  }
@@ -251,14 +256,14 @@ class k extends HTMLElement {
251
256
  return this._options;
252
257
  }
253
258
  set options(e) {
254
- var t, s;
259
+ var t, i;
255
260
  this._options = {
256
261
  ...this._options,
257
262
  ...e,
258
263
  pagination: { ...this._options.pagination, ...e.pagination },
259
264
  sorting: { ...this._options.sorting, ...e.sorting },
260
265
  search: { ...this._options.search, ...e.search }
261
- }, e.presets && (this._presets = [...e.presets]), (t = e.pagination) != null && t.pageSize && (this._pageSize = e.pagination.pageSize), ((s = e.sorting) == null ? void 0 : s.initialSort) !== void 0 && (this._sortRule = e.sorting.initialSort), this.isConnected && (this.renderHeader(), this.renderPresetsSelect(), this.renderQuickFilters(), this._options.dataLoader && e.dataLoader ? this.fetchServerData() : this.refresh());
266
+ }, e.presets && (this._presets = [...e.presets]), (t = e.pagination) != null && t.pageSize && (this._pageSize = e.pagination.pageSize), ((i = e.sorting) == null ? void 0 : i.initialSort) !== void 0 && (this._sortRule = e.sorting.initialSort), this.isConnected && (this.renderHeader(), this.renderPresetsSelect(), this.renderQuickFilters(), this._options.dataLoader && e.dataLoader ? this.fetchServerData() : this.refresh());
262
267
  }
263
268
  get expression() {
264
269
  return this._activeExpression;
@@ -271,8 +276,8 @@ class k extends HTMLElement {
271
276
  this._activeExpression.rules.push(e), this._currentPage = 1, this.onExpressionChanged();
272
277
  }
273
278
  removeRule(e) {
274
- function t(s) {
275
- s.rules = s.rules.filter((a) => "logic" in a ? (t(a), a.rules.length > 0) : a.id !== e);
279
+ function t(i) {
280
+ i.rules = i.rules.filter((a) => "logic" in a ? (t(a), a.rules.length > 0) : a.id !== e);
276
281
  }
277
282
  t(this._activeExpression), this._currentPage = 1, this.onExpressionChanged();
278
283
  }
@@ -287,23 +292,23 @@ class k extends HTMLElement {
287
292
  id: a.id,
288
293
  label: S(a, this._columns),
289
294
  rule: a
290
- })), s = {
295
+ })), i = {
291
296
  expression: this._activeExpression,
292
297
  flatRules: e,
293
298
  activeChips: t
294
299
  };
295
- this.dispatchEvent(new CustomEvent("advanced-filter:expression-change", { detail: s, bubbles: !0, composed: !0 })), this.renderActiveChips(), this.renderBuilderDrawer(), this._options.dataLoader ? this.fetchServerData() : this.refresh();
300
+ this.dispatchEvent(new CustomEvent("advanced-filter:expression-change", { detail: i, bubbles: !0, composed: !0 })), this.renderActiveChips(), this.renderBuilderDrawer(), this._options.dataLoader ? this.fetchServerData() : this.refresh();
296
301
  }
297
302
  // --- Presets Persistence & Management ---
298
303
  applyPreset(e) {
299
304
  const t = this._presets.find((a) => a.id === e);
300
305
  if (!t) return;
301
306
  this._activePresetId = e, this._activeExpression = JSON.parse(JSON.stringify(t.expression)), t.searchTerm !== void 0 && this.setSearchTerm(t.searchTerm), this._currentPage = 1, this._presetSelect && (this._presetSelect.value = e);
302
- const s = {
307
+ const i = {
303
308
  preset: t,
304
309
  expression: this._activeExpression
305
310
  };
306
- this.dispatchEvent(new CustomEvent("advanced-filter:preset-change", { detail: s, bubbles: !0, composed: !0 })), this.onExpressionChanged();
311
+ this.dispatchEvent(new CustomEvent("advanced-filter:preset-change", { detail: i, bubbles: !0, composed: !0 })), this.onExpressionChanged();
307
312
  }
308
313
  saveCurrentAsPreset(e) {
309
314
  const t = {
@@ -322,7 +327,7 @@ class k extends HTMLElement {
322
327
  const e = this._options.persistPresetsKey;
323
328
  if (!(!e || typeof localStorage > "u"))
324
329
  try {
325
- const t = this._presets.filter((s) => s.isRemovable);
330
+ const t = this._presets.filter((i) => i.isRemovable);
326
331
  localStorage.setItem(e, JSON.stringify(t));
327
332
  } catch (t) {
328
333
  console.warn("[advanced-filter-table] Failed to persist presets:", t);
@@ -334,8 +339,8 @@ class k extends HTMLElement {
334
339
  try {
335
340
  const t = localStorage.getItem(e);
336
341
  if (t) {
337
- const s = JSON.parse(t);
338
- Array.isArray(s) && (this._presets = [...this._options.presets || [], ...s]);
342
+ const i = JSON.parse(t);
343
+ Array.isArray(i) && (this._presets = [...this._options.presets || [], ...i]);
339
344
  }
340
345
  } catch (t) {
341
346
  console.warn("[advanced-filter-table] Failed to load presets:", t);
@@ -349,8 +354,8 @@ class k extends HTMLElement {
349
354
  this._sortRule = e, this.renderHeader(), this._options.dataLoader ? this.fetchServerData() : this.refresh();
350
355
  }
351
356
  setPage(e) {
352
- const t = Math.max(1, Math.ceil(this._totalRows / this._pageSize)), s = Math.max(1, Math.min(e, t));
353
- this._currentPage !== s && (this._currentPage = s, this._options.dataLoader ? this.fetchServerData() : this.refresh());
357
+ const t = Math.max(1, Math.ceil(this._totalRows / this._pageSize)), i = Math.max(1, Math.min(e, t));
358
+ this._currentPage !== i && (this._currentPage = i, this._options.dataLoader ? this.fetchServerData() : this.refresh());
354
359
  }
355
360
  setPageSize(e) {
356
361
  this._pageSize !== e && (this._pageSize = e, this._currentPage = 1, this._options.dataLoader ? this.fetchServerData() : this.refresh());
@@ -362,7 +367,7 @@ class k extends HTMLElement {
362
367
  const e = this._abortController.signal, t = ++this._requestId;
363
368
  this.setLoading(!0);
364
369
  try {
365
- const s = await this._options.dataLoader({
370
+ const i = await this._options.dataLoader({
366
371
  page: this._currentPage,
367
372
  pageSize: this._pageSize,
368
373
  searchTerm: this._searchTerm,
@@ -372,10 +377,10 @@ class k extends HTMLElement {
372
377
  signal: e
373
378
  });
374
379
  if (t !== this._requestId || e.aborted) return;
375
- this._allRows = s.rows || [], this._totalRows = s.totalRows || 0, this.renderBodyRows(), this.renderPaginationBar(), this.updateMetaInfo();
376
- } catch (s) {
380
+ this._allRows = i.rows || [], this._totalRows = i.totalRows || 0, this.renderBodyRows(), this.renderPaginationBar(), this.updateMetaInfo();
381
+ } catch (i) {
377
382
  if (e.aborted || t !== this._requestId) return;
378
- console.error("[advanced-filter-table] Error fetching data:", s);
383
+ console.error("[advanced-filter-table] Error fetching data:", i);
379
384
  } finally {
380
385
  t === this._requestId && this.setLoading(!1);
381
386
  }
@@ -431,12 +436,12 @@ class k extends HTMLElement {
431
436
  setupEventListeners() {
432
437
  const e = this._options.debounceMs ?? 300;
433
438
  this._searchInput.addEventListener("input", (t) => {
434
- clearTimeout(this._searchDebounceTimer), this._searchDebounceTimer = setTimeout(() => {
439
+ this._searchDebounceTimer && clearTimeout(this._searchDebounceTimer), this._searchDebounceTimer = setTimeout(() => {
435
440
  this.setSearchTerm(t.target.value.trim());
436
441
  }, e);
437
442
  }), this._presetSelect.addEventListener("change", (t) => {
438
- const s = t.target.value;
439
- s && this.applyPreset(s);
443
+ const i = t.target.value;
444
+ i && this.applyPreset(i);
440
445
  }), this._toggleBuilderBtn.addEventListener("click", () => {
441
446
  this._isBuilderOpen = !this._isBuilderOpen, this._builderDrawer.style.display = this._isBuilderOpen ? "flex" : "none", this._isBuilderOpen && this.renderBuilderDrawer();
442
447
  });
@@ -454,10 +459,10 @@ class k extends HTMLElement {
454
459
  return;
455
460
  }
456
461
  this._quickBar.style.display = "flex", this._quickBar.innerHTML = "", e.forEach((t) => {
457
- const s = document.createElement("button");
458
- s.className = "aft-quick-filter-pill", s.textContent = t.label, s.addEventListener("click", () => {
462
+ const i = document.createElement("button");
463
+ i.className = "aft-quick-filter-pill", i.textContent = t.label, i.addEventListener("click", () => {
459
464
  this.expression = JSON.parse(JSON.stringify(t.expression));
460
- }), this._quickBar.appendChild(s);
465
+ }), this._quickBar.appendChild(i);
461
466
  });
462
467
  }
463
468
  renderActiveChips() {
@@ -466,15 +471,15 @@ class k extends HTMLElement {
466
471
  this._chipsBar.style.display = "none";
467
472
  return;
468
473
  }
469
- this._chipsBar.style.display = "flex", this._chipsBar.innerHTML = "", e.forEach((s) => {
474
+ this._chipsBar.style.display = "flex", this._chipsBar.innerHTML = "", e.forEach((i) => {
470
475
  const a = document.createElement("span");
471
476
  a.className = "aft-chip";
472
- const r = document.createElement("span");
473
- r.textContent = S(s, this._columns), a.appendChild(r);
474
- const i = document.createElement("button");
475
- i.className = "aft-chip-remove", i.innerHTML = "&times;", i.title = "Remove filter", i.addEventListener("click", () => {
476
- this.removeRule(s.id);
477
- }), a.appendChild(i), this._chipsBar.appendChild(a);
477
+ const s = document.createElement("span");
478
+ s.textContent = S(i, this._columns), a.appendChild(s);
479
+ const r = document.createElement("button");
480
+ r.className = "aft-chip-remove", r.innerHTML = "&times;", r.title = "Remove filter", r.addEventListener("click", () => {
481
+ this.removeRule(i.id);
482
+ }), a.appendChild(r), this._chipsBar.appendChild(a);
478
483
  });
479
484
  const t = document.createElement("button");
480
485
  t.className = "aft-btn-clear-chips", t.textContent = "Clear all", t.addEventListener("click", () => {
@@ -482,7 +487,7 @@ class k extends HTMLElement {
482
487
  }), this._chipsBar.appendChild(t);
483
488
  }
484
489
  renderBuilderDrawer() {
485
- var a, r, i;
490
+ var a, s, r;
486
491
  if (!this._isBuilderOpen) return;
487
492
  this._builderDrawer.innerHTML = "";
488
493
  const e = document.createElement("div");
@@ -497,9 +502,9 @@ class k extends HTMLElement {
497
502
  <div>
498
503
  <button class="aft-btn aft-btn-add-rule">+ Add Rule</button>
499
504
  </div>
500
- `, (a = e.querySelector("#btn-logic-and")) == null || a.addEventListener("click", () => this.setLogic("AND")), (r = e.querySelector("#btn-logic-or")) == null || r.addEventListener("click", () => this.setLogic("OR")), (i = e.querySelector(".aft-btn-add-rule")) == null || i.addEventListener("click", () => {
501
- var l;
502
- const n = ((l = this._columns[0]) == null ? void 0 : l.key) || "id";
505
+ `, (a = e.querySelector("#btn-logic-and")) == null || a.addEventListener("click", () => this.setLogic("AND")), (s = e.querySelector("#btn-logic-or")) == null || s.addEventListener("click", () => this.setLogic("OR")), (r = e.querySelector(".aft-btn-add-rule")) == null || r.addEventListener("click", () => {
506
+ var o;
507
+ const n = ((o = this._columns[0]) == null ? void 0 : o.key) || "id";
503
508
  this.addRule({
504
509
  id: `rule-${Date.now()}`,
505
510
  field: n,
@@ -509,8 +514,8 @@ class k extends HTMLElement {
509
514
  }), this._builderDrawer.appendChild(e);
510
515
  const t = document.createElement("div");
511
516
  t.style.display = "flex", t.style.flexDirection = "column", t.style.gap = "0.5rem", v(this._activeExpression).forEach((n) => {
512
- const l = document.createElement("div");
513
- l.className = "aft-rule-row";
517
+ const o = document.createElement("div");
518
+ o.className = "aft-rule-row";
514
519
  const h = document.createElement("select");
515
520
  h.className = "aft-rule-select", this._columns.forEach((p) => {
516
521
  const m = document.createElement("option");
@@ -528,7 +533,7 @@ class k extends HTMLElement {
528
533
  n.field = p.target.value, this.onExpressionChanged();
529
534
  }), f.addEventListener("change", (p) => {
530
535
  n.operator = p.target.value, this.onExpressionChanged();
531
- }), l.appendChild(h), l.appendChild(f), l.appendChild(x), l.appendChild(b), t.appendChild(l);
536
+ }), o.appendChild(h), o.appendChild(f), o.appendChild(x), o.appendChild(b), t.appendChild(o);
532
537
  }), this._builderDrawer.appendChild(t);
533
538
  }
534
539
  getOperatorsForColumn(e) {
@@ -558,16 +563,16 @@ class k extends HTMLElement {
558
563
  { value: "endsWith", label: "Ends With" }
559
564
  ];
560
565
  }
561
- renderRuleValueControl(e, t, s) {
562
- var r, i;
566
+ renderRuleValueControl(e, t, i) {
567
+ var s, r;
563
568
  if (t != null && t.cascading) {
564
- const n = v(this._activeExpression), l = n.find((f) => f.field === t.cascading.parentField), h = t.cascading.getOptions(l == null ? void 0 : l.value, n), u = document.createElement("select");
569
+ const n = v(this._activeExpression), o = n.find((f) => f.field === t.cascading.parentField), h = t.cascading.getOptions(o == null ? void 0 : o.value, n), u = document.createElement("select");
565
570
  u.className = "aft-rule-select", h.forEach((f) => {
566
571
  const g = document.createElement("option");
567
572
  g.value = String(f.value), g.textContent = f.label, String(f.value) === String(e.value) && (g.selected = !0), u.appendChild(g);
568
573
  }), u.addEventListener("change", (f) => {
569
574
  e.value = f.target.value, this.onExpressionChanged();
570
- }), s.appendChild(u);
575
+ }), i.appendChild(u);
571
576
  return;
572
577
  }
573
578
  if (e.operator === "dateRelative") {
@@ -577,68 +582,68 @@ class k extends HTMLElement {
577
582
  u.value = h, u.textContent = h, h === e.value && (u.selected = !0), n.appendChild(u);
578
583
  }), n.addEventListener("change", (h) => {
579
584
  e.value = h.target.value, this.onExpressionChanged();
580
- }), s.appendChild(n);
585
+ }), i.appendChild(n);
581
586
  return;
582
587
  }
583
588
  if (e.operator === "between") {
584
589
  const n = document.createElement("input");
585
- n.type = "number", n.className = "aft-rule-input", n.placeholder = "Min", n.style.width = "75px", n.value = ((r = e.value) == null ? void 0 : r.min) ?? "";
586
- const l = document.createElement("input");
587
- l.type = "number", l.className = "aft-rule-input", l.placeholder = "Max", l.style.width = "75px", l.value = ((i = e.value) == null ? void 0 : i.max) ?? "";
590
+ n.type = "number", n.className = "aft-rule-input", n.placeholder = "Min", n.style.width = "75px", n.value = ((s = e.value) == null ? void 0 : s.min) ?? "";
591
+ const o = document.createElement("input");
592
+ o.type = "number", o.className = "aft-rule-input", o.placeholder = "Max", o.style.width = "75px", o.value = ((r = e.value) == null ? void 0 : r.max) ?? "";
588
593
  const h = () => {
589
- e.value = { min: n.value, max: l.value }, this.onExpressionChanged();
594
+ e.value = { min: n.value, max: o.value }, this.onExpressionChanged();
590
595
  };
591
- n.addEventListener("change", h), l.addEventListener("change", h), s.appendChild(n), s.appendChild(document.createTextNode(" .. ")), s.appendChild(l);
596
+ n.addEventListener("change", h), o.addEventListener("change", h), i.appendChild(n), i.appendChild(document.createTextNode(" .. ")), i.appendChild(o);
592
597
  return;
593
598
  }
594
599
  const a = document.createElement("input");
595
600
  a.type = (t == null ? void 0 : t.type) === "date" ? "date" : (t == null ? void 0 : t.type) === "number" ? "number" : "text", a.className = "aft-rule-input", a.value = e.value !== void 0 ? String(e.value) : "", a.addEventListener("change", (n) => {
596
601
  e.value = n.target.value, this.onExpressionChanged();
597
- }), s.appendChild(a);
602
+ }), i.appendChild(a);
598
603
  }
599
604
  renderHeader() {
600
605
  const e = this._thead.querySelector(".aft-header-tr");
601
606
  e && (e.innerHTML = "", this._columns.forEach((t) => {
602
- var i, n;
603
- const s = document.createElement("th");
604
- s.className = "aft-th", t.width && (s.style.width = t.width), t.minWidth && (s.style.minWidth = t.minWidth), t.align && (s.style.textAlign = t.align);
607
+ var r, n;
608
+ const i = document.createElement("th");
609
+ i.className = "aft-th", t.width && (i.style.width = t.width), t.minWidth && (i.style.minWidth = t.minWidth), t.align && (i.style.textAlign = t.align);
605
610
  const a = document.createElement("div");
606
611
  a.className = "aft-th-inner";
607
- const r = document.createElement("span");
608
- if (r.textContent = t.header, a.appendChild(r), t.sortable !== !1 && ((i = this._options.sorting) == null ? void 0 : i.enabled) !== !1) {
609
- const l = document.createElement("span");
610
- l.className = "aft-sort-icon", ((n = this._sortRule) == null ? void 0 : n.column) === t.key ? l.textContent = this._sortRule.direction === "asc" ? "▲" : "▼" : (l.textContent = "↕", l.style.opacity = "0.35"), a.appendChild(l), s.addEventListener("click", () => {
612
+ const s = document.createElement("span");
613
+ if (s.textContent = t.header, a.appendChild(s), t.sortable !== !1 && ((r = this._options.sorting) == null ? void 0 : r.enabled) !== !1) {
614
+ const o = document.createElement("span");
615
+ o.className = "aft-sort-icon", ((n = this._sortRule) == null ? void 0 : n.column) === t.key ? o.textContent = this._sortRule.direction === "asc" ? "▲" : "▼" : (o.textContent = "↕", o.style.opacity = "0.35"), a.appendChild(o), i.addEventListener("click", () => {
611
616
  var u;
612
617
  let h = "asc";
613
618
  ((u = this._sortRule) == null ? void 0 : u.column) === t.key && (h = this._sortRule.direction === "asc" ? "desc" : "asc"), this.setSortRule({ column: t.key, direction: h });
614
619
  });
615
620
  }
616
- s.appendChild(a), e.appendChild(s);
621
+ i.appendChild(a), e.appendChild(i);
617
622
  }));
618
623
  }
619
624
  getDisplayRows() {
620
- var t, s, a;
625
+ var t, i, a;
621
626
  if (this._options.dataLoader)
622
627
  return this._allRows;
623
628
  let e = [...this._allRows];
624
629
  if (this._searchTerm && ((t = this._options.search) == null ? void 0 : t.enabled) !== !1) {
625
- const r = this._searchTerm.toLowerCase();
626
- e = e.filter((i) => Object.values(i).some((n) => n != null && String(n).toLowerCase().includes(r)));
630
+ const s = this._searchTerm.toLowerCase();
631
+ e = e.filter((r) => Object.values(r).some((n) => n != null && String(n).toLowerCase().includes(s)));
627
632
  }
628
- if (e = e.filter((r) => y(r, this._activeExpression, this._options.customOperators)), this._sortRule && ((s = this._options.sorting) == null ? void 0 : s.enabled) !== !1) {
629
- const { column: r, direction: i } = this._sortRule;
630
- e.sort((n, l) => {
631
- const h = n[r], u = l[r];
633
+ if (e = e.filter((s) => y(s, this._activeExpression, this._options.customOperators)), this._sortRule && ((i = this._options.sorting) == null ? void 0 : i.enabled) !== !1) {
634
+ const { column: s, direction: r } = this._sortRule;
635
+ e.sort((n, o) => {
636
+ const h = n[s], u = o[s];
632
637
  if (h === u) return 0;
633
638
  if (h == null) return 1;
634
639
  if (u == null) return -1;
635
640
  const f = h > u ? 1 : -1;
636
- return i === "asc" ? f : -f;
641
+ return r === "asc" ? f : -f;
637
642
  });
638
643
  }
639
644
  if (this._totalRows = e.length, ((a = this._options.pagination) == null ? void 0 : a.enabled) !== !1) {
640
- const r = (this._currentPage - 1) * this._pageSize;
641
- return e.slice(r, r + this._pageSize);
645
+ const s = (this._currentPage - 1) * this._pageSize;
646
+ return e.slice(s, s + this._pageSize);
642
647
  }
643
648
  return e;
644
649
  }
@@ -649,30 +654,30 @@ class k extends HTMLElement {
649
654
  this._tbody.innerHTML = "";
650
655
  const e = this.getDisplayRows();
651
656
  if (e.length === 0) {
652
- const s = document.createElement("tr");
653
- s.className = "aft-tr";
657
+ const i = document.createElement("tr");
658
+ i.className = "aft-tr";
654
659
  const a = document.createElement("td");
655
- a.className = "aft-td", a.colSpan = this._columns.length || 1, a.style.textAlign = "center", a.style.padding = "2.5rem 1rem", a.style.color = "var(--aft-text-muted)", a.textContent = "No matching records found", s.appendChild(a), this._tbody.appendChild(s);
660
+ a.className = "aft-td", a.colSpan = this._columns.length || 1, a.style.textAlign = "center", a.style.padding = "2.5rem 1rem", a.style.color = "var(--aft-text-muted)", a.textContent = "No matching records found", i.appendChild(a), this._tbody.appendChild(i);
656
661
  return;
657
662
  }
658
663
  const t = document.createDocumentFragment();
659
- e.forEach((s, a) => {
660
- const r = document.createElement("tr");
661
- r.className = `aft-tr ${a % 2 === 1 ? "alt" : ""}`, this._columns.forEach((i) => {
664
+ e.forEach((i, a) => {
665
+ const s = document.createElement("tr");
666
+ s.className = `aft-tr ${a % 2 === 1 ? "alt" : ""}`, this._columns.forEach((r) => {
662
667
  const n = document.createElement("td");
663
- n.className = "aft-td", i.align && (n.style.textAlign = i.align);
664
- const l = s[i.key];
665
- if (i.render) {
666
- const h = i.render(l, s, a);
668
+ n.className = "aft-td", r.align && (n.style.textAlign = r.align);
669
+ const o = i[r.key];
670
+ if (r.render) {
671
+ const h = r.render(o, i, a);
667
672
  h instanceof HTMLElement ? n.appendChild(h) : n.innerHTML = String(h ?? "");
668
673
  } else
669
- n.textContent = l != null ? String(l) : "—";
670
- r.appendChild(n);
671
- }), t.appendChild(r);
674
+ n.textContent = o != null ? String(o) : "—";
675
+ s.appendChild(n);
676
+ }), t.appendChild(s);
672
677
  }), this._tbody.appendChild(t);
673
678
  }
674
679
  renderPaginationBar() {
675
- var n, l, h, u, f;
680
+ var n, o, h, u, f;
676
681
  if (((n = this._options.pagination) == null ? void 0 : n.enabled) === !1) {
677
682
  this._paginationBar.style.display = "none";
678
683
  return;
@@ -680,14 +685,14 @@ class k extends HTMLElement {
680
685
  this._paginationBar.style.display = "flex";
681
686
  const e = this._totalRows, t = Math.max(1, Math.ceil(e / this._pageSize));
682
687
  this._currentPage > t && (this._currentPage = t);
683
- const s = e === 0 ? 0 : (this._currentPage - 1) * this._pageSize + 1, a = Math.min(this._currentPage * this._pageSize, e), i = (((l = this._options.pagination) == null ? void 0 : l.pageSizeOptions) || [5, 10, 25, 50]).map((g) => `<option value="${g}" ${g === this._pageSize ? "selected" : ""}>${g} / page</option>`).join("");
688
+ const i = e === 0 ? 0 : (this._currentPage - 1) * this._pageSize + 1, a = Math.min(this._currentPage * this._pageSize, e), r = (((o = this._options.pagination) == null ? void 0 : o.pageSizeOptions) || [5, 10, 25, 50]).map((g) => `<option value="${g}" ${g === this._pageSize ? "selected" : ""}>${g} / page</option>`).join("");
684
689
  this._paginationBar.innerHTML = `
685
690
  <div class="aft-pagination-info">
686
- Showing <strong>${s}</strong> to <strong>${a}</strong> of <strong>${e}</strong> entries
691
+ Showing <strong>${i}</strong> to <strong>${a}</strong> of <strong>${e}</strong> entries
687
692
  </div>
688
693
  <div class="aft-pagination-controls">
689
694
  <select class="aft-pagination-size-select" aria-label="Page size">
690
- ${i}
695
+ ${r}
691
696
  </select>
692
697
  <div style="display:flex;align-items:center;gap:0.25rem;">
693
698
  <button class="aft-page-btn prev-btn" ${this._currentPage <= 1 ? "disabled" : ""}>Previous</button>