@toolbox-web/grid 1.2.0 → 1.3.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.
- package/README.md +80 -22
- package/all.js +619 -571
- package/all.js.map +1 -1
- package/index.js +362 -302
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +64 -1
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/row-animation.d.ts +37 -0
- package/lib/core/internal/row-animation.d.ts.map +1 -0
- package/lib/core/types.d.ts +17 -0
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +82 -76
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/clipboard/types.d.ts +1 -0
- package/lib/plugins/clipboard/types.d.ts.map +1 -1
- package/lib/plugins/column-virtualization/index.js +43 -41
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +24 -22
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +83 -52
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js +22 -20
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts +11 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js +160 -125
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js +20 -18
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js +66 -64
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +51 -49
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js +17 -15
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +24 -22
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js +25 -23
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +49 -47
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/index.js +24 -22
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js +19 -17
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js +38 -36
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts +13 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.d.ts +1 -1
- package/lib/plugins/selection/index.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +118 -85
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +50 -6
- package/lib/plugins/selection/types.d.ts.map +1 -1
- package/lib/plugins/server-side/index.js +34 -32
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js +25 -23
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js +22 -20
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js +21 -19
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +21 -4
- package/public.d.ts +1 -1
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +19 -19
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +9 -9
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js +5 -5
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +2 -2
- package/umd/plugins/selection.umd.js.map +1 -1
|
@@ -113,9 +113,14 @@ export declare class FilteringPlugin extends BaseGridPlugin<FilterConfig> {
|
|
|
113
113
|
private excludedValues;
|
|
114
114
|
private panelAbortController;
|
|
115
115
|
private globalStylesInjected;
|
|
116
|
-
private static readonly
|
|
116
|
+
private static readonly DEFAULT_LIST_ITEM_HEIGHT;
|
|
117
117
|
private static readonly LIST_OVERSCAN;
|
|
118
118
|
private static readonly LIST_BYPASS_THRESHOLD;
|
|
119
|
+
/**
|
|
120
|
+
* Get the item height from CSS variable or fallback to default.
|
|
121
|
+
* Reads --tbw-filter-item-height from the panel element.
|
|
122
|
+
*/
|
|
123
|
+
private getListItemHeight;
|
|
119
124
|
/**
|
|
120
125
|
* Sync excludedValues map from a filter model (for set filters).
|
|
121
126
|
*/
|
|
@@ -174,6 +179,11 @@ export declare class FilteringPlugin extends BaseGridPlugin<FilterConfig> {
|
|
|
174
179
|
* Uses sourceRows to include all values regardless of current filter.
|
|
175
180
|
*/
|
|
176
181
|
getUniqueValues(field: string): unknown[];
|
|
182
|
+
/**
|
|
183
|
+
* Copy CSS classes and data attributes from grid to filter panel.
|
|
184
|
+
* This ensures theme classes (e.g., .eds-theme) cascade to the panel.
|
|
185
|
+
*/
|
|
186
|
+
private copyGridThemeContext;
|
|
177
187
|
/**
|
|
178
188
|
* Inject global styles for filter panel (rendered in document.body)
|
|
179
189
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilteringPlugin.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/plugins/filtering/FilteringPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjF,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIlE,OAAO,KAAK,EAAsB,YAAY,EAAE,WAAW,EAAqB,MAAM,SAAS,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
9
|
-
offsetY:
|
|
1
|
+
function _(h) {
|
|
2
|
+
const { totalRows: e, viewportHeight: t, scrollTop: r, rowHeight: n, overscan: i } = h, a = Math.ceil(t / n);
|
|
3
|
+
let o = Math.floor(r / n) - i;
|
|
4
|
+
o < 0 && (o = 0);
|
|
5
|
+
let l = o + a + i * 2;
|
|
6
|
+
return l > e && (l = e), l === e && o > 0 && (o = Math.max(0, l - a - i * 2)), {
|
|
7
|
+
start: o,
|
|
8
|
+
end: l,
|
|
9
|
+
offsetY: o * n,
|
|
10
10
|
totalHeight: e * n
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function M(h, e) {
|
|
14
14
|
return h <= e;
|
|
15
15
|
}
|
|
16
|
-
const
|
|
16
|
+
const H = '<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>', z = {
|
|
17
17
|
expand: "▶",
|
|
18
18
|
collapse: "▼",
|
|
19
19
|
sortAsc: "▲",
|
|
@@ -21,9 +21,11 @@ const _ = {
|
|
|
21
21
|
sortNone: "⇅",
|
|
22
22
|
submenuArrow: "▶",
|
|
23
23
|
dragHandle: "⋮⋮",
|
|
24
|
-
toolPanel: "☰"
|
|
24
|
+
toolPanel: "☰",
|
|
25
|
+
filter: H,
|
|
26
|
+
filterActive: H
|
|
25
27
|
};
|
|
26
|
-
class
|
|
28
|
+
class q {
|
|
27
29
|
/**
|
|
28
30
|
* Plugin dependencies - declare other plugins this one requires.
|
|
29
31
|
*
|
|
@@ -247,7 +249,7 @@ class M {
|
|
|
247
249
|
*/
|
|
248
250
|
get gridIcons() {
|
|
249
251
|
const e = this.grid?.gridConfig?.icons ?? {};
|
|
250
|
-
return { ...
|
|
252
|
+
return { ...z, ...e };
|
|
251
253
|
}
|
|
252
254
|
// #region Animation Helpers
|
|
253
255
|
/**
|
|
@@ -323,31 +325,31 @@ class M {
|
|
|
323
325
|
}
|
|
324
326
|
// #endregion
|
|
325
327
|
}
|
|
326
|
-
function
|
|
328
|
+
function B(h) {
|
|
327
329
|
return h.meta?.utility === !0;
|
|
328
330
|
}
|
|
329
|
-
function
|
|
331
|
+
function Y(h, e, t = !1) {
|
|
330
332
|
const r = h[e.field];
|
|
331
333
|
if (e.operator === "blank")
|
|
332
334
|
return r == null || r === "";
|
|
333
335
|
if (e.operator === "notBlank")
|
|
334
336
|
return r != null && r !== "";
|
|
335
337
|
if (r == null) return !1;
|
|
336
|
-
const n = String(r), i = t ? n : n.toLowerCase(),
|
|
338
|
+
const n = String(r), i = t ? n : n.toLowerCase(), a = t ? String(e.value) : String(e.value).toLowerCase();
|
|
337
339
|
switch (e.operator) {
|
|
338
340
|
// Text operators
|
|
339
341
|
case "contains":
|
|
340
|
-
return i.includes(
|
|
342
|
+
return i.includes(a);
|
|
341
343
|
case "notContains":
|
|
342
|
-
return !i.includes(
|
|
344
|
+
return !i.includes(a);
|
|
343
345
|
case "equals":
|
|
344
|
-
return i ===
|
|
346
|
+
return i === a;
|
|
345
347
|
case "notEquals":
|
|
346
|
-
return i !==
|
|
348
|
+
return i !== a;
|
|
347
349
|
case "startsWith":
|
|
348
|
-
return i.startsWith(
|
|
350
|
+
return i.startsWith(a);
|
|
349
351
|
case "endsWith":
|
|
350
|
-
return i.endsWith(
|
|
352
|
+
return i.endsWith(a);
|
|
351
353
|
// Number/Date operators (use raw numeric values)
|
|
352
354
|
case "lessThan":
|
|
353
355
|
return Number(r) < Number(e.value);
|
|
@@ -368,10 +370,10 @@ function q(h, e, t = !1) {
|
|
|
368
370
|
return !0;
|
|
369
371
|
}
|
|
370
372
|
}
|
|
371
|
-
function
|
|
372
|
-
return e.length ? h.filter((r) => e.every((n) =>
|
|
373
|
+
function D(h, e, t = !1) {
|
|
374
|
+
return e.length ? h.filter((r) => e.every((n) => Y(r, n, t))) : h;
|
|
373
375
|
}
|
|
374
|
-
function
|
|
376
|
+
function $(h) {
|
|
375
377
|
return JSON.stringify(
|
|
376
378
|
h.map((e) => ({
|
|
377
379
|
field: e.field,
|
|
@@ -381,7 +383,7 @@ function Y(h) {
|
|
|
381
383
|
}))
|
|
382
384
|
);
|
|
383
385
|
}
|
|
384
|
-
function
|
|
386
|
+
function V(h, e) {
|
|
385
387
|
const t = /* @__PURE__ */ new Set();
|
|
386
388
|
for (const r of h) {
|
|
387
389
|
const n = r[e];
|
|
@@ -389,8 +391,8 @@ function H(h, e) {
|
|
|
389
391
|
}
|
|
390
392
|
return [...t].sort((r, n) => typeof r == "number" && typeof n == "number" ? r - n : String(r).localeCompare(String(n)));
|
|
391
393
|
}
|
|
392
|
-
const G = '@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:inline-flex;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;color:inherit;vertical-align:middle}tbw-grid .tbw-filter-btn:hover,tbw-grid .tbw-filter-btn.active{opacity:1}tbw-grid .tbw-filter-btn.active{color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}}',
|
|
393
|
-
class
|
|
394
|
+
const G = '@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;color:inherit;vertical-align:middle}tbw-grid .tbw-filter-btn:hover,tbw-grid .tbw-filter-btn.active{opacity:1;visibility:visible}tbw-grid .tbw-filter-btn.active{color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6))}}', K = "@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))}.tbw-filter-search-input{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)))}.tbw-filter-action-btn{background:transparent;border:none;color:var(--tbw-filter-accent, var(--tbw-color-accent, #3b82f6));cursor:pointer;font-size:var(--tbw-font-size-xs, .75rem);padding:2px 0}.tbw-filter-action-btn:hover{text-decoration:underline}.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;min-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)))}}";
|
|
395
|
+
class v extends q {
|
|
394
396
|
/** @internal */
|
|
395
397
|
name = "filtering";
|
|
396
398
|
/** @internal */
|
|
@@ -418,10 +420,25 @@ class g extends M {
|
|
|
418
420
|
// For panel-scoped listeners
|
|
419
421
|
globalStylesInjected = !1;
|
|
420
422
|
// Virtualization constants for filter value list
|
|
421
|
-
static
|
|
423
|
+
static DEFAULT_LIST_ITEM_HEIGHT = 28;
|
|
422
424
|
static LIST_OVERSCAN = 3;
|
|
423
425
|
static LIST_BYPASS_THRESHOLD = 50;
|
|
424
426
|
// Don't virtualize if < 50 items
|
|
427
|
+
/**
|
|
428
|
+
* Get the item height from CSS variable or fallback to default.
|
|
429
|
+
* Reads --tbw-filter-item-height from the panel element.
|
|
430
|
+
*/
|
|
431
|
+
getListItemHeight() {
|
|
432
|
+
if (this.panelElement) {
|
|
433
|
+
const e = getComputedStyle(this.panelElement).getPropertyValue("--tbw-filter-item-height");
|
|
434
|
+
if (e && e.trim()) {
|
|
435
|
+
const t = parseFloat(e);
|
|
436
|
+
if (!isNaN(t) && t > 0)
|
|
437
|
+
return t;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return v.DEFAULT_LIST_ITEM_HEIGHT;
|
|
441
|
+
}
|
|
425
442
|
/**
|
|
426
443
|
* Sync excludedValues map from a filter model (for set filters).
|
|
427
444
|
*/
|
|
@@ -446,10 +463,10 @@ class g extends M {
|
|
|
446
463
|
if (!t.length) return [...e];
|
|
447
464
|
if (this.config.filterHandler)
|
|
448
465
|
return this.cachedResult ? this.cachedResult : [...e];
|
|
449
|
-
const r =
|
|
466
|
+
const r = $(t);
|
|
450
467
|
if (this.cacheKey === r && this.cachedResult)
|
|
451
468
|
return this.cachedResult;
|
|
452
|
-
const n =
|
|
469
|
+
const n = D([...e], t, this.config.caseSensitive);
|
|
453
470
|
return this.cachedResult = n, this.cacheKey = r, n;
|
|
454
471
|
}
|
|
455
472
|
/** @internal */
|
|
@@ -460,20 +477,26 @@ class g extends M {
|
|
|
460
477
|
const n = r.getAttribute("data-col");
|
|
461
478
|
if (n === null) return;
|
|
462
479
|
const i = this.visibleColumns[parseInt(n, 10)];
|
|
463
|
-
if (!i || i.filterable === !1 ||
|
|
464
|
-
const
|
|
465
|
-
if (!
|
|
466
|
-
const
|
|
467
|
-
let
|
|
468
|
-
if (
|
|
469
|
-
|
|
480
|
+
if (!i || i.filterable === !1 || B(i)) return;
|
|
481
|
+
const a = i.field;
|
|
482
|
+
if (!a) return;
|
|
483
|
+
const o = this.filters.has(a);
|
|
484
|
+
let l = r.querySelector(".tbw-filter-btn");
|
|
485
|
+
if (l) {
|
|
486
|
+
const b = l.classList.contains("active");
|
|
487
|
+
if (l.classList.toggle("active", o), r.classList.toggle("filtered", o), b !== o) {
|
|
488
|
+
const E = o ? "filterActive" : "filter";
|
|
489
|
+
this.setIcon(l, this.resolveIcon(E));
|
|
490
|
+
}
|
|
470
491
|
return;
|
|
471
492
|
}
|
|
472
|
-
|
|
473
|
-
|
|
493
|
+
l = document.createElement("button"), l.className = "tbw-filter-btn", l.setAttribute("aria-label", `Filter ${i.header ?? a}`);
|
|
494
|
+
const m = o ? "filterActive" : "filter";
|
|
495
|
+
this.setIcon(l, this.resolveIcon(m)), o && (l.classList.add("active"), r.classList.add("filtered")), l.addEventListener("click", (b) => {
|
|
496
|
+
b.stopPropagation(), this.toggleFilterPanel(a, i, l);
|
|
474
497
|
});
|
|
475
498
|
const p = r.querySelector(".resize-handle");
|
|
476
|
-
p ? r.insertBefore(
|
|
499
|
+
p ? r.insertBefore(l, p) : r.appendChild(l);
|
|
477
500
|
});
|
|
478
501
|
}
|
|
479
502
|
// #endregion
|
|
@@ -560,10 +583,22 @@ class g extends M {
|
|
|
560
583
|
* Uses sourceRows to include all values regardless of current filter.
|
|
561
584
|
*/
|
|
562
585
|
getUniqueValues(e) {
|
|
563
|
-
return
|
|
586
|
+
return V(this.sourceRows, e);
|
|
564
587
|
}
|
|
565
588
|
// #endregion
|
|
566
589
|
// #region Private Methods
|
|
590
|
+
/**
|
|
591
|
+
* Copy CSS classes and data attributes from grid to filter panel.
|
|
592
|
+
* This ensures theme classes (e.g., .eds-theme) cascade to the panel.
|
|
593
|
+
*/
|
|
594
|
+
copyGridThemeContext(e) {
|
|
595
|
+
const t = this.gridElement;
|
|
596
|
+
if (!t) return;
|
|
597
|
+
for (const n of t.classList)
|
|
598
|
+
n.startsWith("tbw-") || n === "selecting" || e.classList.add(n);
|
|
599
|
+
const r = t.dataset.theme;
|
|
600
|
+
r && (e.dataset.theme = r);
|
|
601
|
+
}
|
|
567
602
|
/**
|
|
568
603
|
* Inject global styles for filter panel (rendered in document.body)
|
|
569
604
|
*/
|
|
@@ -574,7 +609,7 @@ class g extends M {
|
|
|
574
609
|
return;
|
|
575
610
|
}
|
|
576
611
|
const e = document.createElement("style");
|
|
577
|
-
e.id = "tbw-filter-panel-styles", e.textContent =
|
|
612
|
+
e.id = "tbw-filter-panel-styles", e.textContent = K, document.head.appendChild(e), this.globalStylesInjected = !0;
|
|
578
613
|
}
|
|
579
614
|
/**
|
|
580
615
|
* Toggle the filter panel for a field
|
|
@@ -586,13 +621,13 @@ class g extends M {
|
|
|
586
621
|
}
|
|
587
622
|
this.closeFilterPanel();
|
|
588
623
|
const n = document.createElement("div");
|
|
589
|
-
if (n.className = "tbw-filter-panel", this.isAnimationEnabled && n.classList.add("tbw-filter-panel-animated"), this.panelElement = n, this.openPanelField = e, this.config.valuesHandler) {
|
|
590
|
-
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((
|
|
591
|
-
this.openPanelField !== e || !this.panelElement || (n.innerHTML = "", this.renderPanelContent(e, t, n,
|
|
624
|
+
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) {
|
|
625
|
+
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((a) => {
|
|
626
|
+
this.openPanelField !== e || !this.panelElement || (n.innerHTML = "", this.renderPanelContent(e, t, n, a));
|
|
592
627
|
});
|
|
593
628
|
return;
|
|
594
629
|
}
|
|
595
|
-
const i =
|
|
630
|
+
const i = V(this.sourceRows, e);
|
|
596
631
|
this.renderPanelContent(e, t, n, i), document.body.appendChild(n), this.positionPanel(n, r), this.setupPanelCloseHandler(n, r);
|
|
597
632
|
}
|
|
598
633
|
/**
|
|
@@ -601,25 +636,25 @@ class g extends M {
|
|
|
601
636
|
renderPanelContent(e, t, r, n) {
|
|
602
637
|
let i = this.excludedValues.get(e);
|
|
603
638
|
i || (i = /* @__PURE__ */ new Set(), this.excludedValues.set(e, i));
|
|
604
|
-
const
|
|
639
|
+
const a = this.searchText.get(e) ?? "", o = {
|
|
605
640
|
field: e,
|
|
606
641
|
column: t,
|
|
607
642
|
uniqueValues: n,
|
|
608
643
|
excludedValues: i,
|
|
609
|
-
searchText:
|
|
610
|
-
applySetFilter: (
|
|
611
|
-
this.applySetFilter(e,
|
|
644
|
+
searchText: a,
|
|
645
|
+
applySetFilter: (m) => {
|
|
646
|
+
this.applySetFilter(e, m), this.closeFilterPanel();
|
|
612
647
|
},
|
|
613
|
-
applyTextFilter: (p, b
|
|
614
|
-
this.applyTextFilter(e, p, b
|
|
648
|
+
applyTextFilter: (m, p, b) => {
|
|
649
|
+
this.applyTextFilter(e, m, p, b), this.closeFilterPanel();
|
|
615
650
|
},
|
|
616
651
|
clearFilter: () => {
|
|
617
652
|
this.clearFieldFilter(e), this.closeFilterPanel();
|
|
618
653
|
},
|
|
619
654
|
closePanel: () => this.closeFilterPanel()
|
|
620
655
|
};
|
|
621
|
-
let
|
|
622
|
-
this.config.filterPanelRenderer && (this.config.filterPanelRenderer(r,
|
|
656
|
+
let l = !1;
|
|
657
|
+
this.config.filterPanelRenderer && (this.config.filterPanelRenderer(r, o), l = r.children.length > 0), l || this.renderDefaultFilterPanel(r, o, n, i);
|
|
623
658
|
}
|
|
624
659
|
/**
|
|
625
660
|
* Setup click-outside handler to close the panel
|
|
@@ -648,7 +683,7 @@ class g extends M {
|
|
|
648
683
|
* Check if browser supports CSS Anchor Positioning
|
|
649
684
|
*/
|
|
650
685
|
static checkAnchorPositioningSupport() {
|
|
651
|
-
return
|
|
686
|
+
return v.supportsAnchorPositioning === null && (v.supportsAnchorPositioning = CSS.supports("anchor-name", "--test")), v.supportsAnchorPositioning;
|
|
652
687
|
}
|
|
653
688
|
/**
|
|
654
689
|
* Position the panel below the header cell
|
|
@@ -656,116 +691,116 @@ class g extends M {
|
|
|
656
691
|
*/
|
|
657
692
|
positionPanel(e, t) {
|
|
658
693
|
const n = t.closest(".cell") ?? t;
|
|
659
|
-
if (n.style.anchorName = "--tbw-filter-anchor", this.panelAnchorElement = n,
|
|
694
|
+
if (n.style.anchorName = "--tbw-filter-anchor", this.panelAnchorElement = n, v.checkAnchorPositioningSupport()) {
|
|
660
695
|
requestAnimationFrame(() => {
|
|
661
|
-
const
|
|
662
|
-
|
|
696
|
+
const a = e.getBoundingClientRect(), o = n.getBoundingClientRect();
|
|
697
|
+
a.top < o.top && e.classList.add("tbw-filter-panel-above");
|
|
663
698
|
});
|
|
664
699
|
return;
|
|
665
700
|
}
|
|
666
701
|
const i = n.getBoundingClientRect();
|
|
667
702
|
e.style.position = "fixed", e.style.top = `${i.bottom + 4}px`, e.style.left = `${i.left}px`, requestAnimationFrame(() => {
|
|
668
|
-
const
|
|
669
|
-
|
|
703
|
+
const a = e.getBoundingClientRect();
|
|
704
|
+
a.right > window.innerWidth - 8 && (e.style.left = `${i.right - a.width}px`), a.bottom > window.innerHeight - 8 && (e.style.top = `${i.top - a.height - 4}px`, e.classList.add("tbw-filter-panel-above"));
|
|
670
705
|
});
|
|
671
706
|
}
|
|
672
707
|
/**
|
|
673
708
|
* Render the default filter panel content
|
|
674
709
|
*/
|
|
675
710
|
renderDefaultFilterPanel(e, t, r, n) {
|
|
676
|
-
const { field: i } = t,
|
|
677
|
-
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
const
|
|
681
|
-
|
|
711
|
+
const { field: i } = t, a = this.getListItemHeight(), o = document.createElement("div");
|
|
712
|
+
o.className = "tbw-filter-search";
|
|
713
|
+
const l = document.createElement("input");
|
|
714
|
+
l.type = "text", l.placeholder = "Search...", l.className = "tbw-filter-search-input", l.value = this.searchText.get(i) ?? "", o.appendChild(l), e.appendChild(o);
|
|
715
|
+
const m = document.createElement("div");
|
|
716
|
+
m.className = "tbw-filter-actions";
|
|
682
717
|
const p = document.createElement("label");
|
|
683
718
|
p.className = "tbw-filter-value-item", p.style.padding = "0", p.style.margin = "0";
|
|
684
719
|
const b = document.createElement("input");
|
|
685
720
|
b.type = "checkbox", b.className = "tbw-filter-checkbox";
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
const
|
|
689
|
-
const s = [...
|
|
721
|
+
const E = document.createElement("span");
|
|
722
|
+
E.textContent = "Select All", p.appendChild(b), p.appendChild(E), m.appendChild(p);
|
|
723
|
+
const F = () => {
|
|
724
|
+
const s = [...x.values()], u = s.every((c) => c), w = s.every((c) => !c);
|
|
690
725
|
b.checked = u, b.indeterminate = !u && !w;
|
|
691
726
|
};
|
|
692
727
|
b.addEventListener("change", () => {
|
|
693
728
|
const s = b.checked;
|
|
694
|
-
for (const u of
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
}), e.appendChild(
|
|
698
|
-
const
|
|
699
|
-
|
|
700
|
-
const
|
|
701
|
-
|
|
702
|
-
const
|
|
703
|
-
|
|
704
|
-
const
|
|
729
|
+
for (const u of x.keys())
|
|
730
|
+
x.set(u, s);
|
|
731
|
+
F(), T();
|
|
732
|
+
}), e.appendChild(m);
|
|
733
|
+
const y = document.createElement("div");
|
|
734
|
+
y.className = "tbw-filter-values";
|
|
735
|
+
const S = document.createElement("div");
|
|
736
|
+
S.className = "tbw-filter-values-spacer", y.appendChild(S);
|
|
737
|
+
const g = document.createElement("div");
|
|
738
|
+
g.className = "tbw-filter-values-content", y.appendChild(g);
|
|
739
|
+
const x = /* @__PURE__ */ new Map();
|
|
705
740
|
r.forEach((s) => {
|
|
706
741
|
const u = s == null ? "__null__" : String(s);
|
|
707
|
-
|
|
708
|
-
}),
|
|
709
|
-
let
|
|
710
|
-
const
|
|
742
|
+
x.set(u, !n.has(s));
|
|
743
|
+
}), F();
|
|
744
|
+
let C = [];
|
|
745
|
+
const I = (s, u) => {
|
|
711
746
|
const w = s == null ? "(Blank)" : String(s), c = s == null ? "__null__" : String(s), d = document.createElement("label");
|
|
712
|
-
d.className = "tbw-filter-value-item", d.style.position = "absolute", d.style.top = `${u *
|
|
747
|
+
d.className = "tbw-filter-value-item", d.style.position = "absolute", d.style.top = `${u * a}px`, d.style.left = "0", d.style.right = "0", d.style.height = `${a}px`, d.style.boxSizing = "border-box";
|
|
713
748
|
const f = document.createElement("input");
|
|
714
|
-
f.type = "checkbox", f.className = "tbw-filter-checkbox", f.checked =
|
|
715
|
-
|
|
749
|
+
f.type = "checkbox", f.className = "tbw-filter-checkbox", f.checked = x.get(c) ?? !0, f.dataset.value = c, f.addEventListener("change", () => {
|
|
750
|
+
x.set(c, f.checked), F();
|
|
716
751
|
});
|
|
717
|
-
const
|
|
718
|
-
return
|
|
719
|
-
},
|
|
720
|
-
const s =
|
|
721
|
-
if (
|
|
722
|
-
|
|
723
|
-
|
|
752
|
+
const P = document.createElement("span");
|
|
753
|
+
return P.textContent = w, d.appendChild(f), d.appendChild(P), d;
|
|
754
|
+
}, T = () => {
|
|
755
|
+
const s = C.length, u = y.clientHeight, w = y.scrollTop;
|
|
756
|
+
if (S.style.height = `${s * a}px`, M(s, v.LIST_BYPASS_THRESHOLD / 3)) {
|
|
757
|
+
g.innerHTML = "", g.style.transform = "translateY(0px)", C.forEach((d, f) => {
|
|
758
|
+
g.appendChild(I(d, f));
|
|
724
759
|
});
|
|
725
760
|
return;
|
|
726
761
|
}
|
|
727
|
-
const c =
|
|
762
|
+
const c = _({
|
|
728
763
|
totalRows: s,
|
|
729
764
|
viewportHeight: u,
|
|
730
765
|
scrollTop: w,
|
|
731
|
-
rowHeight:
|
|
732
|
-
overscan:
|
|
766
|
+
rowHeight: a,
|
|
767
|
+
overscan: v.LIST_OVERSCAN
|
|
733
768
|
});
|
|
734
|
-
|
|
769
|
+
g.style.transform = `translateY(${c.offsetY}px)`, g.innerHTML = "";
|
|
735
770
|
for (let d = c.start; d < c.end; d++)
|
|
736
|
-
|
|
737
|
-
},
|
|
771
|
+
g.appendChild(I(C[d], d - c.start));
|
|
772
|
+
}, L = (s) => {
|
|
738
773
|
const u = this.config.caseSensitive ?? !1, w = u ? s : s.toLowerCase();
|
|
739
|
-
if (
|
|
774
|
+
if (C = r.filter((c) => {
|
|
740
775
|
const d = c == null ? "(Blank)" : String(c), f = u ? d : d.toLowerCase();
|
|
741
776
|
return !s || f.includes(w);
|
|
742
|
-
}),
|
|
743
|
-
|
|
777
|
+
}), C.length === 0) {
|
|
778
|
+
S.style.height = "0px", g.innerHTML = "";
|
|
744
779
|
const c = document.createElement("div");
|
|
745
|
-
c.className = "tbw-filter-no-match", c.textContent = "No matching values",
|
|
780
|
+
c.className = "tbw-filter-no-match", c.textContent = "No matching values", g.appendChild(c);
|
|
746
781
|
return;
|
|
747
782
|
}
|
|
748
|
-
|
|
783
|
+
T();
|
|
749
784
|
};
|
|
750
|
-
|
|
785
|
+
y.addEventListener(
|
|
751
786
|
"scroll",
|
|
752
787
|
() => {
|
|
753
|
-
|
|
788
|
+
C.length > 0 && T();
|
|
754
789
|
},
|
|
755
790
|
{ passive: !0 }
|
|
756
|
-
),
|
|
757
|
-
let
|
|
758
|
-
|
|
759
|
-
clearTimeout(
|
|
760
|
-
this.searchText.set(i,
|
|
791
|
+
), L(l.value), e.appendChild(y);
|
|
792
|
+
let N;
|
|
793
|
+
l.addEventListener("input", () => {
|
|
794
|
+
clearTimeout(N), N = setTimeout(() => {
|
|
795
|
+
this.searchText.set(i, l.value), L(l.value);
|
|
761
796
|
}, this.config.debounceMs ?? 150);
|
|
762
797
|
});
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
const
|
|
766
|
-
|
|
798
|
+
const R = document.createElement("div");
|
|
799
|
+
R.className = "tbw-filter-buttons";
|
|
800
|
+
const k = document.createElement("button");
|
|
801
|
+
k.className = "tbw-filter-apply-btn", k.textContent = "Apply", k.addEventListener("click", () => {
|
|
767
802
|
const s = [];
|
|
768
|
-
for (const [u, w] of
|
|
803
|
+
for (const [u, w] of x)
|
|
769
804
|
if (!w)
|
|
770
805
|
if (u === "__null__")
|
|
771
806
|
s.push(null);
|
|
@@ -774,11 +809,11 @@ class g extends M {
|
|
|
774
809
|
s.push(c !== void 0 ? c : u);
|
|
775
810
|
}
|
|
776
811
|
t.applySetFilter(s);
|
|
777
|
-
}),
|
|
778
|
-
const
|
|
779
|
-
|
|
812
|
+
}), R.appendChild(k);
|
|
813
|
+
const A = document.createElement("button");
|
|
814
|
+
A.className = "tbw-filter-clear-btn", A.textContent = "Clear Filter", A.addEventListener("click", () => {
|
|
780
815
|
t.clearFilter();
|
|
781
|
-
}),
|
|
816
|
+
}), R.appendChild(A), e.appendChild(R);
|
|
782
817
|
}
|
|
783
818
|
/**
|
|
784
819
|
* Apply a set filter (exclude values)
|
|
@@ -865,6 +900,6 @@ class g extends M {
|
|
|
865
900
|
// #endregion
|
|
866
901
|
}
|
|
867
902
|
export {
|
|
868
|
-
|
|
903
|
+
v as FilteringPlugin
|
|
869
904
|
};
|
|
870
905
|
//# sourceMappingURL=index.js.map
|