@alaarab/ogrid-angular-primeng 2.5.9 → 2.6.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/dist/esm/column-chooser/column-chooser.component.js +131 -0
- package/dist/esm/column-header-filter/column-header-filter.component.js +465 -0
- package/dist/esm/column-header-menu/column-header-menu.component.js +68 -0
- package/dist/esm/datagrid-table/datagrid-table.component.js +1229 -0
- package/dist/esm/datagrid-table/inline-cell-editor.component.js +154 -0
- package/dist/esm/datagrid-table/popover-cell-editor.component.js +30 -0
- package/dist/esm/index.js +16 -1152
- package/dist/esm/ogrid/ogrid.component.js +178 -0
- package/dist/esm/pagination-controls/pagination-controls.component.js +212 -0
- package/dist/types/column-chooser/column-chooser.component.d.ts +3 -0
- package/dist/types/column-header-filter/column-header-filter.component.d.ts +3 -0
- package/dist/types/column-header-menu/column-header-menu.component.d.ts +3 -0
- package/dist/types/datagrid-table/datagrid-table.component.d.ts +3 -0
- package/dist/types/datagrid-table/inline-cell-editor.component.d.ts +3 -0
- package/dist/types/datagrid-table/popover-cell-editor.component.d.ts +3 -0
- package/dist/types/ogrid/ogrid.component.d.ts +3 -0
- package/dist/types/pagination-controls/pagination-controls.component.d.ts +3 -0
- package/package.json +3 -3
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { BaseColumnChooserComponent } from '@alaarab/ogrid-angular';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
const _forTrack0 = ($index, $item) => $item.columnId;
|
|
5
|
+
function ColumnChooserComponent_Conditional_8_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
6
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
7
|
+
i0.ɵɵdomElementStart(0, "label", 5)(1, "input", 8);
|
|
8
|
+
i0.ɵɵdomListener("change", function ColumnChooserComponent_Conditional_8_For_4_Template_input_change_1_listener($event) { const col_r3 = i0.ɵɵrestoreView(_r2).$implicit; const ctx_r3 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r3.onToggle(col_r3.columnId, $event.target.checked)); });
|
|
9
|
+
i0.ɵɵdomElementEnd();
|
|
10
|
+
i0.ɵɵtext(2);
|
|
11
|
+
i0.ɵɵdomElementEnd();
|
|
12
|
+
} if (rf & 2) {
|
|
13
|
+
const col_r3 = ctx.$implicit;
|
|
14
|
+
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
15
|
+
i0.ɵɵadvance();
|
|
16
|
+
i0.ɵɵdomProperty("checked", ctx_r3.visibleColumns.has(col_r3.columnId))("disabled", col_r3.required === true);
|
|
17
|
+
i0.ɵɵadvance();
|
|
18
|
+
i0.ɵɵtextInterpolate1(" ", col_r3.name, " ");
|
|
19
|
+
} }
|
|
20
|
+
function ColumnChooserComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
21
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
22
|
+
i0.ɵɵdomElementStart(0, "div", 3)(1, "div", 4);
|
|
23
|
+
i0.ɵɵtext(2);
|
|
24
|
+
i0.ɵɵdomElementEnd();
|
|
25
|
+
i0.ɵɵrepeaterCreate(3, ColumnChooserComponent_Conditional_8_For_4_Template, 3, 3, "label", 5, _forTrack0);
|
|
26
|
+
i0.ɵɵdomElementStart(5, "div", 6)(6, "button", 7);
|
|
27
|
+
i0.ɵɵdomListener("click", function ColumnChooserComponent_Conditional_8_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r1); const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.onClearAll()); });
|
|
28
|
+
i0.ɵɵtext(7, "Clear All");
|
|
29
|
+
i0.ɵɵdomElementEnd();
|
|
30
|
+
i0.ɵɵdomElementStart(8, "button", 7);
|
|
31
|
+
i0.ɵɵdomListener("click", function ColumnChooserComponent_Conditional_8_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r1); const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.onSelectAll()); });
|
|
32
|
+
i0.ɵɵtext(9, "Select All");
|
|
33
|
+
i0.ɵɵdomElementEnd()()();
|
|
34
|
+
} if (rf & 2) {
|
|
35
|
+
const ctx_r3 = i0.ɵɵnextContext();
|
|
36
|
+
i0.ɵɵadvance(2);
|
|
37
|
+
i0.ɵɵtextInterpolate2(" Select Columns (", ctx_r3.visibleCount(), " of ", ctx_r3.totalCount(), ") ");
|
|
38
|
+
i0.ɵɵadvance();
|
|
39
|
+
i0.ɵɵrepeater(ctx_r3.columns);
|
|
40
|
+
} }
|
|
41
|
+
export class ColumnChooserComponent extends BaseColumnChooserComponent {
|
|
42
|
+
// PrimeNG uses 'open' instead of 'isOpen'
|
|
43
|
+
get open() {
|
|
44
|
+
return this.isOpen;
|
|
45
|
+
}
|
|
46
|
+
static { this.ɵfac = /*@__PURE__*/ (() => { let ɵColumnChooserComponent_BaseFactory; return function ColumnChooserComponent_Factory(__ngFactoryType__) { return (ɵColumnChooserComponent_BaseFactory || (ɵColumnChooserComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ColumnChooserComponent)))(__ngFactoryType__ || ColumnChooserComponent); }; })(); }
|
|
47
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ColumnChooserComponent, selectors: [["ogrid-primeng-column-chooser"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 9, vars: 5, consts: [[2, "position", "relative", "display", "inline-block"], ["type", "button", "aria-haspopup", "listbox", 1, "p-button", "p-button-text", "p-button-sm", 2, "display", "flex", "align-items", "center", "gap", "6px", "font-size", "13px", 3, "click"], ["aria-hidden", ""], [2, "position", "absolute", "right", "0", "top", "100%", "z-index", "1000", "min-width", "220px", "max-height", "320px", "overflow-y", "auto", "background", "var(--ogrid-bg, #fff)", "border", "1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))", "border-radius", "6px", "box-shadow", "0 2px 8px rgba(0,0,0,0.12)", "padding", "8px 0"], [2, "padding", "4px 12px", "font-weight", "600", "font-size", "12px", "color", "var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6))"], [2, "display", "flex", "align-items", "center", "gap", "8px", "padding", "4px 12px", "cursor", "pointer", "font-size", "13px"], [2, "display", "flex", "gap", "4px", "padding", "8px 12px", "border-top", "1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))", "margin-top", "4px"], ["type", "button", 1, "p-button", "p-button-text", "p-button-sm", 2, "flex", "1", "font-size", "12px", 3, "click"], ["type", "checkbox", 3, "change", "checked", "disabled"]], template: function ColumnChooserComponent_Template(rf, ctx) { if (rf & 1) {
|
|
48
|
+
i0.ɵɵdomElementStart(0, "div", 0)(1, "button", 1);
|
|
49
|
+
i0.ɵɵdomListener("click", function ColumnChooserComponent_Template_button_click_1_listener() { return ctx.open.set(!ctx.open()); });
|
|
50
|
+
i0.ɵɵdomElementStart(2, "span", 2);
|
|
51
|
+
i0.ɵɵtext(3, "\u2699");
|
|
52
|
+
i0.ɵɵdomElementEnd();
|
|
53
|
+
i0.ɵɵdomElementStart(4, "span");
|
|
54
|
+
i0.ɵɵtext(5);
|
|
55
|
+
i0.ɵɵdomElementEnd();
|
|
56
|
+
i0.ɵɵdomElementStart(6, "span", 2);
|
|
57
|
+
i0.ɵɵtext(7);
|
|
58
|
+
i0.ɵɵdomElementEnd()();
|
|
59
|
+
i0.ɵɵconditionalCreate(8, ColumnChooserComponent_Conditional_8_Template, 10, 2, "div", 3);
|
|
60
|
+
i0.ɵɵdomElementEnd();
|
|
61
|
+
} if (rf & 2) {
|
|
62
|
+
i0.ɵɵadvance();
|
|
63
|
+
i0.ɵɵattribute("aria-expanded", ctx.open());
|
|
64
|
+
i0.ɵɵadvance(4);
|
|
65
|
+
i0.ɵɵtextInterpolate2("Column Visibility (", ctx.visibleCount(), " of ", ctx.totalCount(), ")");
|
|
66
|
+
i0.ɵɵadvance(2);
|
|
67
|
+
i0.ɵɵtextInterpolate(ctx.open() ? "\u25B2" : "\u25BC");
|
|
68
|
+
i0.ɵɵadvance();
|
|
69
|
+
i0.ɵɵconditional(ctx.open() ? 8 : -1);
|
|
70
|
+
} }, encapsulation: 2, changeDetection: 0 }); }
|
|
71
|
+
}
|
|
72
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ColumnChooserComponent, [{
|
|
73
|
+
type: Component,
|
|
74
|
+
args: [{
|
|
75
|
+
selector: 'ogrid-primeng-column-chooser',
|
|
76
|
+
standalone: true,
|
|
77
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
78
|
+
template: `
|
|
79
|
+
<div style="position:relative;display:inline-block">
|
|
80
|
+
<button
|
|
81
|
+
type="button"
|
|
82
|
+
class="p-button p-button-text p-button-sm"
|
|
83
|
+
(click)="open.set(!open())"
|
|
84
|
+
[attr.aria-expanded]="open()"
|
|
85
|
+
aria-haspopup="listbox"
|
|
86
|
+
style="display:flex;align-items:center;gap:6px;font-size:13px"
|
|
87
|
+
>
|
|
88
|
+
<span aria-hidden>⚙</span>
|
|
89
|
+
<span>Column Visibility ({{ visibleCount() }} of {{ totalCount() }})</span>
|
|
90
|
+
<span aria-hidden>{{ open() ? '\u25B2' : '\u25BC' }}</span>
|
|
91
|
+
</button>
|
|
92
|
+
|
|
93
|
+
@if (open()) {
|
|
94
|
+
<div
|
|
95
|
+
style="position:absolute;right:0;top:100%;z-index:1000;min-width:220px;max-height:320px;overflow-y:auto;background:var(--ogrid-bg, #fff);border:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));border-radius:6px;box-shadow:0 2px 8px rgba(0,0,0,0.12);padding:8px 0"
|
|
96
|
+
>
|
|
97
|
+
<div style="padding:4px 12px;font-weight:600;font-size:12px;color:var(--ogrid-fg-secondary, rgba(0, 0, 0, 0.6))">
|
|
98
|
+
Select Columns ({{ visibleCount() }} of {{ totalCount() }})
|
|
99
|
+
</div>
|
|
100
|
+
@for (col of columns; track col.columnId) {
|
|
101
|
+
<label style="display:flex;align-items:center;gap:8px;padding:4px 12px;cursor:pointer;font-size:13px">
|
|
102
|
+
<input
|
|
103
|
+
type="checkbox"
|
|
104
|
+
[checked]="visibleColumns.has(col.columnId)"
|
|
105
|
+
(change)="onToggle(col.columnId, $any($event.target).checked)"
|
|
106
|
+
[disabled]="col.required === true"
|
|
107
|
+
/>
|
|
108
|
+
{{ col.name }}
|
|
109
|
+
</label>
|
|
110
|
+
}
|
|
111
|
+
<div style="display:flex;gap:4px;padding:8px 12px;border-top:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));margin-top:4px">
|
|
112
|
+
<button
|
|
113
|
+
type="button"
|
|
114
|
+
class="p-button p-button-text p-button-sm"
|
|
115
|
+
(click)="onClearAll()"
|
|
116
|
+
style="flex:1;font-size:12px"
|
|
117
|
+
>Clear All</button>
|
|
118
|
+
<button
|
|
119
|
+
type="button"
|
|
120
|
+
class="p-button p-button-text p-button-sm"
|
|
121
|
+
(click)="onSelectAll()"
|
|
122
|
+
style="flex:1;font-size:12px"
|
|
123
|
+
>Select All</button>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
}
|
|
127
|
+
</div>
|
|
128
|
+
`,
|
|
129
|
+
}]
|
|
130
|
+
}], null, null); })();
|
|
131
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ColumnChooserComponent, { className: "ColumnChooserComponent", filePath: "column-chooser/column-chooser.component.ts", lineNumber: 60 }); })();
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import { Component, ViewChild, DestroyRef, inject, effect, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { BaseColumnHeaderFilterComponent } from '@alaarab/ogrid-angular';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
const _c0 = ["filterTrigger"];
|
|
5
|
+
const _c1 = ["filterPanel"];
|
|
6
|
+
const _forTrack0 = ($index, $item) => $item.email;
|
|
7
|
+
function ColumnHeaderFilterComponent_Conditional_5_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
8
|
+
i0.ɵɵdomElement(0, "span", 7);
|
|
9
|
+
} }
|
|
10
|
+
function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
11
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
12
|
+
i0.ɵɵdomElementStart(0, "div", 10)(1, "input", 11);
|
|
13
|
+
i0.ɵɵdomListener("input", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_4_Template_input_input_1_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.tempTextValue.set($event.target.value)); });
|
|
14
|
+
i0.ɵɵdomElementEnd()();
|
|
15
|
+
i0.ɵɵdomElementStart(2, "div", 12)(3, "button", 13);
|
|
16
|
+
i0.ɵɵdomListener("click", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_4_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.handleTextClear()); });
|
|
17
|
+
i0.ɵɵtext(4, "Clear");
|
|
18
|
+
i0.ɵɵdomElementEnd();
|
|
19
|
+
i0.ɵɵdomElementStart(5, "button", 14);
|
|
20
|
+
i0.ɵɵdomListener("click", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_4_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.handleTextApply()); });
|
|
21
|
+
i0.ɵɵtext(6, "Apply");
|
|
22
|
+
i0.ɵɵdomElementEnd()();
|
|
23
|
+
} if (rf & 2) {
|
|
24
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
25
|
+
i0.ɵɵadvance();
|
|
26
|
+
i0.ɵɵdomProperty("value", ctx_r1.tempTextValue());
|
|
27
|
+
i0.ɵɵattribute("aria-label", "Filter " + ctx_r1.columnName);
|
|
28
|
+
i0.ɵɵadvance(2);
|
|
29
|
+
i0.ɵɵdomProperty("disabled", !ctx_r1.textValue);
|
|
30
|
+
} }
|
|
31
|
+
function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
32
|
+
i0.ɵɵdomElementStart(0, "div", 16);
|
|
33
|
+
i0.ɵɵtext(1, "Loading...");
|
|
34
|
+
i0.ɵɵdomElementEnd();
|
|
35
|
+
} }
|
|
36
|
+
function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Conditional_3_For_7_Template(rf, ctx) { if (rf & 1) {
|
|
37
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
38
|
+
i0.ɵɵdomElementStart(0, "label", 20)(1, "input", 21);
|
|
39
|
+
i0.ɵɵdomListener("change", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Conditional_3_For_7_Template_input_change_1_listener($event) { const opt_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.handleCheckboxChange(opt_r7, $event)); });
|
|
40
|
+
i0.ɵɵdomElementEnd();
|
|
41
|
+
i0.ɵɵtext(2);
|
|
42
|
+
i0.ɵɵdomElementEnd();
|
|
43
|
+
} if (rf & 2) {
|
|
44
|
+
const opt_r7 = ctx.$implicit;
|
|
45
|
+
const ctx_r1 = i0.ɵɵnextContext(5);
|
|
46
|
+
i0.ɵɵadvance();
|
|
47
|
+
i0.ɵɵdomProperty("checked", ctx_r1.tempSelected().has(opt_r7));
|
|
48
|
+
i0.ɵɵadvance();
|
|
49
|
+
i0.ɵɵtextInterpolate1(" ", opt_r7, " ");
|
|
50
|
+
} }
|
|
51
|
+
function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
52
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
53
|
+
i0.ɵɵdomElementStart(0, "div", 17)(1, "button", 18);
|
|
54
|
+
i0.ɵɵdomListener("click", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Conditional_3_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.handleSelectAllOptions()); });
|
|
55
|
+
i0.ɵɵtext(2, "All");
|
|
56
|
+
i0.ɵɵdomElementEnd();
|
|
57
|
+
i0.ɵɵdomElementStart(3, "button", 18);
|
|
58
|
+
i0.ɵɵdomListener("click", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Conditional_3_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.handleClearSelection()); });
|
|
59
|
+
i0.ɵɵtext(4, "None");
|
|
60
|
+
i0.ɵɵdomElementEnd()();
|
|
61
|
+
i0.ɵɵdomElementStart(5, "div", 19);
|
|
62
|
+
i0.ɵɵrepeaterCreate(6, ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Conditional_3_For_7_Template, 3, 2, "label", 20, i0.ɵɵrepeaterTrackByIdentity);
|
|
63
|
+
i0.ɵɵdomElementEnd();
|
|
64
|
+
} if (rf & 2) {
|
|
65
|
+
const ctx_r1 = i0.ɵɵnextContext(4);
|
|
66
|
+
i0.ɵɵadvance(5);
|
|
67
|
+
i0.ɵɵattribute("aria-label", ctx_r1.columnName + " filter options");
|
|
68
|
+
i0.ɵɵadvance();
|
|
69
|
+
i0.ɵɵrepeater(ctx_r1.filteredOptions());
|
|
70
|
+
} }
|
|
71
|
+
function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
72
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
73
|
+
i0.ɵɵdomElementStart(0, "div", 10)(1, "input", 15);
|
|
74
|
+
i0.ɵɵdomListener("input", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Template_input_input_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.searchText.set($event.target.value)); });
|
|
75
|
+
i0.ɵɵdomElementEnd();
|
|
76
|
+
i0.ɵɵconditionalCreate(2, ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Conditional_2_Template, 2, 0, "div", 16)(3, ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Conditional_3_Template, 8, 1);
|
|
77
|
+
i0.ɵɵdomElementEnd();
|
|
78
|
+
i0.ɵɵdomElementStart(4, "div", 12)(5, "button", 14);
|
|
79
|
+
i0.ɵɵdomListener("click", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.handleApplyMultiSelect()); });
|
|
80
|
+
i0.ɵɵtext(6, "Apply");
|
|
81
|
+
i0.ɵɵdomElementEnd()();
|
|
82
|
+
} if (rf & 2) {
|
|
83
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
84
|
+
i0.ɵɵadvance();
|
|
85
|
+
i0.ɵɵdomProperty("value", ctx_r1.searchText());
|
|
86
|
+
i0.ɵɵattribute("aria-label", "Search " + ctx_r1.columnName + " options");
|
|
87
|
+
i0.ɵɵadvance();
|
|
88
|
+
i0.ɵɵconditional(ctx_r1.isLoadingOptions ? 2 : 3);
|
|
89
|
+
} }
|
|
90
|
+
function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_6_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
91
|
+
const _r9 = i0.ɵɵgetCurrentView();
|
|
92
|
+
i0.ɵɵdomElementStart(0, "div", 22)(1, "span", 25);
|
|
93
|
+
i0.ɵɵtext(2);
|
|
94
|
+
i0.ɵɵdomElementEnd();
|
|
95
|
+
i0.ɵɵdomElementStart(3, "button", 18);
|
|
96
|
+
i0.ɵɵdomListener("click", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_6_Conditional_1_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r9); const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.handleClearUser()); });
|
|
97
|
+
i0.ɵɵtext(4, "Clear");
|
|
98
|
+
i0.ɵɵdomElementEnd()();
|
|
99
|
+
} if (rf & 2) {
|
|
100
|
+
const ctx_r1 = i0.ɵɵnextContext(4);
|
|
101
|
+
i0.ɵɵadvance(2);
|
|
102
|
+
i0.ɵɵtextInterpolate(ctx_r1.selectedUser.displayName ?? ctx_r1.selectedUser.email);
|
|
103
|
+
} }
|
|
104
|
+
function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_6_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
105
|
+
i0.ɵɵdomElementStart(0, "div", 16);
|
|
106
|
+
i0.ɵɵtext(1, "Loading...");
|
|
107
|
+
i0.ɵɵdomElementEnd();
|
|
108
|
+
} }
|
|
109
|
+
function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_6_For_5_Template(rf, ctx) { if (rf & 1) {
|
|
110
|
+
const _r10 = i0.ɵɵgetCurrentView();
|
|
111
|
+
i0.ɵɵdomElementStart(0, "button", 26);
|
|
112
|
+
i0.ɵɵdomListener("click", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_6_For_5_Template_button_click_0_listener() { const user_r11 = i0.ɵɵrestoreView(_r10).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.handleUserSelect(user_r11)); });
|
|
113
|
+
i0.ɵɵtext(1);
|
|
114
|
+
i0.ɵɵdomElementEnd();
|
|
115
|
+
} if (rf & 2) {
|
|
116
|
+
const user_r11 = ctx.$implicit;
|
|
117
|
+
i0.ɵɵadvance();
|
|
118
|
+
i0.ɵɵtextInterpolate1(" ", user_r11.displayName ?? user_r11.email, " ");
|
|
119
|
+
} }
|
|
120
|
+
function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
121
|
+
const _r8 = i0.ɵɵgetCurrentView();
|
|
122
|
+
i0.ɵɵdomElementStart(0, "div", 10);
|
|
123
|
+
i0.ɵɵconditionalCreate(1, ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_6_Conditional_1_Template, 5, 1, "div", 22);
|
|
124
|
+
i0.ɵɵdomElementStart(2, "input", 23);
|
|
125
|
+
i0.ɵɵdomListener("input", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_6_Template_input_input_2_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onPeopleSearchInput($event)); });
|
|
126
|
+
i0.ɵɵdomElementEnd();
|
|
127
|
+
i0.ɵɵconditionalCreate(3, ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_6_Conditional_3_Template, 2, 0, "div", 16);
|
|
128
|
+
i0.ɵɵrepeaterCreate(4, ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_6_For_5_Template, 2, 1, "button", 24, _forTrack0);
|
|
129
|
+
i0.ɵɵdomElementEnd();
|
|
130
|
+
} if (rf & 2) {
|
|
131
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
132
|
+
i0.ɵɵadvance();
|
|
133
|
+
i0.ɵɵconditional(ctx_r1.selectedUser ? 1 : -1);
|
|
134
|
+
i0.ɵɵadvance();
|
|
135
|
+
i0.ɵɵdomProperty("value", ctx_r1.peopleSearchText());
|
|
136
|
+
i0.ɵɵattribute("aria-label", "Search people for " + ctx_r1.columnName);
|
|
137
|
+
i0.ɵɵadvance();
|
|
138
|
+
i0.ɵɵconditional(ctx_r1.isPeopleLoading() ? 3 : -1);
|
|
139
|
+
i0.ɵɵadvance();
|
|
140
|
+
i0.ɵɵrepeater(ctx_r1.peopleSuggestions());
|
|
141
|
+
} }
|
|
142
|
+
function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
143
|
+
const _r12 = i0.ɵɵgetCurrentView();
|
|
144
|
+
i0.ɵɵdomElementStart(0, "div", 27)(1, "label", 28);
|
|
145
|
+
i0.ɵɵtext(2, " From: ");
|
|
146
|
+
i0.ɵɵdomElementStart(3, "input", 29);
|
|
147
|
+
i0.ɵɵdomListener("change", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_7_Template_input_change_3_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.tempDateFrom.set($event.target.value)); });
|
|
148
|
+
i0.ɵɵdomElementEnd()();
|
|
149
|
+
i0.ɵɵdomElementStart(4, "label", 28);
|
|
150
|
+
i0.ɵɵtext(5, " To: ");
|
|
151
|
+
i0.ɵɵdomElementStart(6, "input", 29);
|
|
152
|
+
i0.ɵɵdomListener("change", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_7_Template_input_change_6_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.tempDateTo.set($event.target.value)); });
|
|
153
|
+
i0.ɵɵdomElementEnd()()();
|
|
154
|
+
i0.ɵɵdomElementStart(7, "div", 12)(8, "button", 13);
|
|
155
|
+
i0.ɵɵdomListener("click", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_7_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.handleDateClear()); });
|
|
156
|
+
i0.ɵɵtext(9, "Clear");
|
|
157
|
+
i0.ɵɵdomElementEnd();
|
|
158
|
+
i0.ɵɵdomElementStart(10, "button", 14);
|
|
159
|
+
i0.ɵɵdomListener("click", function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_7_Template_button_click_10_listener() { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.handleDateApply()); });
|
|
160
|
+
i0.ɵɵtext(11, "Apply");
|
|
161
|
+
i0.ɵɵdomElementEnd()();
|
|
162
|
+
} if (rf & 2) {
|
|
163
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
164
|
+
i0.ɵɵadvance(3);
|
|
165
|
+
i0.ɵɵdomProperty("value", ctx_r1.tempDateFrom());
|
|
166
|
+
i0.ɵɵadvance(3);
|
|
167
|
+
i0.ɵɵdomProperty("value", ctx_r1.tempDateTo());
|
|
168
|
+
i0.ɵɵadvance(2);
|
|
169
|
+
i0.ɵɵdomProperty("disabled", !ctx_r1.tempDateFrom() && !ctx_r1.tempDateTo());
|
|
170
|
+
} }
|
|
171
|
+
function ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
172
|
+
i0.ɵɵdomElementStart(0, "div", 8, 1)(2, "div", 9);
|
|
173
|
+
i0.ɵɵtext(3);
|
|
174
|
+
i0.ɵɵdomElementEnd();
|
|
175
|
+
i0.ɵɵconditionalCreate(4, ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_4_Template, 7, 3);
|
|
176
|
+
i0.ɵɵconditionalCreate(5, ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_5_Template, 7, 3);
|
|
177
|
+
i0.ɵɵconditionalCreate(6, ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_6_Template, 6, 4, "div", 10);
|
|
178
|
+
i0.ɵɵconditionalCreate(7, ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Conditional_7_Template, 12, 3);
|
|
179
|
+
i0.ɵɵdomElementEnd();
|
|
180
|
+
} if (rf & 2) {
|
|
181
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
182
|
+
i0.ɵɵadvance(3);
|
|
183
|
+
i0.ɵɵtextInterpolate1(" Filter: ", ctx_r1.columnName, " ");
|
|
184
|
+
i0.ɵɵadvance();
|
|
185
|
+
i0.ɵɵconditional(ctx_r1.filterType === "text" ? 4 : -1);
|
|
186
|
+
i0.ɵɵadvance();
|
|
187
|
+
i0.ɵɵconditional(ctx_r1.filterType === "multiSelect" ? 5 : -1);
|
|
188
|
+
i0.ɵɵadvance();
|
|
189
|
+
i0.ɵɵconditional(ctx_r1.filterType === "people" ? 6 : -1);
|
|
190
|
+
i0.ɵɵadvance();
|
|
191
|
+
i0.ɵɵconditional(ctx_r1.filterType === "date" ? 7 : -1);
|
|
192
|
+
} }
|
|
193
|
+
function ColumnHeaderFilterComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
194
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
195
|
+
i0.ɵɵdomElementStart(0, "button", 6, 0);
|
|
196
|
+
i0.ɵɵdomListener("click", function ColumnHeaderFilterComponent_Conditional_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.toggleFilter()); });
|
|
197
|
+
i0.ɵɵtext(2, " \u25BE ");
|
|
198
|
+
i0.ɵɵconditionalCreate(3, ColumnHeaderFilterComponent_Conditional_5_Conditional_3_Template, 1, 0, "span", 7);
|
|
199
|
+
i0.ɵɵdomElementEnd();
|
|
200
|
+
i0.ɵɵconditionalCreate(4, ColumnHeaderFilterComponent_Conditional_5_Conditional_4_Template, 8, 5, "div", 8);
|
|
201
|
+
} if (rf & 2) {
|
|
202
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
203
|
+
i0.ɵɵstyleProp("font-weight", ctx_r1.hasActiveFilter() ? "bold" : "normal");
|
|
204
|
+
i0.ɵɵdomProperty("title", "Filter " + ctx_r1.columnName);
|
|
205
|
+
i0.ɵɵattribute("aria-label", "Filter " + ctx_r1.columnName)("aria-expanded", ctx_r1.isFilterOpen());
|
|
206
|
+
i0.ɵɵadvance(3);
|
|
207
|
+
i0.ɵɵconditional(ctx_r1.hasActiveFilter() ? 3 : -1);
|
|
208
|
+
i0.ɵɵadvance();
|
|
209
|
+
i0.ɵɵconditional(ctx_r1.isFilterOpen() ? 4 : -1);
|
|
210
|
+
} }
|
|
211
|
+
export class ColumnHeaderFilterComponent extends BaseColumnHeaderFilterComponent {
|
|
212
|
+
getHeaderEl() {
|
|
213
|
+
return this.filterTrigger;
|
|
214
|
+
}
|
|
215
|
+
constructor() {
|
|
216
|
+
super();
|
|
217
|
+
this.destroyRef = inject(DestroyRef);
|
|
218
|
+
this.clickOutsideHandler = (e) => {
|
|
219
|
+
const trigger = this.filterTrigger?.nativeElement;
|
|
220
|
+
const panel = this.filterPanel?.nativeElement;
|
|
221
|
+
if (trigger && !trigger.contains(e.target) && (!panel || !panel.contains(e.target))) {
|
|
222
|
+
this.isFilterOpen.set(false);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
// Sync temp values when filter opens
|
|
226
|
+
effect(() => {
|
|
227
|
+
if (this.isFilterOpen()) {
|
|
228
|
+
this.tempTextValue.set(this.textValue ?? '');
|
|
229
|
+
this.searchText.set('');
|
|
230
|
+
const sv = this.selectedValues;
|
|
231
|
+
this.tempSelected.set(new Set(sv ?? []));
|
|
232
|
+
const dv = this.dateValue;
|
|
233
|
+
this.tempDateFrom.set(dv?.from ?? '');
|
|
234
|
+
this.tempDateTo.set(dv?.to ?? '');
|
|
235
|
+
document.addEventListener('mousedown', this.clickOutsideHandler, true);
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
document.removeEventListener('mousedown', this.clickOutsideHandler, true);
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
this.destroyRef.onDestroy(() => {
|
|
242
|
+
document.removeEventListener('mousedown', this.clickOutsideHandler, true);
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
handleSortClick() {
|
|
246
|
+
this.onSort?.();
|
|
247
|
+
}
|
|
248
|
+
toggleFilter() {
|
|
249
|
+
this.isFilterOpen.update((v) => !v);
|
|
250
|
+
}
|
|
251
|
+
// Adapter methods for template compatibility
|
|
252
|
+
handleSelectAllOptions() {
|
|
253
|
+
this.handleSelectAllFiltered();
|
|
254
|
+
}
|
|
255
|
+
static { this.ɵfac = function ColumnHeaderFilterComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ColumnHeaderFilterComponent)(); }; }
|
|
256
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ColumnHeaderFilterComponent, selectors: [["ogrid-primeng-column-header-filter"]], viewQuery: function ColumnHeaderFilterComponent_Query(rf, ctx) { if (rf & 1) {
|
|
257
|
+
i0.ɵɵviewQuery(_c0, 5)(_c1, 5);
|
|
258
|
+
} if (rf & 2) {
|
|
259
|
+
let _t;
|
|
260
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.filterTrigger = _t.first);
|
|
261
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.filterPanel = _t.first);
|
|
262
|
+
} }, features: [i0.ɵɵInheritDefinitionFeature], decls: 6, vars: 3, consts: [["filterTrigger", ""], ["filterPanel", ""], [2, "display", "flex", "align-items", "center", "flex", "1", "min-width", "0", "gap", "4px"], [2, "flex", "1", "min-width", "0", "overflow", "hidden"], ["data-header-label", "", 2, "overflow", "hidden", "text-overflow", "ellipsis", "white-space", "nowrap", "display", "block", 3, "title"], [2, "display", "flex", "align-items", "center", "gap", "2px", "flex-shrink", "0"], ["type", "button", "aria-haspopup", "dialog", 2, "border", "none", "background", "transparent", "cursor", "pointer", "padding", "2px 4px", "font-size", "12px", "position", "relative", "color", "var(--ogrid-fg, #242424)", 3, "click", "title"], [2, "position", "absolute", "top", "0", "right", "0", "width", "6px", "height", "6px", "border-radius", "50%", "background", "var(--ogrid-selection, #217346)"], [2, "position", "absolute", "top", "100%", "left", "0", "z-index", "1000", "min-width", "200px", "background", "var(--ogrid-bg, #fff)", "border", "1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))", "border-radius", "6px", "box-shadow", "0 2px 8px rgba(0,0,0,0.12)", "font-weight", "normal"], [2, "padding", "8px 12px", "font-weight", "600", "font-size", "12px", "border-bottom", "1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))"], [2, "padding", "8px 12px"], ["type", "text", "placeholder", "Filter text...", 2, "width", "100%", "box-sizing", "border-box", "padding", "6px 8px", "border", "1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))", "border-radius", "4px", "font-size", "13px", "background", "var(--ogrid-bg, #fff)", "color", "var(--ogrid-fg, #242424)", 3, "input", "value"], [2, "display", "flex", "justify-content", "flex-end", "gap", "6px", "padding", "6px 12px", "border-top", "1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))"], ["type", "button", 1, "p-button", "p-button-text", "p-button-sm", 2, "font-size", "12px", 3, "click", "disabled"], ["type", "button", 1, "p-button", "p-button-sm", 2, "font-size", "12px", 3, "click"], ["type", "text", "placeholder", "Search options...", 2, "width", "100%", "box-sizing", "border-box", "padding", "6px 8px", "border", "1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))", "border-radius", "4px", "font-size", "13px", "margin-bottom", "6px", "background", "var(--ogrid-bg, #fff)", "color", "var(--ogrid-fg, #242424)", 3, "input", "value"], [2, "padding", "8px 0", "color", "var(--ogrid-fg-muted, rgba(0, 0, 0, 0.5))", "font-size", "12px"], [2, "display", "flex", "gap", "4px", "margin-bottom", "6px"], ["type", "button", 1, "p-button", "p-button-text", "p-button-sm", 2, "font-size", "11px", 3, "click"], ["role", "group", 2, "max-height", "160px", "overflow-y", "auto"], [2, "display", "flex", "align-items", "center", "gap", "6px", "padding", "2px 0", "cursor", "pointer", "font-size", "13px"], ["type", "checkbox", 3, "change", "checked"], [2, "display", "flex", "align-items", "center", "justify-content", "space-between", "padding", "4px 0", "margin-bottom", "4px"], ["type", "text", "placeholder", "Search people...", 2, "width", "100%", "box-sizing", "border-box", "padding", "6px 8px", "border", "1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))", "border-radius", "4px", "font-size", "13px", "background", "var(--ogrid-bg, #fff)", "color", "var(--ogrid-fg, #242424)", 3, "input", "value"], ["type", "button", 2, "display", "block", "width", "100%", "text-align", "left", "padding", "6px 0", "border", "none", "background", "transparent", "cursor", "pointer", "font-size", "13px", "color", "var(--ogrid-fg, #242424)"], [2, "font-size", "13px"], ["type", "button", 2, "display", "block", "width", "100%", "text-align", "left", "padding", "6px 0", "border", "none", "background", "transparent", "cursor", "pointer", "font-size", "13px", "color", "var(--ogrid-fg, #242424)", 3, "click"], [2, "padding", "8px 12px", "display", "flex", "flex-direction", "column", "gap", "6px"], [2, "display", "flex", "align-items", "center", "gap", "6px", "font-size", "12px"], ["type", "date", 2, "flex", "1", "padding", "4px 6px", "border", "1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))", "border-radius", "4px", "background", "var(--ogrid-bg, #fff)", "color", "var(--ogrid-fg, #242424)", 3, "change", "value"]], template: function ColumnHeaderFilterComponent_Template(rf, ctx) { if (rf & 1) {
|
|
263
|
+
i0.ɵɵdomElementStart(0, "div", 2)(1, "div", 3)(2, "span", 4);
|
|
264
|
+
i0.ɵɵtext(3);
|
|
265
|
+
i0.ɵɵdomElementEnd()();
|
|
266
|
+
i0.ɵɵdomElementStart(4, "div", 5);
|
|
267
|
+
i0.ɵɵconditionalCreate(5, ColumnHeaderFilterComponent_Conditional_5_Template, 5, 7);
|
|
268
|
+
i0.ɵɵdomElementEnd()();
|
|
269
|
+
} if (rf & 2) {
|
|
270
|
+
i0.ɵɵadvance(2);
|
|
271
|
+
i0.ɵɵdomProperty("title", ctx.columnName);
|
|
272
|
+
i0.ɵɵadvance();
|
|
273
|
+
i0.ɵɵtextInterpolate1(" ", ctx.columnName, " ");
|
|
274
|
+
i0.ɵɵadvance(2);
|
|
275
|
+
i0.ɵɵconditional(ctx.filterType !== "none" ? 5 : -1);
|
|
276
|
+
} }, styles: ["[_nghost-%COMP%] {\n display: flex;\n position: relative;\n flex: 1;\n min-width: 0;\n }"], changeDetection: 0 }); }
|
|
277
|
+
}
|
|
278
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ColumnHeaderFilterComponent, [{
|
|
279
|
+
type: Component,
|
|
280
|
+
args: [{ selector: 'ogrid-primeng-column-header-filter', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
281
|
+
<div style="display:flex;align-items:center;flex:1;min-width:0;gap:4px">
|
|
282
|
+
<div style="flex:1;min-width:0;overflow:hidden">
|
|
283
|
+
<span style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block" [title]="columnName" data-header-label>
|
|
284
|
+
{{ columnName }}
|
|
285
|
+
</span>
|
|
286
|
+
</div>
|
|
287
|
+
<div style="display:flex;align-items:center;gap:2px;flex-shrink:0">
|
|
288
|
+
@if (filterType !== 'none') {
|
|
289
|
+
<button
|
|
290
|
+
type="button"
|
|
291
|
+
#filterTrigger
|
|
292
|
+
(click)="toggleFilter()"
|
|
293
|
+
[attr.aria-label]="'Filter ' + columnName"
|
|
294
|
+
[attr.aria-expanded]="isFilterOpen()"
|
|
295
|
+
aria-haspopup="dialog"
|
|
296
|
+
[title]="'Filter ' + columnName"
|
|
297
|
+
style="border:none;background:transparent;cursor:pointer;padding:2px 4px;font-size:12px;position:relative;color:var(--ogrid-fg, #242424)"
|
|
298
|
+
[style.font-weight]="hasActiveFilter() ? 'bold' : 'normal'"
|
|
299
|
+
>
|
|
300
|
+
▾
|
|
301
|
+
@if (hasActiveFilter()) {
|
|
302
|
+
<span style="position:absolute;top:0;right:0;width:6px;height:6px;border-radius:50%;background:var(--ogrid-selection, #217346)"></span>
|
|
303
|
+
}
|
|
304
|
+
</button>
|
|
305
|
+
|
|
306
|
+
@if (isFilterOpen()) {
|
|
307
|
+
<div
|
|
308
|
+
#filterPanel
|
|
309
|
+
style="position:absolute;top:100%;left:0;z-index:1000;min-width:200px;background:var(--ogrid-bg, #fff);border:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));border-radius:6px;box-shadow:0 2px 8px rgba(0,0,0,0.12);font-weight:normal"
|
|
310
|
+
>
|
|
311
|
+
<div style="padding:8px 12px;font-weight:600;font-size:12px;border-bottom:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))">
|
|
312
|
+
Filter: {{ columnName }}
|
|
313
|
+
</div>
|
|
314
|
+
|
|
315
|
+
@if (filterType === 'text') {
|
|
316
|
+
<div style="padding:8px 12px">
|
|
317
|
+
<input
|
|
318
|
+
type="text"
|
|
319
|
+
[value]="tempTextValue()"
|
|
320
|
+
(input)="tempTextValue.set($any($event.target).value)"
|
|
321
|
+
placeholder="Filter text..."
|
|
322
|
+
style="width:100%;box-sizing:border-box;padding:6px 8px;border:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));border-radius:4px;font-size:13px;background:var(--ogrid-bg, #fff);color:var(--ogrid-fg, #242424)"
|
|
323
|
+
[attr.aria-label]="'Filter ' + columnName"
|
|
324
|
+
/>
|
|
325
|
+
</div>
|
|
326
|
+
<div style="display:flex;justify-content:flex-end;gap:6px;padding:6px 12px;border-top:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))">
|
|
327
|
+
<button
|
|
328
|
+
type="button"
|
|
329
|
+
class="p-button p-button-text p-button-sm"
|
|
330
|
+
(click)="handleTextClear()"
|
|
331
|
+
[disabled]="!textValue"
|
|
332
|
+
style="font-size:12px"
|
|
333
|
+
>Clear</button>
|
|
334
|
+
<button
|
|
335
|
+
type="button"
|
|
336
|
+
class="p-button p-button-sm"
|
|
337
|
+
(click)="handleTextApply()"
|
|
338
|
+
style="font-size:12px"
|
|
339
|
+
>Apply</button>
|
|
340
|
+
</div>
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
@if (filterType === 'multiSelect') {
|
|
344
|
+
<div style="padding:8px 12px">
|
|
345
|
+
<input
|
|
346
|
+
type="text"
|
|
347
|
+
[value]="searchText()"
|
|
348
|
+
(input)="searchText.set($any($event.target).value)"
|
|
349
|
+
placeholder="Search options..."
|
|
350
|
+
style="width:100%;box-sizing:border-box;padding:6px 8px;border:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));border-radius:4px;font-size:13px;margin-bottom:6px;background:var(--ogrid-bg, #fff);color:var(--ogrid-fg, #242424)"
|
|
351
|
+
[attr.aria-label]="'Search ' + columnName + ' options'"
|
|
352
|
+
/>
|
|
353
|
+
@if (isLoadingOptions) {
|
|
354
|
+
<div style="padding:8px 0;color:var(--ogrid-fg-muted, rgba(0, 0, 0, 0.5));font-size:12px">Loading...</div>
|
|
355
|
+
} @else {
|
|
356
|
+
<div style="display:flex;gap:4px;margin-bottom:6px">
|
|
357
|
+
<button type="button" class="p-button p-button-text p-button-sm" (click)="handleSelectAllOptions()" style="font-size:11px">All</button>
|
|
358
|
+
<button type="button" class="p-button p-button-text p-button-sm" (click)="handleClearSelection()" style="font-size:11px">None</button>
|
|
359
|
+
</div>
|
|
360
|
+
<div style="max-height:160px;overflow-y:auto" role="group" [attr.aria-label]="columnName + ' filter options'">
|
|
361
|
+
@for (opt of filteredOptions(); track opt) {
|
|
362
|
+
<label style="display:flex;align-items:center;gap:6px;padding:2px 0;cursor:pointer;font-size:13px">
|
|
363
|
+
<input
|
|
364
|
+
type="checkbox"
|
|
365
|
+
[checked]="tempSelected().has(opt)"
|
|
366
|
+
(change)="handleCheckboxChange(opt, $event)"
|
|
367
|
+
/>
|
|
368
|
+
{{ opt }}
|
|
369
|
+
</label>
|
|
370
|
+
}
|
|
371
|
+
</div>
|
|
372
|
+
}
|
|
373
|
+
</div>
|
|
374
|
+
<div style="display:flex;justify-content:flex-end;gap:6px;padding:6px 12px;border-top:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))">
|
|
375
|
+
<button
|
|
376
|
+
type="button"
|
|
377
|
+
class="p-button p-button-sm"
|
|
378
|
+
(click)="handleApplyMultiSelect()"
|
|
379
|
+
style="font-size:12px"
|
|
380
|
+
>Apply</button>
|
|
381
|
+
</div>
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
@if (filterType === 'people') {
|
|
385
|
+
<div style="padding:8px 12px">
|
|
386
|
+
@if (selectedUser) {
|
|
387
|
+
<div style="display:flex;align-items:center;justify-content:space-between;padding:4px 0;margin-bottom:4px">
|
|
388
|
+
<span style="font-size:13px">{{ selectedUser!.displayName ?? selectedUser!.email }}</span>
|
|
389
|
+
<button type="button" class="p-button p-button-text p-button-sm" (click)="handleClearUser()" style="font-size:11px">Clear</button>
|
|
390
|
+
</div>
|
|
391
|
+
}
|
|
392
|
+
<input
|
|
393
|
+
type="text"
|
|
394
|
+
[value]="peopleSearchText()"
|
|
395
|
+
(input)="onPeopleSearchInput($event)"
|
|
396
|
+
placeholder="Search people..."
|
|
397
|
+
style="width:100%;box-sizing:border-box;padding:6px 8px;border:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));border-radius:4px;font-size:13px;background:var(--ogrid-bg, #fff);color:var(--ogrid-fg, #242424)"
|
|
398
|
+
[attr.aria-label]="'Search people for ' + columnName"
|
|
399
|
+
/>
|
|
400
|
+
@if (isPeopleLoading()) {
|
|
401
|
+
<div style="padding:8px 0;color:var(--ogrid-fg-muted, rgba(0, 0, 0, 0.5));font-size:12px">Loading...</div>
|
|
402
|
+
}
|
|
403
|
+
@for (user of peopleSuggestions(); track user.email) {
|
|
404
|
+
<button
|
|
405
|
+
type="button"
|
|
406
|
+
(click)="handleUserSelect(user)"
|
|
407
|
+
style="display:block;width:100%;text-align:left;padding:6px 0;border:none;background:transparent;cursor:pointer;font-size:13px;color:var(--ogrid-fg, #242424)"
|
|
408
|
+
>
|
|
409
|
+
{{ user.displayName ?? user.email }}
|
|
410
|
+
</button>
|
|
411
|
+
}
|
|
412
|
+
</div>
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
@if (filterType === 'date') {
|
|
416
|
+
<div style="padding:8px 12px;display:flex;flex-direction:column;gap:6px">
|
|
417
|
+
<label style="display:flex;align-items:center;gap:6px;font-size:12px">
|
|
418
|
+
From:
|
|
419
|
+
<input
|
|
420
|
+
type="date"
|
|
421
|
+
[value]="tempDateFrom()"
|
|
422
|
+
(change)="tempDateFrom.set($any($event.target).value)"
|
|
423
|
+
style="flex:1;padding:4px 6px;border:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));border-radius:4px;background:var(--ogrid-bg, #fff);color:var(--ogrid-fg, #242424)"
|
|
424
|
+
/>
|
|
425
|
+
</label>
|
|
426
|
+
<label style="display:flex;align-items:center;gap:6px;font-size:12px">
|
|
427
|
+
To:
|
|
428
|
+
<input
|
|
429
|
+
type="date"
|
|
430
|
+
[value]="tempDateTo()"
|
|
431
|
+
(change)="tempDateTo.set($any($event.target).value)"
|
|
432
|
+
style="flex:1;padding:4px 6px;border:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));border-radius:4px;background:var(--ogrid-bg, #fff);color:var(--ogrid-fg, #242424)"
|
|
433
|
+
/>
|
|
434
|
+
</label>
|
|
435
|
+
</div>
|
|
436
|
+
<div style="display:flex;justify-content:flex-end;gap:6px;padding:6px 12px;border-top:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12))">
|
|
437
|
+
<button
|
|
438
|
+
type="button"
|
|
439
|
+
class="p-button p-button-text p-button-sm"
|
|
440
|
+
(click)="handleDateClear()"
|
|
441
|
+
[disabled]="!tempDateFrom() && !tempDateTo()"
|
|
442
|
+
style="font-size:12px"
|
|
443
|
+
>Clear</button>
|
|
444
|
+
<button
|
|
445
|
+
type="button"
|
|
446
|
+
class="p-button p-button-sm"
|
|
447
|
+
(click)="handleDateApply()"
|
|
448
|
+
style="font-size:12px"
|
|
449
|
+
>Apply</button>
|
|
450
|
+
</div>
|
|
451
|
+
}
|
|
452
|
+
</div>
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
</div>
|
|
456
|
+
</div>
|
|
457
|
+
`, styles: ["\n :host {\n display: flex;\n position: relative;\n flex: 1;\n min-width: 0;\n }\n "] }]
|
|
458
|
+
}], () => [], { filterTrigger: [{
|
|
459
|
+
type: ViewChild,
|
|
460
|
+
args: ['filterTrigger']
|
|
461
|
+
}], filterPanel: [{
|
|
462
|
+
type: ViewChild,
|
|
463
|
+
args: ['filterPanel']
|
|
464
|
+
}] }); })();
|
|
465
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ColumnHeaderFilterComponent, { className: "ColumnHeaderFilterComponent", filePath: "column-header-filter/column-header-filter.component.ts", lineNumber: 195 }); })();
|