@toolbox-web/grid 1.14.0 → 1.14.1

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.
@@ -1,19 +1,19 @@
1
- function Y(N) {
2
- const { totalRows: e, viewportHeight: t, scrollTop: r, rowHeight: i, overscan: l } = N, c = Math.ceil(t / i);
3
- let d = Math.floor(r / i) - l;
4
- d < 0 && (d = 0);
5
- let a = d + c + l * 2;
6
- return a > e && (a = e), a === e && d > 0 && (d = Math.max(0, a - c - l * 2)), {
7
- start: d,
8
- end: a,
9
- offsetY: d * i,
10
- totalHeight: e * i
1
+ function G(x) {
2
+ const { totalRows: e, viewportHeight: t, scrollTop: r, rowHeight: n, overscan: a } = x, s = Math.ceil(t / n);
3
+ let u = Math.floor(r / n) - a;
4
+ u < 0 && (u = 0);
5
+ let i = u + s + a * 2;
6
+ return i > e && (i = e), i === e && u > 0 && (u = Math.max(0, i - s - a * 2)), {
7
+ start: u,
8
+ end: i,
9
+ offsetY: u * n,
10
+ totalHeight: e * n
11
11
  };
12
12
  }
13
- function G(N, e) {
14
- return N <= e;
13
+ function $(x, e) {
14
+ return x <= e;
15
15
  }
16
- const z = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', $ = {
16
+ const B = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', K = {
17
17
  expand: "▶",
18
18
  collapse: "▼",
19
19
  sortAsc: "▲",
@@ -22,11 +22,11 @@ const z = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentCo
22
22
  submenuArrow: "▶",
23
23
  dragHandle: "⋮⋮",
24
24
  toolPanel: "☰",
25
- filter: z,
26
- filterActive: z,
25
+ filter: B,
26
+ filterActive: B,
27
27
  print: "🖨️"
28
28
  };
29
- class K {
29
+ class W {
30
30
  /**
31
31
  * Plugin dependencies - declare other plugins this one requires.
32
32
  *
@@ -316,7 +316,7 @@ class K {
316
316
  */
317
317
  get gridIcons() {
318
318
  const e = this.grid?.gridConfig?.icons ?? {};
319
- return { ...$, ...e };
319
+ return { ...K, ...e };
320
320
  }
321
321
  // #region Animation Helpers
322
322
  /**
@@ -392,42 +392,47 @@ class K {
392
392
  }
393
393
  // #endregion
394
394
  }
395
- function W(N) {
396
- return N.meta?.utility === !0;
395
+ function U(x) {
396
+ return x.meta?.utility === !0;
397
397
  }
398
- function j(N, e, t = !1) {
399
- const r = N[e.field];
398
+ function V(x) {
399
+ if (x instanceof Date) return x.getTime();
400
+ const e = Number(x);
401
+ return isNaN(e) ? new Date(x).getTime() : e;
402
+ }
403
+ function j(x, e, t = !1) {
404
+ const r = x[e.field];
400
405
  if (e.operator === "blank")
401
406
  return r == null || r === "";
402
407
  if (e.operator === "notBlank")
403
408
  return r != null && r !== "";
404
409
  if (r == null) return !1;
405
- const i = String(r), l = t ? i : i.toLowerCase(), c = t ? String(e.value) : String(e.value).toLowerCase();
410
+ const n = String(r), a = t ? n : n.toLowerCase(), s = t ? String(e.value) : String(e.value).toLowerCase();
406
411
  switch (e.operator) {
407
412
  // Text operators
408
413
  case "contains":
409
- return l.includes(c);
414
+ return a.includes(s);
410
415
  case "notContains":
411
- return !l.includes(c);
416
+ return !a.includes(s);
412
417
  case "equals":
413
- return l === c;
418
+ return a === s;
414
419
  case "notEquals":
415
- return l !== c;
420
+ return a !== s;
416
421
  case "startsWith":
417
- return l.startsWith(c);
422
+ return a.startsWith(s);
418
423
  case "endsWith":
419
- return l.endsWith(c);
420
- // Number/Date operators (use raw numeric values)
424
+ return a.endsWith(s);
425
+ // Number/Date operators (use toNumeric for Date objects and date strings)
421
426
  case "lessThan":
422
- return Number(r) < Number(e.value);
427
+ return V(r) < V(e.value);
423
428
  case "lessThanOrEqual":
424
- return Number(r) <= Number(e.value);
429
+ return V(r) <= V(e.value);
425
430
  case "greaterThan":
426
- return Number(r) > Number(e.value);
431
+ return V(r) > V(e.value);
427
432
  case "greaterThanOrEqual":
428
- return Number(r) >= Number(e.value);
433
+ return V(r) >= V(e.value);
429
434
  case "between":
430
- return Number(r) >= Number(e.value) && Number(r) <= Number(e.valueTo);
435
+ return V(r) >= V(e.value) && V(r) <= V(e.valueTo);
431
436
  // Set operators
432
437
  case "in":
433
438
  return Array.isArray(e.value) && e.value.includes(r);
@@ -437,12 +442,12 @@ function j(N, e, t = !1) {
437
442
  return !0;
438
443
  }
439
444
  }
440
- function U(N, e, t = !1) {
441
- return e.length ? N.filter((r) => e.every((i) => j(r, i, t))) : N;
445
+ function J(x, e, t = !1) {
446
+ return e.length ? x.filter((r) => e.every((n) => j(r, n, t))) : x;
442
447
  }
443
- function J(N) {
448
+ function Q(x) {
444
449
  return JSON.stringify(
445
- N.map((e) => ({
450
+ x.map((e) => ({
446
451
  field: e.field,
447
452
  operator: e.operator,
448
453
  value: e.value,
@@ -450,16 +455,16 @@ function J(N) {
450
455
  }))
451
456
  );
452
457
  }
453
- function B(N, e) {
458
+ function O(x, e) {
454
459
  const t = /* @__PURE__ */ new Set();
455
- for (const r of N) {
456
- const i = r[e];
457
- i != null && t.add(i);
460
+ for (const r of x) {
461
+ const n = r[e];
462
+ n != null && t.add(n);
458
463
  }
459
- return [...t].sort((r, i) => typeof r == "number" && typeof i == "number" ? r - i : String(r).localeCompare(String(i)));
464
+ return [...t].sort((r, n) => typeof r == "number" && typeof n == "number" ? r - n : String(r).localeCompare(String(n)));
460
465
  }
461
- const Q = '@layer tbw-plugins{tbw-grid .tbw-quick-filter-input{flex:1;max-width:300px;height:var(--tbw-input-height, 1.75rem);padding:var(--tbw-input-padding, 0 .5rem);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);background:var(--tbw-color-bg);color:var(--tbw-color-fg);font-size:var(--tbw-font-size-sm, .8125rem)}tbw-grid .tbw-quick-filter-input:focus{outline:none;border-color:var(--tbw-color-accent)}tbw-grid .header-cell.filtered:before{content:"";position:absolute;top:var(--tbw-spacing-xs, .25rem);right:var(--tbw-spacing-xs, .25rem);width:var(--tbw-indicator-size, .375rem);height:var(--tbw-indicator-size, .375rem);background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border-radius:50%}tbw-grid .tbw-filter-btn{display:var(--tbw-filter-btn-display, inline-flex);visibility:var(--tbw-filter-btn-visibility, visible);align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;padding:2px;margin-left:var(--tbw-spacing-xs, .25rem);opacity:.4;transition:opacity .15s,visibility 0s,display 0s allow-discrete;color:inherit;vertical-align:middle;transition-behavior:allow-discrete}tbw-grid .tbw-filter-btn:hover,tbw-grid .tbw-filter-btn.active{opacity:1;visibility:visible;display:inline-flex}tbw-grid .tbw-filter-btn.active{color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}tbw-grid .header-row .cell:hover .tbw-filter-btn,tbw-grid .header-row .cell.filtered .tbw-filter-btn{display:inline-flex;visibility:visible}}', X = "@layer tbw-plugins{.tbw-filter-panel{position:fixed;background:var(--tbw-filter-panel-bg, var(--tbw-color-panel-bg, light-dark(#eeeeee, #222222)));color:var(--tbw-filter-panel-fg, var(--tbw-color-fg, light-dark(#222222, #eeeeee)));border:1px solid var(--tbw-filter-panel-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-panel-radius, var(--tbw-border-radius, .25rem));box-shadow:0 4px 16px var(--tbw-filter-panel-shadow, var(--tbw-color-shadow, light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3))));padding:var(--tbw-panel-padding, var(--tbw-spacing-lg, .75rem));z-index:10000;min-width:200px;max-width:280px;max-height:350px;display:flex;flex-direction:column;font-family:var(--tbw-font-family, system-ui, sans-serif);font-size:var(--tbw-font-size, .8125rem);transform-origin:top center}.tbw-filter-panel.tbw-filter-panel-above{transform-origin:bottom center}.tbw-filter-panel.tbw-filter-panel-animated{animation:tbw-filter-panel-enter var(--tbw-animation-duration, .15s) var(--tbw-animation-easing, ease-out)}.tbw-filter-panel.tbw-filter-panel-above.tbw-filter-panel-animated{animation:tbw-filter-panel-enter-above var(--tbw-animation-duration, .15s) var(--tbw-animation-easing, ease-out)}@keyframes tbw-filter-panel-enter{0%{opacity:0;transform:scaleY(.3) translateY(-10px)}to{opacity:1;transform:scaleY(1) translateY(0)}}@keyframes tbw-filter-panel-enter-above{0%{opacity:0;transform:scaleY(.3) translateY(10px)}to{opacity:1;transform:scaleY(1) translateY(0)}}@supports (anchor-name: --test){.tbw-filter-panel{position-anchor:--tbw-filter-anchor;top:anchor(bottom);left:anchor(left);margin-top:4px;position-try-fallbacks:flip-inline,flip-block,flip-block flip-inline}}.tbw-filter-search{margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));min-height:var(--tbw-filter-item-height, 28px)}.tbw-filter-search-input{height:var(--tbw-filter-item-height, 28px);width:100%;padding:var(--tbw-filter-search-padding, var(--tbw-spacing-sm, .375rem) var(--tbw-spacing-md, .5rem));background:var(--tbw-filter-input-bg, var(--tbw-color-bg, transparent));color:inherit;border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-input-radius, var(--tbw-border-radius, .25rem));font-size:inherit;box-sizing:border-box}.tbw-filter-search-input:focus{outline:none;border-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));box-shadow:0 0 0 2px rgba(from var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6)) r g b / 15%)}.tbw-filter-actions{display:flex;padding:var(--tbw-button-padding-sm, .25rem .125rem);margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));border-bottom:1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));min-height:var(--tbw-filter-item-height, 28px)}.tbw-filter-actions .tbw-filter-value-item{flex:1}.tbw-filter-values{flex:1;overflow-y:auto;margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));max-height:180px;position:relative}.tbw-filter-values-spacer{width:1px}.tbw-filter-values-content{position:absolute;top:0;left:0;right:0}.tbw-filter-value-item{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));padding:var(--tbw-button-padding-sm, .25rem .125rem);cursor:pointer;border-radius:3px;height:var(--tbw-filter-item-height, 28px)}.tbw-filter-value-item:hover{background:var(--tbw-filter-hover, var(--tbw-color-row-hover, light-dark(#f0f6ff, #1c1c1c)))}.tbw-filter-checkbox{margin:0;cursor:pointer;accent-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}.tbw-filter-no-match{color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem)) 0;text-align:center;font-style:italic}.tbw-filter-buttons{display:flex;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));padding-top:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));border-top:1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)))}.tbw-filter-apply-btn{flex:1;padding:var(--tbw-filter-btn-padding, var(--tbw-button-padding, .375rem .75rem));background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));color:var(--tbw-filter-accent-fg, var(--tbw-color-accent-fg, light-dark(#ffffff, #000000)));border:none;border-radius:var(--tbw-border-radius, .25rem);cursor:pointer;font-size:var(--tbw-font-size-sm, .8125rem);font-weight:var(--tbw-filter-btn-font-weight, 500);min-height:var(--tbw-filter-btn-min-height, auto)}.tbw-filter-apply-btn:hover{filter:brightness(.9)}.tbw-filter-clear-btn{flex:1;padding:var(--tbw-filter-btn-padding, var(--tbw-button-padding, .375rem .75rem));background:transparent;color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-border-radius, .25rem);cursor:pointer;font-size:var(--tbw-font-size-sm, .8125rem);font-weight:var(--tbw-filter-btn-font-weight, 500);min-height:var(--tbw-filter-btn-min-height, auto)}.tbw-filter-clear-btn:hover{background:var(--tbw-filter-hover, var(--tbw-color-row-hover, light-dark(#f0f6ff, #1c1c1c)))}.tbw-filter-range-inputs,.tbw-filter-date-range{display:flex;align-items:flex-end;gap:var(--tbw-spacing-sm, .375rem);margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-filter-range-group,.tbw-filter-date-group{display:flex;flex-direction:column;gap:var(--tbw-spacing-xs, .25rem);flex:1}.tbw-filter-range-label{font-size:var(--tbw-font-size-xs, .75rem);color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)))}.tbw-filter-range-input,.tbw-filter-date-input{width:100%;height:var(--tbw-filter-item-height, 28px);padding:var(--tbw-spacing-xs, .25rem) var(--tbw-spacing-sm, .375rem);background:var(--tbw-filter-input-bg, var(--tbw-color-bg, transparent));color:inherit;border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-input-radius, var(--tbw-border-radius, .25rem));font-size:inherit;box-sizing:border-box}.tbw-filter-range-input:focus,.tbw-filter-date-input:focus{outline:none;border-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));box-shadow:0 0 0 2px rgba(from var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6)) r g b / 15%)}.tbw-filter-range-separator{color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));padding-bottom:var(--tbw-spacing-xs, .25rem)}.tbw-filter-range-slider{position:relative;height:24px;margin:var(--tbw-spacing-md, .5rem) 0 var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-filter-range-track{position:absolute;top:50%;left:0;right:0;height:4px;background:var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:2px;transform:translateY(-50%)}.tbw-filter-range-fill{position:absolute;top:50%;height:4px;background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border-radius:2px;transform:translateY(-50%)}.tbw-filter-range-thumb{position:absolute;top:0;width:100%;height:100%;background:none;pointer-events:none;-webkit-appearance:none;appearance:none}.tbw-filter-range-thumb::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border:2px solid var(--tbw-filter-panel-bg, var(--tbw-color-panel-bg, light-dark(#eeeeee, #222222)));border-radius:50%;cursor:pointer;pointer-events:all;box-shadow:0 1px 3px #0003}.tbw-filter-range-thumb::-moz-range-thumb{width:16px;height:16px;background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border:2px solid var(--tbw-filter-panel-bg, var(--tbw-color-panel-bg, light-dark(#eeeeee, #222222)));border-radius:50%;cursor:pointer;pointer-events:all;box-shadow:0 1px 3px #0003}.tbw-filter-range-thumb::-webkit-slider-thumb:hover{transform:scale(1.1)}.tbw-filter-range-thumb::-moz-range-thumb:hover{transform:scale(1.1)}}";
462
- class I extends K {
466
+ const X = '@layer tbw-plugins{tbw-grid .tbw-quick-filter-input{flex:1;max-width:300px;height:var(--tbw-input-height, 1.75rem);padding:var(--tbw-input-padding, 0 .5rem);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);background:var(--tbw-color-bg);color:var(--tbw-color-fg);font-size:var(--tbw-font-size-sm, .8125rem)}tbw-grid .tbw-quick-filter-input:focus{outline:none;border-color:var(--tbw-color-accent)}tbw-grid .header-cell.filtered:before{content:"";position:absolute;top:var(--tbw-spacing-xs, .25rem);right:var(--tbw-spacing-xs, .25rem);width:var(--tbw-indicator-size, .375rem);height:var(--tbw-indicator-size, .375rem);background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border-radius:50%}tbw-grid .tbw-filter-btn{display:var(--tbw-filter-btn-display, inline-flex);visibility:var(--tbw-filter-btn-visibility, visible);align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;padding:2px;margin-left:var(--tbw-spacing-xs, .25rem);opacity:.4;transition:opacity .15s,visibility 0s,display 0s allow-discrete;color:inherit;vertical-align:middle;transition-behavior:allow-discrete}tbw-grid .tbw-filter-btn:hover,tbw-grid .tbw-filter-btn.active{opacity:1;visibility:visible;display:inline-flex}tbw-grid .tbw-filter-btn.active{color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}tbw-grid .header-row .cell:hover .tbw-filter-btn,tbw-grid .header-row .cell.filtered .tbw-filter-btn{display:inline-flex;visibility:visible}}', Z = "@layer tbw-plugins{.tbw-filter-panel{position:fixed;background:var(--tbw-filter-panel-bg, var(--tbw-color-panel-bg, light-dark(#eeeeee, #222222)));color:var(--tbw-filter-panel-fg, var(--tbw-color-fg, light-dark(#222222, #eeeeee)));border:1px solid var(--tbw-filter-panel-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-panel-radius, var(--tbw-border-radius, .25rem));box-shadow:0 4px 16px var(--tbw-filter-panel-shadow, var(--tbw-color-shadow, light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3))));padding:var(--tbw-panel-padding, var(--tbw-spacing-lg, .75rem));z-index:10000;min-width:200px;max-width:280px;max-height:350px;display:flex;flex-direction:column;font-family:var(--tbw-font-family, system-ui, sans-serif);font-size:var(--tbw-font-size, .8125rem);transform-origin:top center}.tbw-filter-panel.tbw-filter-panel-above{transform-origin:bottom center}.tbw-filter-panel.tbw-filter-panel-animated{animation:tbw-filter-panel-enter var(--tbw-animation-duration, .15s) var(--tbw-animation-easing, ease-out)}.tbw-filter-panel.tbw-filter-panel-above.tbw-filter-panel-animated{animation:tbw-filter-panel-enter-above var(--tbw-animation-duration, .15s) var(--tbw-animation-easing, ease-out)}@keyframes tbw-filter-panel-enter{0%{opacity:0;transform:scaleY(.3) translateY(-10px)}to{opacity:1;transform:scaleY(1) translateY(0)}}@keyframes tbw-filter-panel-enter-above{0%{opacity:0;transform:scaleY(.3) translateY(10px)}to{opacity:1;transform:scaleY(1) translateY(0)}}@supports (anchor-name: --test){.tbw-filter-panel{position-anchor:--tbw-filter-anchor;top:anchor(bottom);left:anchor(left);margin-top:4px;position-try-fallbacks:flip-inline,flip-block,flip-block flip-inline}}.tbw-filter-search{margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));min-height:var(--tbw-filter-item-height, 28px)}.tbw-filter-search-input{height:var(--tbw-filter-item-height, 28px);width:100%;padding:var(--tbw-filter-search-padding, var(--tbw-spacing-sm, .375rem) var(--tbw-spacing-md, .5rem));background:var(--tbw-filter-input-bg, var(--tbw-color-bg, transparent));color:inherit;border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-input-radius, var(--tbw-border-radius, .25rem));font-size:inherit;box-sizing:border-box}.tbw-filter-search-input:focus{outline:none;border-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));box-shadow:0 0 0 2px rgba(from var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6)) r g b / 15%)}.tbw-filter-actions{display:flex;padding:var(--tbw-button-padding-sm, .25rem .125rem);margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));border-bottom:1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));min-height:var(--tbw-filter-item-height, 28px)}.tbw-filter-actions .tbw-filter-value-item{flex:1}.tbw-filter-values{flex:1;overflow-y:auto;margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));max-height:180px;position:relative}.tbw-filter-values-spacer{width:1px}.tbw-filter-values-content{position:absolute;top:0;left:0;right:0}.tbw-filter-value-item{display:flex;align-items:center;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));padding:var(--tbw-button-padding-sm, .25rem .125rem);cursor:pointer;border-radius:3px;height:var(--tbw-filter-item-height, 28px)}.tbw-filter-value-item:hover{background:var(--tbw-filter-hover, var(--tbw-color-row-hover, light-dark(#f0f6ff, #1c1c1c)))}.tbw-filter-checkbox{margin:0;cursor:pointer;accent-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}.tbw-filter-no-match{color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));padding:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem)) 0;text-align:center;font-style:italic}.tbw-filter-buttons{display:flex;gap:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));padding-top:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem));border-top:1px solid var(--tbw-filter-divider, var(--tbw-color-border, light-dark(#d0d0d4, #454545)))}.tbw-filter-apply-btn{flex:1;padding:var(--tbw-filter-btn-padding, var(--tbw-button-padding, .375rem .75rem));background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));color:var(--tbw-filter-accent-fg, var(--tbw-color-accent-fg, light-dark(#ffffff, #000000)));border:none;border-radius:var(--tbw-border-radius, .25rem);cursor:pointer;font-size:var(--tbw-font-size-sm, .8125rem);font-weight:var(--tbw-filter-btn-font-weight, 500);min-height:var(--tbw-filter-btn-min-height, auto)}.tbw-filter-apply-btn:hover{filter:brightness(.9)}.tbw-filter-clear-btn{flex:1;padding:var(--tbw-filter-btn-padding, var(--tbw-button-padding, .375rem .75rem));background:transparent;color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-border-radius, .25rem);cursor:pointer;font-size:var(--tbw-font-size-sm, .8125rem);font-weight:var(--tbw-filter-btn-font-weight, 500);min-height:var(--tbw-filter-btn-min-height, auto)}.tbw-filter-clear-btn:hover{background:var(--tbw-filter-hover, var(--tbw-color-row-hover, light-dark(#f0f6ff, #1c1c1c)))}.tbw-filter-range-inputs,.tbw-filter-date-range{display:flex;align-items:flex-end;gap:var(--tbw-spacing-sm, .375rem);margin-bottom:var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-filter-range-group,.tbw-filter-date-group{display:flex;flex-direction:column;gap:var(--tbw-spacing-xs, .25rem);flex:1}.tbw-filter-range-label{font-size:var(--tbw-font-size-xs, .75rem);color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)))}.tbw-filter-range-input,.tbw-filter-date-input{width:100%;height:var(--tbw-filter-item-height, 28px);padding:var(--tbw-spacing-xs, .25rem) var(--tbw-spacing-sm, .375rem);background:var(--tbw-filter-input-bg, var(--tbw-color-bg, transparent));color:inherit;border:1px solid var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:var(--tbw-filter-input-radius, var(--tbw-border-radius, .25rem));font-size:inherit;box-sizing:border-box}.tbw-filter-range-input:focus,.tbw-filter-date-input:focus{outline:none;border-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));box-shadow:0 0 0 2px rgba(from var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6)) r g b / 15%)}.tbw-filter-range-separator{color:var(--tbw-filter-muted, var(--tbw-color-fg-muted, light-dark(#555555, #aaaaaa)));padding-bottom:var(--tbw-spacing-xs, .25rem)}.tbw-filter-blank-option{display:flex;align-items:center;gap:var(--tbw-spacing-sm, .375rem);padding:var(--tbw-spacing-xs, .25rem) 0;margin-bottom:var(--tbw-spacing-xs, .25rem);font-size:var(--tbw-font-size-sm, .8125rem);cursor:pointer;-webkit-user-select:none;user-select:none}.tbw-filter-blank-checkbox{accent-color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));margin:0;cursor:pointer}.tbw-filter-date-range.tbw-filter-disabled{opacity:.4;pointer-events:none}.tbw-filter-range-slider{position:relative;height:24px;margin:var(--tbw-spacing-md, .5rem) 0 var(--tbw-panel-gap, var(--tbw-spacing-md, .5rem))}.tbw-filter-range-track{position:absolute;top:50%;left:0;right:0;height:4px;background:var(--tbw-filter-input-border, var(--tbw-color-border, light-dark(#d0d0d4, #454545)));border-radius:2px;transform:translateY(-50%)}.tbw-filter-range-fill{position:absolute;top:50%;height:4px;background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border-radius:2px;transform:translateY(-50%)}.tbw-filter-range-thumb{position:absolute;top:0;width:100%;height:100%;background:none;pointer-events:none;-webkit-appearance:none;appearance:none}.tbw-filter-range-thumb::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border:2px solid var(--tbw-filter-panel-bg, var(--tbw-color-panel-bg, light-dark(#eeeeee, #222222)));border-radius:50%;cursor:pointer;pointer-events:all;box-shadow:0 1px 3px #0003}.tbw-filter-range-thumb::-moz-range-thumb{width:16px;height:16px;background:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));border:2px solid var(--tbw-filter-panel-bg, var(--tbw-color-panel-bg, light-dark(#eeeeee, #222222)));border-radius:50%;cursor:pointer;pointer-events:all;box-shadow:0 1px 3px #0003}.tbw-filter-range-thumb::-webkit-slider-thumb:hover{transform:scale(1.1)}.tbw-filter-range-thumb::-moz-range-thumb:hover{transform:scale(1.1)}}";
467
+ class _ extends W {
463
468
  /**
464
469
  * Plugin manifest - declares events emitted by this plugin.
465
470
  * @internal
@@ -475,7 +480,7 @@ class I extends K {
475
480
  /** @internal */
476
481
  name = "filtering";
477
482
  /** @internal */
478
- styles = Q;
483
+ styles = X;
479
484
  /** @internal */
480
485
  get defaultConfig() {
481
486
  return {
@@ -504,6 +509,8 @@ class I extends K {
504
509
  filters = /* @__PURE__ */ new Map();
505
510
  cachedResult = null;
506
511
  cacheKey = null;
512
+ /** Spot-check of input rows for cache invalidation when upstream plugins (e.g. sort) change row order */
513
+ cachedInputSpot = null;
507
514
  openPanelField = null;
508
515
  panelElement = null;
509
516
  panelAnchorElement = null;
@@ -531,7 +538,7 @@ class I extends K {
531
538
  return t;
532
539
  }
533
540
  }
534
- return I.DEFAULT_LIST_ITEM_HEIGHT;
541
+ return _.DEFAULT_LIST_ITEM_HEIGHT;
535
542
  }
536
543
  /**
537
544
  * Sync excludedValues map from a filter model (for set filters).
@@ -547,7 +554,7 @@ class I extends K {
547
554
  }
548
555
  /** @internal */
549
556
  detach() {
550
- this.filters.clear(), this.cachedResult = null, this.cacheKey = null, this.openPanelField = null, this.panelElement && (this.panelElement.remove(), this.panelElement = null), this.searchText.clear(), this.excludedValues.clear(), this.panelAbortController?.abort(), this.panelAbortController = null;
557
+ this.filters.clear(), this.cachedResult = null, this.cacheKey = null, this.cachedInputSpot = null, this.openPanelField = null, this.panelElement && (this.panelElement.remove(), this.panelElement = null), this.searchText.clear(), this.excludedValues.clear(), this.panelAbortController?.abort(), this.panelAbortController = null;
551
558
  }
552
559
  // #endregion
553
560
  // #region Hooks
@@ -557,40 +564,45 @@ class I extends K {
557
564
  if (!t.length) return [...e];
558
565
  if (this.config.filterHandler)
559
566
  return this.cachedResult ? this.cachedResult : [...e];
560
- const r = J(t);
561
- if (this.cacheKey === r && this.cachedResult)
567
+ const r = Q(t), n = {
568
+ len: e.length,
569
+ first: e[0],
570
+ mid: e[Math.floor(e.length / 2)],
571
+ last: e[e.length - 1]
572
+ }, a = this.cachedInputSpot != null && n.len === this.cachedInputSpot.len && n.first === this.cachedInputSpot.first && n.mid === this.cachedInputSpot.mid && n.last === this.cachedInputSpot.last;
573
+ if (this.cacheKey === r && this.cachedResult && a)
562
574
  return this.cachedResult;
563
- const i = U([...e], t, this.config.caseSensitive);
564
- return this.cachedResult = i, this.cacheKey = r, i;
575
+ const s = J([...e], t, this.config.caseSensitive);
576
+ return this.cachedResult = s, this.cacheKey = r, this.cachedInputSpot = n, s;
565
577
  }
566
578
  /** @internal */
567
579
  afterRender() {
568
580
  const e = this.gridElement;
569
581
  if (!e) return;
570
582
  e.querySelectorAll('[part~="header-cell"]').forEach((r) => {
571
- const i = r.getAttribute("data-col");
572
- if (i === null) return;
573
- const l = this.visibleColumns[parseInt(i, 10)];
574
- if (!l || !this.isColumnFilterable(l) || W(l)) return;
575
- const c = l.field;
576
- if (!c) return;
577
- const d = this.filters.has(c);
578
- let a = r.querySelector(".tbw-filter-btn");
579
- if (a) {
580
- const w = a.classList.contains("active");
581
- if (a.classList.toggle("active", d), r.classList.toggle("filtered", d), w !== d) {
582
- const u = d ? "filterActive" : "filter";
583
- this.setIcon(a, this.resolveIcon(u));
583
+ const n = r.getAttribute("data-col");
584
+ if (n === null) return;
585
+ const a = this.visibleColumns[parseInt(n, 10)];
586
+ if (!a || !this.isColumnFilterable(a) || U(a)) return;
587
+ const s = a.field;
588
+ if (!s) return;
589
+ const u = this.filters.has(s);
590
+ let i = r.querySelector(".tbw-filter-btn");
591
+ if (i) {
592
+ const y = i.classList.contains("active");
593
+ if (i.classList.toggle("active", u), r.classList.toggle("filtered", u), y !== u) {
594
+ const h = u ? "filterActive" : "filter";
595
+ this.setIcon(i, this.resolveIcon(h));
584
596
  }
585
597
  return;
586
598
  }
587
- a = document.createElement("button"), a.className = "tbw-filter-btn", a.setAttribute("aria-label", `Filter ${l.header ?? c}`);
588
- const m = d ? "filterActive" : "filter";
589
- this.setIcon(a, this.resolveIcon(m)), d && (a.classList.add("active"), r.classList.add("filtered")), a.addEventListener("click", (w) => {
590
- w.stopPropagation(), this.toggleFilterPanel(c, l, a);
599
+ i = document.createElement("button"), i.className = "tbw-filter-btn", i.setAttribute("aria-label", `Filter ${a.header ?? s}`);
600
+ const f = u ? "filterActive" : "filter";
601
+ this.setIcon(i, this.resolveIcon(f)), u && (i.classList.add("active"), r.classList.add("filtered")), i.addEventListener("click", (y) => {
602
+ y.stopPropagation(), this.toggleFilterPanel(s, a, i);
591
603
  });
592
- const k = r.querySelector(".resize-handle");
593
- k ? r.insertBefore(a, k) : r.appendChild(a);
604
+ const N = r.querySelector(".resize-handle");
605
+ N ? r.insertBefore(i, N) : r.appendChild(i);
594
606
  });
595
607
  }
596
608
  // #endregion
@@ -606,7 +618,7 @@ class I extends K {
606
618
  const r = { ...t, field: e };
607
619
  this.filters.set(e, r), this.syncExcludedValues(e, r);
608
620
  }
609
- this.cachedResult = null, this.cacheKey = null, this.emit("filter-change", {
621
+ this.cachedResult = null, this.cacheKey = null, this.cachedInputSpot = null, this.emit("filter-change", {
610
622
  filters: [...this.filters.values()],
611
623
  filteredRowCount: 0
612
624
  // Will be accurate after processRows
@@ -637,7 +649,7 @@ class I extends K {
637
649
  this.filters.clear(), this.excludedValues.clear();
638
650
  for (const t of e)
639
651
  this.filters.set(t.field, t), this.syncExcludedValues(t.field, t);
640
- this.cachedResult = null, this.cacheKey = null, this.emit("filter-change", {
652
+ this.cachedResult = null, this.cacheKey = null, this.cachedInputSpot = null, this.emit("filter-change", {
641
653
  filters: [...this.filters.values()],
642
654
  filteredRowCount: 0
643
655
  }), this.emitPluginEvent("filter-applied", { filters: [...this.filters.values()] }), this.requestRender();
@@ -677,7 +689,7 @@ class I extends K {
677
689
  * Uses sourceRows to include all values regardless of current filter.
678
690
  */
679
691
  getUniqueValues(e) {
680
- return B(this.sourceRows, e);
692
+ return O(this.sourceRows, e);
681
693
  }
682
694
  // #endregion
683
695
  // #region Private Methods
@@ -688,8 +700,8 @@ class I extends K {
688
700
  copyGridThemeContext(e) {
689
701
  const t = this.gridElement;
690
702
  if (!t) return;
691
- for (const i of t.classList)
692
- i.startsWith("tbw-") || i === "selecting" || e.classList.add(i);
703
+ for (const n of t.classList)
704
+ n.startsWith("tbw-") || n === "selecting" || e.classList.add(n);
693
705
  const r = t.dataset.theme;
694
706
  r && (e.dataset.theme = r);
695
707
  }
@@ -703,7 +715,7 @@ class I extends K {
703
715
  return;
704
716
  }
705
717
  const e = document.createElement("style");
706
- e.id = "tbw-filter-panel-styles", e.textContent = X, document.head.appendChild(e), this.globalStylesInjected = !0;
718
+ e.id = "tbw-filter-panel-styles", e.textContent = Z, document.head.appendChild(e), this.globalStylesInjected = !0;
707
719
  }
708
720
  /**
709
721
  * Toggle the filter panel for a field
@@ -714,47 +726,47 @@ class I extends K {
714
726
  return;
715
727
  }
716
728
  this.closeFilterPanel();
717
- const i = document.createElement("div");
718
- if (i.className = "tbw-filter-panel", this.copyGridThemeContext(i), this.isAnimationEnabled && i.classList.add("tbw-filter-panel-animated"), this.panelElement = i, this.openPanelField = e, this.config.valuesHandler) {
719
- i.innerHTML = '<div class="tbw-filter-loading">Loading...</div>', document.body.appendChild(i), this.positionPanel(i, r), this.setupPanelCloseHandler(i, r), this.config.valuesHandler(e, t).then((c) => {
720
- this.openPanelField !== e || !this.panelElement || (i.innerHTML = "", this.renderPanelContent(e, t, i, c));
729
+ const n = document.createElement("div");
730
+ if (n.className = "tbw-filter-panel", this.copyGridThemeContext(n), this.isAnimationEnabled && n.classList.add("tbw-filter-panel-animated"), this.panelElement = n, this.openPanelField = e, this.config.valuesHandler) {
731
+ n.innerHTML = '<div class="tbw-filter-loading">Loading...</div>', document.body.appendChild(n), this.positionPanel(n, r), this.setupPanelCloseHandler(n, r), this.config.valuesHandler(e, t).then((s) => {
732
+ this.openPanelField !== e || !this.panelElement || (n.innerHTML = "", this.renderPanelContent(e, t, n, s));
721
733
  });
722
734
  return;
723
735
  }
724
- const l = B(this.sourceRows, e);
725
- document.body.appendChild(i), this.positionPanel(i, r), this.renderPanelContent(e, t, i, l), this.setupPanelCloseHandler(i, r);
736
+ const a = O(this.sourceRows, e);
737
+ document.body.appendChild(n), this.positionPanel(n, r), this.renderPanelContent(e, t, n, a), this.setupPanelCloseHandler(n, r);
726
738
  }
727
739
  /**
728
740
  * Render filter panel content with given values
729
741
  */
730
- renderPanelContent(e, t, r, i) {
731
- let l = this.excludedValues.get(e);
732
- l || (l = /* @__PURE__ */ new Set(), this.excludedValues.set(e, l));
733
- const c = this.searchText.get(e) ?? "", d = {
742
+ renderPanelContent(e, t, r, n) {
743
+ let a = this.excludedValues.get(e);
744
+ a || (a = /* @__PURE__ */ new Set(), this.excludedValues.set(e, a));
745
+ const s = this.searchText.get(e) ?? "", u = {
734
746
  field: e,
735
747
  column: t,
736
- uniqueValues: i,
737
- excludedValues: l,
738
- searchText: c,
739
- applySetFilter: (m) => {
740
- this.applySetFilter(e, m), this.closeFilterPanel();
748
+ uniqueValues: n,
749
+ excludedValues: a,
750
+ searchText: s,
751
+ applySetFilter: (f) => {
752
+ this.applySetFilter(e, f), this.closeFilterPanel();
741
753
  },
742
- applyTextFilter: (m, k, w) => {
743
- this.applyTextFilter(e, m, k, w), this.closeFilterPanel();
754
+ applyTextFilter: (f, N, y) => {
755
+ this.applyTextFilter(e, f, N, y), this.closeFilterPanel();
744
756
  },
745
757
  clearFilter: () => {
746
758
  this.clearFieldFilter(e), this.closeFilterPanel();
747
759
  },
748
760
  closePanel: () => this.closeFilterPanel()
749
761
  };
750
- let a = !1;
751
- if (this.config.filterPanelRenderer && (this.config.filterPanelRenderer(r, d), a = r.children.length > 0), !a && t.type) {
752
- const m = this.grid.effectiveConfig.typeDefaults?.[t.type];
753
- m?.filterPanelRenderer && (m.filterPanelRenderer(r, d), a = r.children.length > 0);
762
+ let i = !1;
763
+ if (this.config.filterPanelRenderer && (this.config.filterPanelRenderer(r, u), i = r.children.length > 0), !i && t.type) {
764
+ const f = this.grid.effectiveConfig.typeDefaults?.[t.type];
765
+ f?.filterPanelRenderer && (f.filterPanelRenderer(r, u), i = r.children.length > 0);
754
766
  }
755
- if (!a) {
756
- const m = t.type;
757
- m === "number" ? this.renderNumberFilterPanel(r, d, i) : m === "date" ? this.renderDateFilterPanel(r, d, i) : this.renderDefaultFilterPanel(r, d, i, l);
767
+ if (!i) {
768
+ const f = t.type;
769
+ f === "number" ? this.renderNumberFilterPanel(r, u, n) : f === "date" ? this.renderDateFilterPanel(r, u, n) : this.renderDefaultFilterPanel(r, u, n, a);
758
770
  }
759
771
  }
760
772
  /**
@@ -784,241 +796,258 @@ class I extends K {
784
796
  * Check if browser supports CSS Anchor Positioning
785
797
  */
786
798
  static checkAnchorPositioningSupport() {
787
- return I.supportsAnchorPositioning === null && (I.supportsAnchorPositioning = CSS.supports("anchor-name", "--test")), I.supportsAnchorPositioning;
799
+ return _.supportsAnchorPositioning === null && (_.supportsAnchorPositioning = CSS.supports("anchor-name", "--test")), _.supportsAnchorPositioning;
788
800
  }
789
801
  /**
790
802
  * Position the panel below the header cell
791
803
  * Uses CSS Anchor Positioning if supported, falls back to JS positioning
792
804
  */
793
805
  positionPanel(e, t) {
794
- const i = t.closest(".cell") ?? t;
795
- if (i.style.anchorName = "--tbw-filter-anchor", this.panelAnchorElement = i, I.checkAnchorPositioningSupport()) {
806
+ const n = t.closest(".cell") ?? t;
807
+ if (n.style.anchorName = "--tbw-filter-anchor", this.panelAnchorElement = n, _.checkAnchorPositioningSupport()) {
796
808
  requestAnimationFrame(() => {
797
- const c = e.getBoundingClientRect(), d = i.getBoundingClientRect();
798
- c.top < d.top && e.classList.add("tbw-filter-panel-above");
809
+ const s = e.getBoundingClientRect(), u = n.getBoundingClientRect();
810
+ s.top < u.top && e.classList.add("tbw-filter-panel-above");
799
811
  });
800
812
  return;
801
813
  }
802
- const l = i.getBoundingClientRect();
803
- e.style.position = "fixed", e.style.top = `${l.bottom + 4}px`, e.style.left = `${l.left}px`, requestAnimationFrame(() => {
804
- const c = e.getBoundingClientRect();
805
- c.right > window.innerWidth - 8 && (e.style.left = `${l.right - c.width}px`), c.bottom > window.innerHeight - 8 && (e.style.top = `${l.top - c.height - 4}px`, e.classList.add("tbw-filter-panel-above"));
814
+ const a = n.getBoundingClientRect();
815
+ e.style.position = "fixed", e.style.top = `${a.bottom + 4}px`, e.style.left = `${a.left}px`, requestAnimationFrame(() => {
816
+ const s = e.getBoundingClientRect();
817
+ s.right > window.innerWidth - 8 && (e.style.left = `${a.right - s.width}px`), s.bottom > window.innerHeight - 8 && (e.style.top = `${a.top - s.height - 4}px`, e.classList.add("tbw-filter-panel-above"));
806
818
  });
807
819
  }
808
820
  /**
809
821
  * Render the default filter panel content
810
822
  */
811
- renderDefaultFilterPanel(e, t, r, i) {
812
- const { field: l } = t, c = this.getListItemHeight(), d = document.createElement("div");
813
- d.className = "tbw-filter-search";
814
- const a = document.createElement("input");
815
- a.type = "text", a.placeholder = "Search...", a.className = "tbw-filter-search-input", a.value = this.searchText.get(l) ?? "", d.appendChild(a), e.appendChild(d);
816
- const m = document.createElement("div");
817
- m.className = "tbw-filter-actions";
818
- const k = document.createElement("label");
819
- k.className = "tbw-filter-value-item", k.style.padding = "0", k.style.margin = "0";
820
- const w = document.createElement("input");
821
- w.type = "checkbox", w.className = "tbw-filter-checkbox";
822
- const u = document.createElement("span");
823
- u.textContent = "Select All", k.appendChild(w), k.appendChild(u), m.appendChild(k);
824
- const v = () => {
825
- const o = [...S.values()], h = o.every((n) => n), y = o.every((n) => !n);
826
- w.checked = h, w.indeterminate = !h && !y;
823
+ renderDefaultFilterPanel(e, t, r, n) {
824
+ const { field: a } = t, s = this.getListItemHeight(), u = document.createElement("div");
825
+ u.className = "tbw-filter-search";
826
+ const i = document.createElement("input");
827
+ i.type = "text", i.placeholder = "Search...", i.className = "tbw-filter-search-input", i.value = this.searchText.get(a) ?? "", u.appendChild(i), e.appendChild(u);
828
+ const f = document.createElement("div");
829
+ f.className = "tbw-filter-actions";
830
+ const N = document.createElement("label");
831
+ N.className = "tbw-filter-value-item", N.style.padding = "0", N.style.margin = "0";
832
+ const y = document.createElement("input");
833
+ y.type = "checkbox", y.className = "tbw-filter-checkbox";
834
+ const h = document.createElement("span");
835
+ h.textContent = "Select All", N.appendChild(y), N.appendChild(h), f.appendChild(N);
836
+ const C = () => {
837
+ const l = [...F.values()], b = l.every((o) => o), m = l.every((o) => !o);
838
+ y.checked = b, y.indeterminate = !b && !m;
827
839
  };
828
- w.addEventListener("change", () => {
829
- const o = w.checked;
830
- for (const h of S.keys())
831
- S.set(h, o);
832
- v(), A();
833
- }), e.appendChild(m);
840
+ y.addEventListener("change", () => {
841
+ const l = y.checked;
842
+ for (const b of F.keys())
843
+ F.set(b, l);
844
+ C(), A();
845
+ }), e.appendChild(f);
846
+ const k = document.createElement("div");
847
+ k.className = "tbw-filter-values";
848
+ const w = document.createElement("div");
849
+ w.className = "tbw-filter-values-spacer", k.appendChild(w);
834
850
  const E = document.createElement("div");
835
- E.className = "tbw-filter-values";
836
- const g = document.createElement("div");
837
- g.className = "tbw-filter-values-spacer", E.appendChild(g);
838
- const x = document.createElement("div");
839
- x.className = "tbw-filter-values-content", E.appendChild(x);
840
- const S = /* @__PURE__ */ new Map();
841
- r.forEach((o) => {
842
- const h = o == null ? "__null__" : String(o);
843
- S.set(h, !i.has(o));
844
- }), v();
845
- let C = [];
846
- const R = (o, h) => {
847
- const y = o == null ? "(Blank)" : String(o), n = o == null ? "__null__" : String(o), s = document.createElement("label");
848
- s.className = "tbw-filter-value-item", s.style.position = "absolute", s.style.top = `calc(var(--tbw-filter-item-height, 28px) * ${h})`, s.style.left = "0", s.style.right = "0", s.style.boxSizing = "border-box";
849
- const F = document.createElement("input");
850
- F.type = "checkbox", F.className = "tbw-filter-checkbox", F.checked = S.get(n) ?? !0, F.dataset.value = n, F.addEventListener("change", () => {
851
- S.set(n, F.checked), v();
851
+ E.className = "tbw-filter-values-content", k.appendChild(E);
852
+ const F = /* @__PURE__ */ new Map();
853
+ r.forEach((l) => {
854
+ const b = l == null ? "__null__" : String(l);
855
+ F.set(b, !n.has(l));
856
+ }), C();
857
+ let T = [];
858
+ const I = (l, b) => {
859
+ const m = l == null ? "(Blank)" : String(l), o = l == null ? "__null__" : String(l), c = document.createElement("label");
860
+ c.className = "tbw-filter-value-item", c.style.position = "absolute", c.style.top = `calc(var(--tbw-filter-item-height, 28px) * ${b})`, c.style.left = "0", c.style.right = "0", c.style.boxSizing = "border-box";
861
+ const g = document.createElement("input");
862
+ g.type = "checkbox", g.className = "tbw-filter-checkbox", g.checked = F.get(o) ?? !0, g.dataset.value = o, g.addEventListener("change", () => {
863
+ F.set(o, g.checked), C();
852
864
  });
853
865
  const M = document.createElement("span");
854
- return M.textContent = y, s.appendChild(F), s.appendChild(M), s;
866
+ return M.textContent = m, c.appendChild(g), c.appendChild(M), c;
855
867
  }, A = () => {
856
- const o = C.length, h = E.clientHeight, y = E.scrollTop;
857
- if (g.style.height = `${o * c}px`, G(o, I.LIST_BYPASS_THRESHOLD / 3)) {
858
- x.innerHTML = "", x.style.transform = "translateY(0px)", C.forEach((s, F) => {
859
- x.appendChild(R(s, F));
868
+ const l = T.length, b = k.clientHeight, m = k.scrollTop;
869
+ if (w.style.height = `${l * s}px`, $(l, _.LIST_BYPASS_THRESHOLD / 3)) {
870
+ E.innerHTML = "", E.style.transform = "translateY(0px)", T.forEach((c, g) => {
871
+ E.appendChild(I(c, g));
860
872
  });
861
873
  return;
862
874
  }
863
- const n = Y({
864
- totalRows: o,
865
- viewportHeight: h,
866
- scrollTop: y,
867
- rowHeight: c,
868
- overscan: I.LIST_OVERSCAN
875
+ const o = G({
876
+ totalRows: l,
877
+ viewportHeight: b,
878
+ scrollTop: m,
879
+ rowHeight: s,
880
+ overscan: _.LIST_OVERSCAN
869
881
  });
870
- x.style.transform = `translateY(${n.offsetY}px)`, x.innerHTML = "";
871
- for (let s = n.start; s < n.end; s++)
872
- x.appendChild(R(C[s], s - n.start));
873
- }, f = (o) => {
874
- const h = this.config.caseSensitive ?? !1, y = h ? o : o.toLowerCase();
875
- if (C = r.filter((n) => {
876
- const s = n == null ? "(Blank)" : String(n), F = h ? s : s.toLowerCase();
877
- return !o || F.includes(y);
878
- }), C.length === 0) {
879
- g.style.height = "0px", x.innerHTML = "";
880
- const n = document.createElement("div");
881
- n.className = "tbw-filter-no-match", n.textContent = "No matching values", x.appendChild(n);
882
+ E.style.transform = `translateY(${o.offsetY}px)`, E.innerHTML = "";
883
+ for (let c = o.start; c < o.end; c++)
884
+ E.appendChild(I(T[c], c - o.start));
885
+ }, S = (l) => {
886
+ const b = this.config.caseSensitive ?? !1, m = b ? l : l.toLowerCase();
887
+ if (T = r.filter((o) => {
888
+ const c = o == null ? "(Blank)" : String(o), g = b ? c : c.toLowerCase();
889
+ return !l || g.includes(m);
890
+ }), T.length === 0) {
891
+ w.style.height = "0px", E.innerHTML = "";
892
+ const o = document.createElement("div");
893
+ o.className = "tbw-filter-no-match", o.textContent = "No matching values", E.appendChild(o);
882
894
  return;
883
895
  }
884
896
  A();
885
897
  };
886
- E.addEventListener(
898
+ k.addEventListener(
887
899
  "scroll",
888
900
  () => {
889
- C.length > 0 && A();
901
+ T.length > 0 && A();
890
902
  },
891
903
  { passive: !0 }
892
- ), f(a.value), e.appendChild(E);
893
- let L;
894
- a.addEventListener("input", () => {
895
- clearTimeout(L), L = setTimeout(() => {
896
- this.searchText.set(l, a.value), f(a.value);
904
+ ), S(i.value), e.appendChild(k);
905
+ let R;
906
+ i.addEventListener("input", () => {
907
+ clearTimeout(R), R = setTimeout(() => {
908
+ this.searchText.set(a, i.value), S(i.value);
897
909
  }, this.config.debounceMs ?? 150);
898
910
  });
899
- const T = document.createElement("div");
900
- T.className = "tbw-filter-buttons";
901
- const P = document.createElement("button");
902
- P.className = "tbw-filter-apply-btn", P.textContent = "Apply", P.addEventListener("click", () => {
903
- const o = [];
904
- for (const [h, y] of S)
905
- if (!y)
906
- if (h === "__null__")
907
- o.push(null);
911
+ const P = document.createElement("div");
912
+ P.className = "tbw-filter-buttons";
913
+ const L = document.createElement("button");
914
+ L.className = "tbw-filter-apply-btn", L.textContent = "Apply", L.addEventListener("click", () => {
915
+ const l = [];
916
+ for (const [b, m] of F)
917
+ if (!m)
918
+ if (b === "__null__")
919
+ l.push(null);
908
920
  else {
909
- const n = r.find((s) => String(s) === h);
910
- o.push(n !== void 0 ? n : h);
921
+ const o = r.find((c) => String(c) === b);
922
+ l.push(o !== void 0 ? o : b);
911
923
  }
912
- t.applySetFilter(o);
913
- }), T.appendChild(P);
914
- const p = document.createElement("button");
915
- p.className = "tbw-filter-clear-btn", p.textContent = "Clear Filter", p.addEventListener("click", () => {
924
+ t.applySetFilter(l);
925
+ }), P.appendChild(L);
926
+ const v = document.createElement("button");
927
+ v.className = "tbw-filter-clear-btn", v.textContent = "Clear Filter", v.addEventListener("click", () => {
916
928
  t.clearFilter();
917
- }), T.appendChild(p), e.appendChild(T);
929
+ }), P.appendChild(v), e.appendChild(P);
918
930
  }
919
931
  /**
920
932
  * Render a number range filter panel with min/max inputs and slider
921
933
  */
922
934
  renderNumberFilterPanel(e, t, r) {
923
- const { field: i, column: l } = t, c = l.filterParams, d = l.editorParams, a = (b, V) => {
924
- if (typeof b == "number") return b;
925
- if (typeof b == "string") {
926
- const H = parseFloat(b);
927
- return isNaN(H) ? V : H;
935
+ const { field: n, column: a } = t, s = a.filterParams, u = a.editorParams, i = (p, D) => {
936
+ if (typeof p == "number") return p;
937
+ if (typeof p == "string") {
938
+ const z = parseFloat(p);
939
+ return isNaN(z) ? D : z;
928
940
  }
929
- return V;
930
- }, m = r.filter((b) => typeof b == "number" && !isNaN(b)), k = m.length > 0 ? Math.min(...m) : 0, w = m.length > 0 ? Math.max(...m) : 100, u = a(c?.min ?? d?.min, k), v = a(c?.max ?? d?.max, w), E = c?.step ?? d?.step ?? 1, g = this.filters.get(i);
931
- let x = u, S = v;
932
- g?.operator === "between" ? (x = a(g.value, u), S = a(g.valueTo, v)) : g?.operator === "greaterThanOrEqual" ? x = a(g.value, u) : g?.operator === "lessThanOrEqual" && (S = a(g.value, v));
933
- const C = document.createElement("div");
934
- C.className = "tbw-filter-range-inputs";
935
- const R = document.createElement("div");
936
- R.className = "tbw-filter-range-group";
941
+ return D;
942
+ }, f = r.filter((p) => typeof p == "number" && !isNaN(p)), N = f.length > 0 ? Math.min(...f) : 0, y = f.length > 0 ? Math.max(...f) : 100, h = i(s?.min ?? u?.min, N), C = i(s?.max ?? u?.max, y), k = s?.step ?? u?.step ?? 1, w = this.filters.get(n);
943
+ let E = h, F = C;
944
+ w?.operator === "between" ? (E = i(w.value, h), F = i(w.valueTo, C)) : w?.operator === "greaterThanOrEqual" ? E = i(w.value, h) : w?.operator === "lessThanOrEqual" && (F = i(w.value, C));
945
+ const T = document.createElement("div");
946
+ T.className = "tbw-filter-range-inputs";
947
+ const I = document.createElement("div");
948
+ I.className = "tbw-filter-range-group";
937
949
  const A = document.createElement("label");
938
950
  A.textContent = "Min", A.className = "tbw-filter-range-label";
939
- const f = document.createElement("input");
940
- f.type = "number", f.className = "tbw-filter-range-input", f.min = String(u), f.max = String(v), f.step = String(E), f.value = String(x), R.appendChild(A), R.appendChild(f), C.appendChild(R);
941
- const L = document.createElement("span");
942
- L.className = "tbw-filter-range-separator", L.textContent = "–", C.appendChild(L);
943
- const T = document.createElement("div");
944
- T.className = "tbw-filter-range-group";
945
- const P = document.createElement("label");
946
- P.textContent = "Max", P.className = "tbw-filter-range-label";
947
- const p = document.createElement("input");
948
- p.type = "number", p.className = "tbw-filter-range-input", p.min = String(u), p.max = String(v), p.step = String(E), p.value = String(S), T.appendChild(P), T.appendChild(p), C.appendChild(T), e.appendChild(C);
949
- const o = document.createElement("div");
950
- o.className = "tbw-filter-range-slider";
951
- const h = document.createElement("div");
952
- h.className = "tbw-filter-range-track";
953
- const y = document.createElement("div");
954
- y.className = "tbw-filter-range-fill";
955
- const n = document.createElement("input");
956
- n.type = "range", n.className = "tbw-filter-range-thumb tbw-filter-range-thumb-min", n.min = String(u), n.max = String(v), n.step = String(E), n.value = String(x);
957
- const s = document.createElement("input");
958
- s.type = "range", s.className = "tbw-filter-range-thumb tbw-filter-range-thumb-max", s.min = String(u), s.max = String(v), s.step = String(E), s.value = String(S), o.appendChild(h), o.appendChild(y), o.appendChild(n), o.appendChild(s), e.appendChild(o);
959
- const F = () => {
960
- const b = parseFloat(n.value), V = parseFloat(s.value), H = v - u, D = (b - u) / H * 100, O = (V - u) / H * 100;
961
- y.style.left = `${D}%`, y.style.width = `${O - D}%`;
951
+ const S = document.createElement("input");
952
+ S.type = "number", S.className = "tbw-filter-range-input", S.min = String(h), S.max = String(C), S.step = String(k), S.value = String(E), I.appendChild(A), I.appendChild(S), T.appendChild(I);
953
+ const R = document.createElement("span");
954
+ R.className = "tbw-filter-range-separator", R.textContent = "–", T.appendChild(R);
955
+ const P = document.createElement("div");
956
+ P.className = "tbw-filter-range-group";
957
+ const L = document.createElement("label");
958
+ L.textContent = "Max", L.className = "tbw-filter-range-label";
959
+ const v = document.createElement("input");
960
+ v.type = "number", v.className = "tbw-filter-range-input", v.min = String(h), v.max = String(C), v.step = String(k), v.value = String(F), P.appendChild(L), P.appendChild(v), T.appendChild(P), e.appendChild(T);
961
+ const l = document.createElement("div");
962
+ l.className = "tbw-filter-range-slider";
963
+ const b = document.createElement("div");
964
+ b.className = "tbw-filter-range-track";
965
+ const m = document.createElement("div");
966
+ m.className = "tbw-filter-range-fill";
967
+ const o = document.createElement("input");
968
+ o.type = "range", o.className = "tbw-filter-range-thumb tbw-filter-range-thumb-min", o.min = String(h), o.max = String(C), o.step = String(k), o.value = String(E);
969
+ const c = document.createElement("input");
970
+ c.type = "range", c.className = "tbw-filter-range-thumb tbw-filter-range-thumb-max", c.min = String(h), c.max = String(C), c.step = String(k), c.value = String(F), l.appendChild(b), l.appendChild(m), l.appendChild(o), l.appendChild(c), e.appendChild(l);
971
+ const g = () => {
972
+ const p = parseFloat(o.value), D = parseFloat(c.value), z = C - h, q = (p - h) / z * 100, Y = (D - h) / z * 100;
973
+ m.style.left = `${q}%`, m.style.width = `${Y - q}%`;
962
974
  };
963
- n.addEventListener("input", () => {
964
- const b = Math.min(parseFloat(n.value), parseFloat(s.value));
965
- n.value = String(b), f.value = String(b), F();
966
- }), s.addEventListener("input", () => {
967
- const b = Math.max(parseFloat(s.value), parseFloat(n.value));
968
- s.value = String(b), p.value = String(b), F();
969
- }), f.addEventListener("input", () => {
970
- let b = parseFloat(f.value) || u;
971
- b = Math.max(u, Math.min(b, parseFloat(p.value))), n.value = String(b), F();
972
- }), p.addEventListener("input", () => {
973
- let b = parseFloat(p.value) || v;
974
- b = Math.min(v, Math.max(b, parseFloat(f.value))), s.value = String(b), F();
975
- }), F();
975
+ o.addEventListener("input", () => {
976
+ const p = Math.min(parseFloat(o.value), parseFloat(c.value));
977
+ o.value = String(p), S.value = String(p), g();
978
+ }), c.addEventListener("input", () => {
979
+ const p = Math.max(parseFloat(c.value), parseFloat(o.value));
980
+ c.value = String(p), v.value = String(p), g();
981
+ }), S.addEventListener("input", () => {
982
+ let p = parseFloat(S.value) || h;
983
+ p = Math.max(h, Math.min(p, parseFloat(v.value))), o.value = String(p), g();
984
+ }), v.addEventListener("input", () => {
985
+ let p = parseFloat(v.value) || C;
986
+ p = Math.min(C, Math.max(p, parseFloat(S.value))), c.value = String(p), g();
987
+ }), g();
976
988
  const M = document.createElement("div");
977
989
  M.className = "tbw-filter-buttons";
978
- const _ = document.createElement("button");
979
- _.className = "tbw-filter-apply-btn", _.textContent = "Apply", _.addEventListener("click", () => {
980
- const b = parseFloat(f.value), V = parseFloat(p.value);
981
- t.applyTextFilter("between", b, V);
982
- }), M.appendChild(_);
983
- const q = document.createElement("button");
984
- q.className = "tbw-filter-clear-btn", q.textContent = "Clear Filter", q.addEventListener("click", () => {
990
+ const H = document.createElement("button");
991
+ H.className = "tbw-filter-apply-btn", H.textContent = "Apply", H.addEventListener("click", () => {
992
+ const p = parseFloat(S.value), D = parseFloat(v.value);
993
+ t.applyTextFilter("between", p, D);
994
+ }), M.appendChild(H);
995
+ const d = document.createElement("button");
996
+ d.className = "tbw-filter-clear-btn", d.textContent = "Clear Filter", d.addEventListener("click", () => {
985
997
  t.clearFilter();
986
- }), M.appendChild(q), e.appendChild(M);
998
+ }), M.appendChild(d), e.appendChild(M);
987
999
  }
988
1000
  /**
989
1001
  * Render a date range filter panel with from/to date inputs
990
1002
  */
991
1003
  renderDateFilterPanel(e, t, r) {
992
- const { field: i, column: l } = t, c = l.filterParams, d = l.editorParams, a = r.filter((n) => n instanceof Date || typeof n == "string" && !isNaN(Date.parse(n))).map((n) => n instanceof Date ? n : new Date(n)).filter((n) => !isNaN(n.getTime())), m = a.length > 0 ? new Date(Math.min(...a.map((n) => n.getTime()))) : null, k = a.length > 0 ? new Date(Math.max(...a.map((n) => n.getTime()))) : null, w = (n) => n ? n.toISOString().split("T")[0] : "", u = (n) => n ? typeof n == "string" ? n : typeof n == "number" ? w(new Date(n)) : "" : "", v = u(c?.min) || u(d?.min) || w(m), E = u(c?.max) || u(d?.max) || w(k), g = this.filters.get(i);
993
- let x = "", S = "";
994
- g?.operator === "between" ? (x = u(g.value) || "", S = u(g.valueTo) || "") : g?.operator === "greaterThanOrEqual" ? x = u(g.value) || "" : g?.operator === "lessThanOrEqual" && (S = u(g.value) || "");
995
- const C = document.createElement("div");
996
- C.className = "tbw-filter-date-range";
997
- const R = document.createElement("div");
998
- R.className = "tbw-filter-date-group";
999
- const A = document.createElement("label");
1000
- A.textContent = "From", A.className = "tbw-filter-range-label";
1001
- const f = document.createElement("input");
1002
- f.type = "date", f.className = "tbw-filter-date-input", v && (f.min = v), E && (f.max = E), f.value = x, R.appendChild(A), R.appendChild(f), C.appendChild(R);
1003
- const L = document.createElement("span");
1004
- L.className = "tbw-filter-range-separator", L.textContent = "", C.appendChild(L);
1005
- const T = document.createElement("div");
1006
- T.className = "tbw-filter-date-group";
1007
- const P = document.createElement("label");
1008
- P.textContent = "To", P.className = "tbw-filter-range-label";
1009
- const p = document.createElement("input");
1010
- p.type = "date", p.className = "tbw-filter-date-input", v && (p.min = v), E && (p.max = E), p.value = S, T.appendChild(P), T.appendChild(p), C.appendChild(T), e.appendChild(C);
1011
- const o = document.createElement("div");
1012
- o.className = "tbw-filter-buttons";
1013
- const h = document.createElement("button");
1014
- h.className = "tbw-filter-apply-btn", h.textContent = "Apply", h.addEventListener("click", () => {
1015
- const n = f.value, s = p.value;
1016
- n && s ? t.applyTextFilter("between", n, s) : n ? t.applyTextFilter("greaterThanOrEqual", n) : s ? t.applyTextFilter("lessThanOrEqual", s) : t.clearFilter();
1017
- }), o.appendChild(h);
1018
- const y = document.createElement("button");
1019
- y.className = "tbw-filter-clear-btn", y.textContent = "Clear Filter", y.addEventListener("click", () => {
1004
+ const { field: n, column: a } = t, s = a.filterParams, u = a.editorParams, i = r.filter((d) => d instanceof Date || typeof d == "string" && !isNaN(Date.parse(d))).map((d) => d instanceof Date ? d : new Date(d)).filter((d) => !isNaN(d.getTime())), f = i.length > 0 ? new Date(Math.min(...i.map((d) => d.getTime()))) : null, N = i.length > 0 ? new Date(Math.max(...i.map((d) => d.getTime()))) : null, y = (d) => d ? d.toISOString().split("T")[0] : "", h = (d) => d ? typeof d == "string" ? d : typeof d == "number" ? y(new Date(d)) : "" : "", C = h(s?.min) || h(u?.min) || y(f), k = h(s?.max) || h(u?.max) || y(N), w = this.filters.get(n);
1005
+ let E = "", F = "";
1006
+ const T = w?.operator === "blank";
1007
+ w?.operator === "between" ? (E = h(w.value) || "", F = h(w.valueTo) || "") : w?.operator === "greaterThanOrEqual" ? E = h(w.value) || "" : w?.operator === "lessThanOrEqual" && (F = h(w.value) || "");
1008
+ const I = document.createElement("div");
1009
+ I.className = "tbw-filter-date-range";
1010
+ const A = document.createElement("div");
1011
+ A.className = "tbw-filter-date-group";
1012
+ const S = document.createElement("label");
1013
+ S.textContent = "From", S.className = "tbw-filter-range-label";
1014
+ const R = document.createElement("input");
1015
+ R.type = "date", R.className = "tbw-filter-date-input", C && (R.min = C), k && (R.max = k), R.value = E, A.appendChild(S), A.appendChild(R), I.appendChild(A);
1016
+ const P = document.createElement("span");
1017
+ P.className = "tbw-filter-range-separator", P.textContent = "–", I.appendChild(P);
1018
+ const L = document.createElement("div");
1019
+ L.className = "tbw-filter-date-group";
1020
+ const v = document.createElement("label");
1021
+ v.textContent = "To", v.className = "tbw-filter-range-label";
1022
+ const l = document.createElement("input");
1023
+ l.type = "date", l.className = "tbw-filter-date-input", C && (l.min = C), k && (l.max = k), l.value = F, L.appendChild(v), L.appendChild(l), I.appendChild(L), e.appendChild(I);
1024
+ const b = document.createElement("label");
1025
+ b.className = "tbw-filter-blank-option";
1026
+ const m = document.createElement("input");
1027
+ m.type = "checkbox", m.className = "tbw-filter-blank-checkbox", m.checked = T;
1028
+ const o = document.createTextNode("Show only blank");
1029
+ b.appendChild(m), b.appendChild(o);
1030
+ const c = (d) => {
1031
+ R.disabled = d, l.disabled = d, I.classList.toggle("tbw-filter-disabled", d);
1032
+ };
1033
+ c(T), m.addEventListener("change", () => {
1034
+ c(m.checked);
1035
+ }), e.appendChild(b);
1036
+ const g = document.createElement("div");
1037
+ g.className = "tbw-filter-buttons";
1038
+ const M = document.createElement("button");
1039
+ M.className = "tbw-filter-apply-btn", M.textContent = "Apply", M.addEventListener("click", () => {
1040
+ if (m.checked) {
1041
+ t.applyTextFilter("blank", "");
1042
+ return;
1043
+ }
1044
+ const d = R.value, p = l.value;
1045
+ d && p ? t.applyTextFilter("between", d, p) : d ? t.applyTextFilter("greaterThanOrEqual", d) : p ? t.applyTextFilter("lessThanOrEqual", p) : t.clearFilter();
1046
+ }), g.appendChild(M);
1047
+ const H = document.createElement("button");
1048
+ H.className = "tbw-filter-clear-btn", H.textContent = "Clear Filter", H.addEventListener("click", () => {
1020
1049
  t.clearFilter();
1021
- }), o.appendChild(y), e.appendChild(o);
1050
+ }), g.appendChild(H), e.appendChild(g);
1022
1051
  }
1023
1052
  /**
1024
1053
  * Apply a set filter (exclude values)
@@ -1034,31 +1063,31 @@ class I extends K {
1034
1063
  /**
1035
1064
  * Apply a text/number/date filter
1036
1065
  */
1037
- applyTextFilter(e, t, r, i) {
1066
+ applyTextFilter(e, t, r, n) {
1038
1067
  this.filters.set(e, {
1039
1068
  field: e,
1040
1069
  type: "text",
1041
1070
  operator: t,
1042
1071
  value: r,
1043
- valueTo: i
1072
+ valueTo: n
1044
1073
  }), this.applyFiltersInternal();
1045
1074
  }
1046
1075
  /**
1047
1076
  * Internal method to apply filters (sync or async based on config)
1048
1077
  */
1049
1078
  applyFiltersInternal() {
1050
- this.cachedResult = null, this.cacheKey = null;
1079
+ this.cachedResult = null, this.cacheKey = null, this.cachedInputSpot = null;
1051
1080
  const e = [...this.filters.values()];
1052
1081
  if (this.config.filterHandler) {
1053
1082
  const t = this.grid;
1054
1083
  t.setAttribute("aria-busy", "true");
1055
- const r = this.config.filterHandler(e, this.sourceRows), i = (l) => {
1056
- t.removeAttribute("aria-busy"), this.cachedResult = l, this.grid.rows = l, this.emit("filter-change", {
1084
+ const r = this.config.filterHandler(e, this.sourceRows), n = (a) => {
1085
+ t.removeAttribute("aria-busy"), this.cachedResult = a, this.grid.rows = a, this.emit("filter-change", {
1057
1086
  filters: e,
1058
- filteredRowCount: l.length
1087
+ filteredRowCount: a.length
1059
1088
  }), this.emitPluginEvent("filter-applied", { filters: e }), this.requestRender();
1060
1089
  };
1061
- r && typeof r.then == "function" ? r.then(i) : i(r);
1090
+ r && typeof r.then == "function" ? r.then(n) : n(r);
1062
1091
  return;
1063
1092
  }
1064
1093
  this.emit("filter-change", {
@@ -1100,11 +1129,11 @@ class I extends K {
1100
1129
  value: t.filter.value,
1101
1130
  valueTo: t.filter.valueTo
1102
1131
  };
1103
- this.filters.set(e, r), this.cachedResult = null, this.cacheKey = null;
1132
+ this.filters.set(e, r), this.cachedResult = null, this.cacheKey = null, this.cachedInputSpot = null;
1104
1133
  }
1105
1134
  // #endregion
1106
1135
  }
1107
1136
  export {
1108
- I as FilteringPlugin
1137
+ _ as FilteringPlugin
1109
1138
  };
1110
1139
  //# sourceMappingURL=index.js.map