@alaarab/ogrid-angular 2.6.0 → 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/components/base-column-chooser.component.js +77 -0
- package/dist/esm/components/base-column-header-filter.component.js +267 -0
- package/dist/esm/components/base-column-header-menu.component.js +80 -0
- package/dist/esm/components/base-datagrid-table.component.js +768 -0
- package/dist/esm/components/base-inline-cell-editor.component.js +380 -0
- package/dist/esm/components/base-ogrid.component.js +36 -0
- package/dist/esm/components/base-pagination-controls.component.js +68 -0
- package/dist/esm/components/base-popover-cell-editor.component.js +122 -0
- package/dist/esm/components/empty-state.component.js +68 -0
- package/dist/esm/components/formula-bar.component.js +99 -0
- package/dist/esm/components/formula-ref-overlay.component.js +115 -0
- package/dist/esm/components/grid-context-menu.component.js +197 -0
- package/dist/esm/components/inline-cell-editor-template.js +134 -0
- package/dist/esm/components/marching-ants-overlay.component.js +177 -0
- package/dist/esm/components/ogrid-layout.component.js +302 -0
- package/dist/esm/components/sheet-tabs.component.js +83 -0
- package/dist/esm/components/sidebar.component.js +431 -0
- package/dist/esm/components/status-bar.component.js +92 -0
- package/dist/esm/index.js +39 -819
- package/dist/esm/services/column-reorder.service.js +176 -0
- package/dist/esm/services/datagrid-editing.service.js +59 -0
- package/dist/esm/services/datagrid-interaction.service.js +744 -0
- package/dist/esm/services/datagrid-layout.service.js +157 -0
- package/dist/esm/services/datagrid-state.service.js +636 -0
- package/dist/esm/services/formula-engine.service.js +223 -0
- package/dist/esm/services/ogrid.service.js +1094 -0
- package/dist/esm/services/virtual-scroll.service.js +114 -0
- package/dist/esm/styles/ogrid-theme-vars.js +112 -0
- package/dist/esm/types/columnTypes.js +1 -0
- package/dist/esm/types/dataGridTypes.js +1 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/utils/dataGridViewModel.js +6 -0
- package/dist/esm/utils/debounce.js +68 -0
- package/dist/esm/utils/index.js +8 -0
- package/dist/esm/utils/latestRef.js +41 -0
- package/dist/types/components/base-column-chooser.component.d.ts +3 -0
- package/dist/types/components/base-column-header-filter.component.d.ts +3 -0
- package/dist/types/components/base-column-header-menu.component.d.ts +3 -0
- package/dist/types/components/base-datagrid-table.component.d.ts +4 -19
- package/dist/types/components/base-inline-cell-editor.component.d.ts +7 -0
- package/dist/types/components/base-ogrid.component.d.ts +3 -0
- package/dist/types/components/base-pagination-controls.component.d.ts +3 -0
- package/dist/types/components/base-popover-cell-editor.component.d.ts +3 -0
- package/dist/types/components/empty-state.component.d.ts +3 -0
- package/dist/types/components/formula-bar.component.d.ts +3 -8
- package/dist/types/components/formula-ref-overlay.component.d.ts +3 -6
- package/dist/types/components/grid-context-menu.component.d.ts +3 -0
- package/dist/types/components/inline-cell-editor-template.d.ts +2 -2
- package/dist/types/components/marching-ants-overlay.component.d.ts +3 -0
- package/dist/types/components/ogrid-layout.component.d.ts +3 -0
- package/dist/types/components/sheet-tabs.component.d.ts +3 -8
- package/dist/types/components/sidebar.component.d.ts +3 -0
- package/dist/types/components/status-bar.component.d.ts +3 -0
- package/dist/types/index.d.ts +0 -2
- package/dist/types/services/column-reorder.service.d.ts +3 -0
- package/dist/types/services/datagrid-interaction.service.d.ts +1 -0
- package/dist/types/services/datagrid-state.service.d.ts +5 -0
- package/dist/types/services/formula-engine.service.d.ts +3 -9
- package/dist/types/services/ogrid.service.d.ts +8 -11
- package/dist/types/services/virtual-scroll.service.d.ts +3 -0
- package/dist/types/types/dataGridTypes.d.ts +0 -4
- package/package.json +4 -3
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
const _c0 = () => [];
|
|
5
|
+
const _forTrack0 = ($index, $item) => $item.columnId;
|
|
6
|
+
function SideBarComponent_Conditional_1_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
7
|
+
i0.ɵɵelementContainer(0);
|
|
8
|
+
} }
|
|
9
|
+
function SideBarComponent_Conditional_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
10
|
+
i0.ɵɵelementContainer(0);
|
|
11
|
+
} }
|
|
12
|
+
function SideBarComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
13
|
+
i0.ɵɵtemplate(0, SideBarComponent_Conditional_1_ng_container_0_Template, 1, 0, "ng-container", 3)(1, SideBarComponent_Conditional_1_ng_container_1_Template, 1, 0, "ng-container", 3);
|
|
14
|
+
} if (rf & 2) {
|
|
15
|
+
i0.ɵɵnextContext();
|
|
16
|
+
const tabStripTpl_r1 = i0.ɵɵreference(4);
|
|
17
|
+
const panelContentTpl_r2 = i0.ɵɵreference(6);
|
|
18
|
+
i0.ɵɵproperty("ngTemplateOutlet", tabStripTpl_r1);
|
|
19
|
+
i0.ɵɵadvance();
|
|
20
|
+
i0.ɵɵproperty("ngTemplateOutlet", panelContentTpl_r2);
|
|
21
|
+
} }
|
|
22
|
+
function SideBarComponent_Conditional_2_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
23
|
+
i0.ɵɵelementContainer(0);
|
|
24
|
+
} }
|
|
25
|
+
function SideBarComponent_Conditional_2_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
26
|
+
i0.ɵɵelementContainer(0);
|
|
27
|
+
} }
|
|
28
|
+
function SideBarComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
29
|
+
i0.ɵɵtemplate(0, SideBarComponent_Conditional_2_ng_container_0_Template, 1, 0, "ng-container", 3)(1, SideBarComponent_Conditional_2_ng_container_1_Template, 1, 0, "ng-container", 3);
|
|
30
|
+
} if (rf & 2) {
|
|
31
|
+
i0.ɵɵnextContext();
|
|
32
|
+
const tabStripTpl_r1 = i0.ɵɵreference(4);
|
|
33
|
+
const panelContentTpl_r2 = i0.ɵɵreference(6);
|
|
34
|
+
i0.ɵɵproperty("ngTemplateOutlet", panelContentTpl_r2);
|
|
35
|
+
i0.ɵɵadvance();
|
|
36
|
+
i0.ɵɵproperty("ngTemplateOutlet", tabStripTpl_r1);
|
|
37
|
+
} }
|
|
38
|
+
function SideBarComponent_ng_template_3_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
39
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
40
|
+
i0.ɵɵelementStart(0, "button", 6);
|
|
41
|
+
i0.ɵɵlistener("click", function SideBarComponent_ng_template_3_For_2_Template_button_click_0_listener() { const panel_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r4 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r4.onTabClick(panel_r4)); });
|
|
42
|
+
i0.ɵɵtext(1);
|
|
43
|
+
i0.ɵɵelementEnd();
|
|
44
|
+
} if (rf & 2) {
|
|
45
|
+
const panel_r4 = ctx.$implicit;
|
|
46
|
+
const ctx_r4 = i0.ɵɵnextContext(2);
|
|
47
|
+
i0.ɵɵclassProp("ogrid-sidebar-tab--active", (ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.activePanel) === panel_r4);
|
|
48
|
+
i0.ɵɵproperty("title", ctx_r4.panelLabels[panel_r4]);
|
|
49
|
+
i0.ɵɵattribute("aria-selected", (ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.activePanel) === panel_r4)("aria-label", ctx_r4.panelLabels[panel_r4]);
|
|
50
|
+
i0.ɵɵadvance();
|
|
51
|
+
i0.ɵɵtextInterpolate1(" ", panel_r4 === "columns" ? "\u2261" : "\u2A65", " ");
|
|
52
|
+
} }
|
|
53
|
+
function SideBarComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
|
|
54
|
+
i0.ɵɵelementStart(0, "div", 4);
|
|
55
|
+
i0.ɵɵrepeaterCreate(1, SideBarComponent_ng_template_3_For_2_Template, 2, 6, "button", 5, i0.ɵɵrepeaterTrackByIdentity);
|
|
56
|
+
i0.ɵɵelementEnd();
|
|
57
|
+
} if (rf & 2) {
|
|
58
|
+
const ctx_r4 = i0.ɵɵnextContext();
|
|
59
|
+
i0.ɵɵclassProp("ogrid-sidebar-tab-strip--left", (ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.position) === "left")("ogrid-sidebar-tab-strip--right", (ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.position) === "right");
|
|
60
|
+
i0.ɵɵadvance();
|
|
61
|
+
i0.ɵɵrepeater((ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.panels) ?? i0.ɵɵpureFunction0(4, _c0));
|
|
62
|
+
} }
|
|
63
|
+
function SideBarComponent_ng_template_5_Conditional_0_Conditional_7_For_6_Template(rf, ctx) { if (rf & 1) {
|
|
64
|
+
const _r8 = i0.ɵɵgetCurrentView();
|
|
65
|
+
i0.ɵɵelementStart(0, "label", 15)(1, "input", 16);
|
|
66
|
+
i0.ɵɵlistener("change", function SideBarComponent_ng_template_5_Conditional_0_Conditional_7_For_6_Template_input_change_1_listener($event) { const col_r9 = i0.ɵɵrestoreView(_r8).$implicit; const ctx_r4 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r4.onVisibilityChange(col_r9.columnId, $event.target.checked)); });
|
|
67
|
+
i0.ɵɵelementEnd();
|
|
68
|
+
i0.ɵɵelementStart(2, "span");
|
|
69
|
+
i0.ɵɵtext(3);
|
|
70
|
+
i0.ɵɵelementEnd()();
|
|
71
|
+
} if (rf & 2) {
|
|
72
|
+
const col_r9 = ctx.$implicit;
|
|
73
|
+
const ctx_r4 = i0.ɵɵnextContext(4);
|
|
74
|
+
i0.ɵɵadvance();
|
|
75
|
+
i0.ɵɵproperty("checked", ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.visibleColumns == null ? null : ctx_r4.sideBarProps.visibleColumns.has(col_r9.columnId))("disabled", col_r9.required);
|
|
76
|
+
i0.ɵɵadvance(2);
|
|
77
|
+
i0.ɵɵtextInterpolate(col_r9.name);
|
|
78
|
+
} }
|
|
79
|
+
function SideBarComponent_ng_template_5_Conditional_0_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
80
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
81
|
+
i0.ɵɵelementStart(0, "div", 12)(1, "button", 13);
|
|
82
|
+
i0.ɵɵlistener("click", function SideBarComponent_ng_template_5_Conditional_0_Conditional_7_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r7); const ctx_r4 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r4.onSelectAll()); });
|
|
83
|
+
i0.ɵɵtext(2, "Select All");
|
|
84
|
+
i0.ɵɵelementEnd();
|
|
85
|
+
i0.ɵɵelementStart(3, "button", 14);
|
|
86
|
+
i0.ɵɵlistener("click", function SideBarComponent_ng_template_5_Conditional_0_Conditional_7_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r7); const ctx_r4 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r4.onClearAll()); });
|
|
87
|
+
i0.ɵɵtext(4, "Clear All");
|
|
88
|
+
i0.ɵɵelementEnd()();
|
|
89
|
+
i0.ɵɵrepeaterCreate(5, SideBarComponent_ng_template_5_Conditional_0_Conditional_7_For_6_Template, 4, 3, "label", 15, _forTrack0);
|
|
90
|
+
} if (rf & 2) {
|
|
91
|
+
const ctx_r4 = i0.ɵɵnextContext(3);
|
|
92
|
+
i0.ɵɵadvance();
|
|
93
|
+
i0.ɵɵproperty("disabled", ctx_r4.allVisible());
|
|
94
|
+
i0.ɵɵadvance(4);
|
|
95
|
+
i0.ɵɵrepeater((ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.columns) ?? i0.ɵɵpureFunction0(1, _c0));
|
|
96
|
+
} }
|
|
97
|
+
function SideBarComponent_ng_template_5_Conditional_0_Conditional_8_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
98
|
+
i0.ɵɵelementStart(0, "div", 17);
|
|
99
|
+
i0.ɵɵtext(1, "No filterable columns");
|
|
100
|
+
i0.ɵɵelementEnd();
|
|
101
|
+
} }
|
|
102
|
+
function SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
103
|
+
const _r10 = i0.ɵɵgetCurrentView();
|
|
104
|
+
i0.ɵɵelementStart(0, "input", 23);
|
|
105
|
+
i0.ɵɵlistener("input", function SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Conditional_3_Template_input_input_0_listener($event) { i0.ɵɵrestoreView(_r10); const col_r11 = i0.ɵɵnextContext().$implicit; const ctx_r4 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r4.onTextFilterChange(col_r11.filterField, $event.target.value)); });
|
|
106
|
+
i0.ɵɵelementEnd();
|
|
107
|
+
} if (rf & 2) {
|
|
108
|
+
const col_r11 = i0.ɵɵnextContext().$implicit;
|
|
109
|
+
const ctx_r4 = i0.ɵɵnextContext(4);
|
|
110
|
+
i0.ɵɵproperty("value", ctx_r4.getTextFilterValue(col_r11.filterField))("placeholder", "Filter " + col_r11.name + "...");
|
|
111
|
+
i0.ɵɵattribute("aria-label", "Filter " + col_r11.name);
|
|
112
|
+
} }
|
|
113
|
+
function SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
114
|
+
const _r12 = i0.ɵɵgetCurrentView();
|
|
115
|
+
i0.ɵɵelementStart(0, "div", 21)(1, "label", 24);
|
|
116
|
+
i0.ɵɵtext(2, " From: ");
|
|
117
|
+
i0.ɵɵelementStart(3, "input", 25);
|
|
118
|
+
i0.ɵɵlistener("change", function SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Conditional_4_Template_input_change_3_listener($event) { i0.ɵɵrestoreView(_r12); const col_r11 = i0.ɵɵnextContext().$implicit; const ctx_r4 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r4.onDateFromChange(col_r11.filterField, $event.target.value)); });
|
|
119
|
+
i0.ɵɵelementEnd()();
|
|
120
|
+
i0.ɵɵelementStart(4, "label", 24);
|
|
121
|
+
i0.ɵɵtext(5, " To: ");
|
|
122
|
+
i0.ɵɵelementStart(6, "input", 25);
|
|
123
|
+
i0.ɵɵlistener("change", function SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Conditional_4_Template_input_change_6_listener($event) { i0.ɵɵrestoreView(_r12); const col_r11 = i0.ɵɵnextContext().$implicit; const ctx_r4 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r4.onDateToChange(col_r11.filterField, $event.target.value)); });
|
|
124
|
+
i0.ɵɵelementEnd()()();
|
|
125
|
+
} if (rf & 2) {
|
|
126
|
+
const col_r11 = i0.ɵɵnextContext().$implicit;
|
|
127
|
+
const ctx_r4 = i0.ɵɵnextContext(4);
|
|
128
|
+
i0.ɵɵadvance(3);
|
|
129
|
+
i0.ɵɵproperty("value", ctx_r4.getDateFrom(col_r11.filterField));
|
|
130
|
+
i0.ɵɵattribute("aria-label", col_r11.name + " from date");
|
|
131
|
+
i0.ɵɵadvance(3);
|
|
132
|
+
i0.ɵɵproperty("value", ctx_r4.getDateTo(col_r11.filterField));
|
|
133
|
+
i0.ɵɵattribute("aria-label", col_r11.name + " to date");
|
|
134
|
+
} }
|
|
135
|
+
function SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Conditional_5_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
136
|
+
const _r13 = i0.ɵɵgetCurrentView();
|
|
137
|
+
i0.ɵɵelementStart(0, "label", 26)(1, "input", 27);
|
|
138
|
+
i0.ɵɵlistener("change", function SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Conditional_5_For_2_Template_input_change_1_listener($event) { const opt_r14 = i0.ɵɵrestoreView(_r13).$implicit; const col_r11 = i0.ɵɵnextContext(2).$implicit; const ctx_r4 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r4.onMultiSelectChange(col_r11.filterField, opt_r14, $event.target.checked)); });
|
|
139
|
+
i0.ɵɵelementEnd();
|
|
140
|
+
i0.ɵɵelementStart(2, "span");
|
|
141
|
+
i0.ɵɵtext(3);
|
|
142
|
+
i0.ɵɵelementEnd()();
|
|
143
|
+
} if (rf & 2) {
|
|
144
|
+
const opt_r14 = ctx.$implicit;
|
|
145
|
+
const col_r11 = i0.ɵɵnextContext(2).$implicit;
|
|
146
|
+
const ctx_r4 = i0.ɵɵnextContext(4);
|
|
147
|
+
i0.ɵɵadvance();
|
|
148
|
+
i0.ɵɵproperty("checked", ctx_r4.isMultiSelectChecked(col_r11.filterField, opt_r14));
|
|
149
|
+
i0.ɵɵadvance(2);
|
|
150
|
+
i0.ɵɵtextInterpolate(opt_r14);
|
|
151
|
+
} }
|
|
152
|
+
function SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
153
|
+
i0.ɵɵelementStart(0, "div", 22);
|
|
154
|
+
i0.ɵɵrepeaterCreate(1, SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Conditional_5_For_2_Template, 4, 2, "label", 26, i0.ɵɵrepeaterTrackByIdentity);
|
|
155
|
+
i0.ɵɵelementEnd();
|
|
156
|
+
} if (rf & 2) {
|
|
157
|
+
const col_r11 = i0.ɵɵnextContext().$implicit;
|
|
158
|
+
const ctx_r4 = i0.ɵɵnextContext(4);
|
|
159
|
+
i0.ɵɵattribute("aria-label", col_r11.name + " options");
|
|
160
|
+
i0.ɵɵadvance();
|
|
161
|
+
i0.ɵɵrepeater(ctx_r4.getFilterOptions(col_r11.filterField));
|
|
162
|
+
} }
|
|
163
|
+
function SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
164
|
+
i0.ɵɵelementStart(0, "div", 18)(1, "div", 19);
|
|
165
|
+
i0.ɵɵtext(2);
|
|
166
|
+
i0.ɵɵelementEnd();
|
|
167
|
+
i0.ɵɵconditionalCreate(3, SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Conditional_3_Template, 1, 3, "input", 20);
|
|
168
|
+
i0.ɵɵconditionalCreate(4, SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Conditional_4_Template, 7, 4, "div", 21);
|
|
169
|
+
i0.ɵɵconditionalCreate(5, SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Conditional_5_Template, 3, 1, "div", 22);
|
|
170
|
+
i0.ɵɵelementEnd();
|
|
171
|
+
} if (rf & 2) {
|
|
172
|
+
const col_r11 = ctx.$implicit;
|
|
173
|
+
i0.ɵɵadvance(2);
|
|
174
|
+
i0.ɵɵtextInterpolate(col_r11.name);
|
|
175
|
+
i0.ɵɵadvance();
|
|
176
|
+
i0.ɵɵconditional(col_r11.filterType === "text" ? 3 : -1);
|
|
177
|
+
i0.ɵɵadvance();
|
|
178
|
+
i0.ɵɵconditional(col_r11.filterType === "date" ? 4 : -1);
|
|
179
|
+
i0.ɵɵadvance();
|
|
180
|
+
i0.ɵɵconditional(col_r11.filterType === "multiSelect" ? 5 : -1);
|
|
181
|
+
} }
|
|
182
|
+
function SideBarComponent_ng_template_5_Conditional_0_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
183
|
+
i0.ɵɵconditionalCreate(0, SideBarComponent_ng_template_5_Conditional_0_Conditional_8_Conditional_0_Template, 2, 0, "div", 17);
|
|
184
|
+
i0.ɵɵrepeaterCreate(1, SideBarComponent_ng_template_5_Conditional_0_Conditional_8_For_2_Template, 6, 4, "div", 18, _forTrack0);
|
|
185
|
+
} if (rf & 2) {
|
|
186
|
+
const ctx_r4 = i0.ɵɵnextContext(3);
|
|
187
|
+
i0.ɵɵconditional(((ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.filterableColumns) ?? i0.ɵɵpureFunction0(1, _c0)).length === 0 ? 0 : -1);
|
|
188
|
+
i0.ɵɵadvance();
|
|
189
|
+
i0.ɵɵrepeater((ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.filterableColumns) ?? i0.ɵɵpureFunction0(2, _c0));
|
|
190
|
+
} }
|
|
191
|
+
function SideBarComponent_ng_template_5_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
192
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
193
|
+
i0.ɵɵelementStart(0, "div", 8)(1, "div", 9)(2, "span");
|
|
194
|
+
i0.ɵɵtext(3);
|
|
195
|
+
i0.ɵɵelementEnd();
|
|
196
|
+
i0.ɵɵelementStart(4, "button", 10);
|
|
197
|
+
i0.ɵɵlistener("click", function SideBarComponent_ng_template_5_Conditional_0_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r6); const ctx_r4 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.onPanelChange(null)); });
|
|
198
|
+
i0.ɵɵtext(5, "\u00D7");
|
|
199
|
+
i0.ɵɵelementEnd()();
|
|
200
|
+
i0.ɵɵelementStart(6, "div", 11);
|
|
201
|
+
i0.ɵɵconditionalCreate(7, SideBarComponent_ng_template_5_Conditional_0_Conditional_7_Template, 7, 2);
|
|
202
|
+
i0.ɵɵconditionalCreate(8, SideBarComponent_ng_template_5_Conditional_0_Conditional_8_Template, 3, 3);
|
|
203
|
+
i0.ɵɵelementEnd()();
|
|
204
|
+
} if (rf & 2) {
|
|
205
|
+
const ctx_r4 = i0.ɵɵnextContext(2);
|
|
206
|
+
i0.ɵɵclassProp("ogrid-sidebar-panel--left", (ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.position) === "left")("ogrid-sidebar-panel--right", (ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.position) === "right");
|
|
207
|
+
i0.ɵɵattribute("aria-label", ctx_r4.panelLabels[ctx_r4.sideBarProps.activePanel]);
|
|
208
|
+
i0.ɵɵadvance(3);
|
|
209
|
+
i0.ɵɵtextInterpolate(ctx_r4.panelLabels[ctx_r4.sideBarProps.activePanel]);
|
|
210
|
+
i0.ɵɵadvance(4);
|
|
211
|
+
i0.ɵɵconditional((ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.activePanel) === "columns" ? 7 : -1);
|
|
212
|
+
i0.ɵɵadvance();
|
|
213
|
+
i0.ɵɵconditional((ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.activePanel) === "filters" ? 8 : -1);
|
|
214
|
+
} }
|
|
215
|
+
function SideBarComponent_ng_template_5_Template(rf, ctx) { if (rf & 1) {
|
|
216
|
+
i0.ɵɵconditionalCreate(0, SideBarComponent_ng_template_5_Conditional_0_Template, 9, 8, "div", 7);
|
|
217
|
+
} if (rf & 2) {
|
|
218
|
+
const ctx_r4 = i0.ɵɵnextContext();
|
|
219
|
+
i0.ɵɵconditional((ctx_r4.sideBarProps == null ? null : ctx_r4.sideBarProps.activePanel) ? 0 : -1);
|
|
220
|
+
} }
|
|
221
|
+
const PANEL_LABELS = { columns: 'Columns', filters: 'Filters' };
|
|
222
|
+
export class SideBarComponent {
|
|
223
|
+
constructor() {
|
|
224
|
+
this.sideBarProps = null;
|
|
225
|
+
this.panelLabels = PANEL_LABELS;
|
|
226
|
+
}
|
|
227
|
+
onTabClick(panel) {
|
|
228
|
+
const props = this.sideBarProps;
|
|
229
|
+
if (props)
|
|
230
|
+
props.onPanelChange(props.activePanel === panel ? null : panel);
|
|
231
|
+
}
|
|
232
|
+
allVisible() {
|
|
233
|
+
const props = this.sideBarProps;
|
|
234
|
+
if (!props)
|
|
235
|
+
return false;
|
|
236
|
+
return props.columns.every((c) => props.visibleColumns.has(c.columnId));
|
|
237
|
+
}
|
|
238
|
+
onSelectAll() {
|
|
239
|
+
const props = this.sideBarProps;
|
|
240
|
+
if (!props)
|
|
241
|
+
return;
|
|
242
|
+
const next = new Set(props.visibleColumns);
|
|
243
|
+
props.columns.forEach((c) => next.add(c.columnId));
|
|
244
|
+
props.onSetVisibleColumns(next);
|
|
245
|
+
}
|
|
246
|
+
onClearAll() {
|
|
247
|
+
const props = this.sideBarProps;
|
|
248
|
+
if (!props)
|
|
249
|
+
return;
|
|
250
|
+
const next = new Set();
|
|
251
|
+
props.columns.forEach((c) => {
|
|
252
|
+
if (c.required && props.visibleColumns.has(c.columnId))
|
|
253
|
+
next.add(c.columnId);
|
|
254
|
+
});
|
|
255
|
+
props.onSetVisibleColumns(next);
|
|
256
|
+
}
|
|
257
|
+
onVisibilityChange(columnKey, visible) {
|
|
258
|
+
this.sideBarProps?.onVisibilityChange(columnKey, visible);
|
|
259
|
+
}
|
|
260
|
+
getTextFilterValue(filterField) {
|
|
261
|
+
const filters = this.sideBarProps?.filters;
|
|
262
|
+
const fv = filters?.[filterField];
|
|
263
|
+
return fv?.type === 'text' ? fv.value : '';
|
|
264
|
+
}
|
|
265
|
+
onTextFilterChange(filterField, value) {
|
|
266
|
+
this.sideBarProps?.onFilterChange(filterField, value ? { type: 'text', value } : undefined);
|
|
267
|
+
}
|
|
268
|
+
getDateFrom(filterField) {
|
|
269
|
+
const fv = this.sideBarProps?.filters?.[filterField];
|
|
270
|
+
return fv?.type === 'date' ? (fv.value.from ?? '') : '';
|
|
271
|
+
}
|
|
272
|
+
getDateTo(filterField) {
|
|
273
|
+
const fv = this.sideBarProps?.filters?.[filterField];
|
|
274
|
+
return fv?.type === 'date' ? (fv.value.to ?? '') : '';
|
|
275
|
+
}
|
|
276
|
+
onDateFromChange(filterField, value) {
|
|
277
|
+
const fv = this.sideBarProps?.filters?.[filterField];
|
|
278
|
+
const existing = fv?.type === 'date' ? fv.value : {};
|
|
279
|
+
const from = value || undefined;
|
|
280
|
+
const to = existing.to;
|
|
281
|
+
this.sideBarProps?.onFilterChange(filterField, from || to ? { type: 'date', value: { from, to } } : undefined);
|
|
282
|
+
}
|
|
283
|
+
onDateToChange(filterField, value) {
|
|
284
|
+
const fv = this.sideBarProps?.filters?.[filterField];
|
|
285
|
+
const existing = fv?.type === 'date' ? fv.value : {};
|
|
286
|
+
const to = value || undefined;
|
|
287
|
+
const from = existing.from;
|
|
288
|
+
this.sideBarProps?.onFilterChange(filterField, from || to ? { type: 'date', value: { from, to } } : undefined);
|
|
289
|
+
}
|
|
290
|
+
getFilterOptions(filterField) {
|
|
291
|
+
return this.sideBarProps?.filterOptions?.[filterField] ?? [];
|
|
292
|
+
}
|
|
293
|
+
isMultiSelectChecked(filterField, opt) {
|
|
294
|
+
const fv = this.sideBarProps?.filters?.[filterField];
|
|
295
|
+
return fv?.type === 'multiSelect' ? fv.value.includes(opt) : false;
|
|
296
|
+
}
|
|
297
|
+
onMultiSelectChange(filterField, opt, checked) {
|
|
298
|
+
const fv = this.sideBarProps?.filters?.[filterField];
|
|
299
|
+
const current = fv?.type === 'multiSelect' ? fv.value : [];
|
|
300
|
+
const next = checked ? [...current, opt] : current.filter((v) => v !== opt);
|
|
301
|
+
this.sideBarProps?.onFilterChange(filterField, next.length > 0 ? { type: 'multiSelect', value: next } : undefined);
|
|
302
|
+
}
|
|
303
|
+
static { this.ɵfac = function SideBarComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SideBarComponent)(); }; }
|
|
304
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SideBarComponent, selectors: [["ogrid-sidebar"]], inputs: { sideBarProps: "sideBarProps" }, decls: 7, vars: 2, consts: [["tabStripTpl", ""], ["panelContentTpl", ""], ["role", "complementary", "aria-label", "Side bar", 1, "ogrid-sidebar-root"], [4, "ngTemplateOutlet"], ["role", "tablist", "aria-label", "Side bar tabs", 1, "ogrid-sidebar-tab-strip"], ["role", "tab", 1, "ogrid-sidebar-tab", 3, "ogrid-sidebar-tab--active", "title"], ["role", "tab", 1, "ogrid-sidebar-tab", 3, "click", "title"], ["role", "tabpanel", 1, "ogrid-sidebar-panel", 3, "ogrid-sidebar-panel--left", "ogrid-sidebar-panel--right"], ["role", "tabpanel", 1, "ogrid-sidebar-panel"], [1, "ogrid-sidebar-panel-header"], ["aria-label", "Close panel", 1, "ogrid-sidebar-panel-close", 3, "click"], [1, "ogrid-sidebar-panel-body"], [1, "ogrid-sidebar-actions"], [1, "ogrid-sidebar-action-btn", 3, "click", "disabled"], [1, "ogrid-sidebar-action-btn", 3, "click"], [1, "ogrid-sidebar-col-label"], ["type", "checkbox", 3, "change", "checked", "disabled"], [1, "ogrid-sidebar-empty"], [1, "ogrid-sidebar-filter-group"], [1, "ogrid-sidebar-filter-label"], ["type", "text", 1, "ogrid-sidebar-text-input", 3, "value", "placeholder"], [1, "ogrid-sidebar-date-row"], ["role", "group", 1, "ogrid-sidebar-multiselect-list"], ["type", "text", 1, "ogrid-sidebar-text-input", 3, "input", "value", "placeholder"], [1, "ogrid-sidebar-date-label"], ["type", "date", 1, "ogrid-sidebar-date-input", 3, "change", "value"], [1, "ogrid-sidebar-multiselect-item"], ["type", "checkbox", 3, "change", "checked"]], template: function SideBarComponent_Template(rf, ctx) { if (rf & 1) {
|
|
305
|
+
i0.ɵɵelementStart(0, "div", 2);
|
|
306
|
+
i0.ɵɵconditionalCreate(1, SideBarComponent_Conditional_1_Template, 2, 2);
|
|
307
|
+
i0.ɵɵconditionalCreate(2, SideBarComponent_Conditional_2_Template, 2, 2);
|
|
308
|
+
i0.ɵɵelementEnd();
|
|
309
|
+
i0.ɵɵtemplate(3, SideBarComponent_ng_template_3_Template, 3, 5, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(5, SideBarComponent_ng_template_5_Template, 1, 1, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
|
|
310
|
+
} if (rf & 2) {
|
|
311
|
+
i0.ɵɵadvance();
|
|
312
|
+
i0.ɵɵconditional((ctx.sideBarProps == null ? null : ctx.sideBarProps.position) === "left" ? 1 : -1);
|
|
313
|
+
i0.ɵɵadvance();
|
|
314
|
+
i0.ɵɵconditional((ctx.sideBarProps == null ? null : ctx.sideBarProps.position) === "right" ? 2 : -1);
|
|
315
|
+
} }, dependencies: [NgTemplateOutlet], styles: [".ogrid-sidebar-root[_ngcontent-%COMP%] { display: flex; flex-direction: row; flex-shrink: 0; }\n .ogrid-sidebar-tab-strip[_ngcontent-%COMP%] {\n display: flex; flex-direction: column;\n width: var(--ogrid-sidebar-tab-size, 36px);\n background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04));\n }\n .ogrid-sidebar-tab-strip--left[_ngcontent-%COMP%] { border-right: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); }\n .ogrid-sidebar-tab-strip--right[_ngcontent-%COMP%] { border-left: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); }\n .ogrid-sidebar-tab[_ngcontent-%COMP%] {\n width: var(--ogrid-sidebar-tab-size, 36px);\n height: var(--ogrid-sidebar-tab-size, 36px);\n border: none; cursor: pointer;\n color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)); font-size: 14px;\n display: flex; align-items: center; justify-content: center;\n background: transparent; font-weight: normal;\n }\n .ogrid-sidebar-tab--active[_ngcontent-%COMP%] { background: var(--ogrid-bg, #ffffff); font-weight: bold; }\n .ogrid-sidebar-panel[_ngcontent-%COMP%] {\n width: var(--ogrid-sidebar-panel-width, 240px);\n display: flex; flex-direction: column; overflow: hidden;\n background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));\n }\n .ogrid-sidebar-panel--left[_ngcontent-%COMP%] { border-right: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); }\n .ogrid-sidebar-panel--right[_ngcontent-%COMP%] { border-left: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); }\n .ogrid-sidebar-panel-header[_ngcontent-%COMP%] {\n display: flex; justify-content: space-between; align-items: center;\n padding: 8px 12px; border-bottom: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); font-weight: 600;\n }\n .ogrid-sidebar-panel-close[_ngcontent-%COMP%] {\n border: none; background: transparent; cursor: pointer;\n font-size: 16px; color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));\n }\n .ogrid-sidebar-panel-body[_ngcontent-%COMP%] { flex: 1; overflow-y: auto; padding: 8px 12px; }\n .ogrid-sidebar-actions[_ngcontent-%COMP%] { display: flex; gap: 8px; margin-bottom: 8px; }\n .ogrid-sidebar-action-btn[_ngcontent-%COMP%] {\n flex: 1; cursor: pointer;\n background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));\n border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); border-radius: 4px; padding: 4px 8px;\n }\n .ogrid-sidebar-col-label[_ngcontent-%COMP%] { display: flex; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer; }\n .ogrid-sidebar-empty[_ngcontent-%COMP%] { color: var(--ogrid-fg-muted, rgba(0, 0, 0, 0.5)); font-style: italic; }\n .ogrid-sidebar-filter-group[_ngcontent-%COMP%] { margin-bottom: 12px; }\n .ogrid-sidebar-filter-label[_ngcontent-%COMP%] { font-weight: 500; margin-bottom: 4px; font-size: 13px; }\n .ogrid-sidebar-text-input[_ngcontent-%COMP%] {\n width: 100%; box-sizing: border-box; padding: 4px 6px;\n background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));\n border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); border-radius: 4px;\n }\n .ogrid-sidebar-date-row[_ngcontent-%COMP%] { display: flex; flex-direction: column; gap: 4px; }\n .ogrid-sidebar-date-label[_ngcontent-%COMP%] { display: flex; align-items: center; gap: 4px; font-size: 12px; }\n .ogrid-sidebar-date-input[_ngcontent-%COMP%] {\n flex: 1; padding: 2px 4px;\n background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));\n border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); border-radius: 4px;\n }\n .ogrid-sidebar-multiselect-list[_ngcontent-%COMP%] { max-height: 120px; overflow-y: auto; }\n .ogrid-sidebar-multiselect-item[_ngcontent-%COMP%] {\n display: flex; align-items: center; gap: 4px;\n padding: 1px 0; cursor: pointer; font-size: 13px;\n }"], changeDetection: 0 }); }
|
|
316
|
+
}
|
|
317
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SideBarComponent, [{
|
|
318
|
+
type: Component,
|
|
319
|
+
args: [{ selector: 'ogrid-sidebar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], template: `
|
|
320
|
+
<div class="ogrid-sidebar-root" role="complementary" aria-label="Side bar">
|
|
321
|
+
@if (sideBarProps?.position === 'left') {
|
|
322
|
+
<ng-container *ngTemplateOutlet="tabStripTpl"></ng-container>
|
|
323
|
+
<ng-container *ngTemplateOutlet="panelContentTpl"></ng-container>
|
|
324
|
+
}
|
|
325
|
+
@if (sideBarProps?.position === 'right') {
|
|
326
|
+
<ng-container *ngTemplateOutlet="panelContentTpl"></ng-container>
|
|
327
|
+
<ng-container *ngTemplateOutlet="tabStripTpl"></ng-container>
|
|
328
|
+
}
|
|
329
|
+
</div>
|
|
330
|
+
|
|
331
|
+
<ng-template #tabStripTpl>
|
|
332
|
+
<div
|
|
333
|
+
class="ogrid-sidebar-tab-strip"
|
|
334
|
+
[class.ogrid-sidebar-tab-strip--left]="sideBarProps?.position === 'left'"
|
|
335
|
+
[class.ogrid-sidebar-tab-strip--right]="sideBarProps?.position === 'right'"
|
|
336
|
+
role="tablist"
|
|
337
|
+
aria-label="Side bar tabs"
|
|
338
|
+
>
|
|
339
|
+
@for (panel of sideBarProps?.panels ?? []; track panel) {
|
|
340
|
+
<button
|
|
341
|
+
role="tab"
|
|
342
|
+
class="ogrid-sidebar-tab"
|
|
343
|
+
[class.ogrid-sidebar-tab--active]="sideBarProps?.activePanel === panel"
|
|
344
|
+
[attr.aria-selected]="sideBarProps?.activePanel === panel"
|
|
345
|
+
[attr.aria-label]="panelLabels[panel]"
|
|
346
|
+
(click)="onTabClick(panel)"
|
|
347
|
+
[title]="panelLabels[panel]"
|
|
348
|
+
>
|
|
349
|
+
{{ panel === 'columns' ? '\u2261' : '\u2A65' }}
|
|
350
|
+
</button>
|
|
351
|
+
}
|
|
352
|
+
</div>
|
|
353
|
+
</ng-template>
|
|
354
|
+
|
|
355
|
+
<ng-template #panelContentTpl>
|
|
356
|
+
@if (sideBarProps?.activePanel) {
|
|
357
|
+
<div
|
|
358
|
+
role="tabpanel"
|
|
359
|
+
class="ogrid-sidebar-panel"
|
|
360
|
+
[class.ogrid-sidebar-panel--left]="sideBarProps?.position === 'left'"
|
|
361
|
+
[class.ogrid-sidebar-panel--right]="sideBarProps?.position === 'right'"
|
|
362
|
+
[attr.aria-label]="panelLabels[sideBarProps!.activePanel!]"
|
|
363
|
+
>
|
|
364
|
+
<div class="ogrid-sidebar-panel-header">
|
|
365
|
+
<span>{{ panelLabels[sideBarProps!.activePanel!] }}</span>
|
|
366
|
+
<button (click)="sideBarProps?.onPanelChange(null)" class="ogrid-sidebar-panel-close" aria-label="Close panel">×</button>
|
|
367
|
+
</div>
|
|
368
|
+
<div class="ogrid-sidebar-panel-body">
|
|
369
|
+
@if (sideBarProps?.activePanel === 'columns') {
|
|
370
|
+
<div class="ogrid-sidebar-actions">
|
|
371
|
+
<button (click)="onSelectAll()" [disabled]="allVisible()" class="ogrid-sidebar-action-btn">Select All</button>
|
|
372
|
+
<button (click)="onClearAll()" class="ogrid-sidebar-action-btn">Clear All</button>
|
|
373
|
+
</div>
|
|
374
|
+
@for (col of sideBarProps?.columns ?? []; track col.columnId) {
|
|
375
|
+
<label class="ogrid-sidebar-col-label">
|
|
376
|
+
<input type="checkbox" [checked]="sideBarProps?.visibleColumns?.has(col.columnId)" (change)="onVisibilityChange(col.columnId, $any($event.target).checked)" [disabled]="col.required" />
|
|
377
|
+
<span>{{ col.name }}</span>
|
|
378
|
+
</label>
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
@if (sideBarProps?.activePanel === 'filters') {
|
|
382
|
+
@if ((sideBarProps?.filterableColumns ?? []).length === 0) {
|
|
383
|
+
<div class="ogrid-sidebar-empty">No filterable columns</div>
|
|
384
|
+
}
|
|
385
|
+
@for (col of sideBarProps?.filterableColumns ?? []; track col.columnId) {
|
|
386
|
+
<div class="ogrid-sidebar-filter-group">
|
|
387
|
+
<div class="ogrid-sidebar-filter-label">{{ col.name }}</div>
|
|
388
|
+
@if (col.filterType === 'text') {
|
|
389
|
+
<input
|
|
390
|
+
type="text"
|
|
391
|
+
class="ogrid-sidebar-text-input"
|
|
392
|
+
[value]="getTextFilterValue(col.filterField)"
|
|
393
|
+
(input)="onTextFilterChange(col.filterField, $any($event.target).value)"
|
|
394
|
+
[placeholder]="'Filter ' + col.name + '...'"
|
|
395
|
+
[attr.aria-label]="'Filter ' + col.name"
|
|
396
|
+
/>
|
|
397
|
+
}
|
|
398
|
+
@if (col.filterType === 'date') {
|
|
399
|
+
<div class="ogrid-sidebar-date-row">
|
|
400
|
+
<label class="ogrid-sidebar-date-label">
|
|
401
|
+
From:
|
|
402
|
+
<input type="date" class="ogrid-sidebar-date-input" [value]="getDateFrom(col.filterField)" (change)="onDateFromChange(col.filterField, $any($event.target).value)" [attr.aria-label]="col.name + ' from date'" />
|
|
403
|
+
</label>
|
|
404
|
+
<label class="ogrid-sidebar-date-label">
|
|
405
|
+
To:
|
|
406
|
+
<input type="date" class="ogrid-sidebar-date-input" [value]="getDateTo(col.filterField)" (change)="onDateToChange(col.filterField, $any($event.target).value)" [attr.aria-label]="col.name + ' to date'" />
|
|
407
|
+
</label>
|
|
408
|
+
</div>
|
|
409
|
+
}
|
|
410
|
+
@if (col.filterType === 'multiSelect') {
|
|
411
|
+
<div class="ogrid-sidebar-multiselect-list" role="group" [attr.aria-label]="col.name + ' options'">
|
|
412
|
+
@for (opt of getFilterOptions(col.filterField); track opt) {
|
|
413
|
+
<label class="ogrid-sidebar-multiselect-item">
|
|
414
|
+
<input type="checkbox" [checked]="isMultiSelectChecked(col.filterField, opt)" (change)="onMultiSelectChange(col.filterField, opt, $any($event.target).checked)" />
|
|
415
|
+
<span>{{ opt }}</span>
|
|
416
|
+
</label>
|
|
417
|
+
}
|
|
418
|
+
</div>
|
|
419
|
+
}
|
|
420
|
+
</div>
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
</div>
|
|
424
|
+
</div>
|
|
425
|
+
}
|
|
426
|
+
</ng-template>
|
|
427
|
+
`, styles: ["\n .ogrid-sidebar-root { display: flex; flex-direction: row; flex-shrink: 0; }\n .ogrid-sidebar-tab-strip {\n display: flex; flex-direction: column;\n width: var(--ogrid-sidebar-tab-size, 36px);\n background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04));\n }\n .ogrid-sidebar-tab-strip--left { border-right: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); }\n .ogrid-sidebar-tab-strip--right { border-left: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); }\n .ogrid-sidebar-tab {\n width: var(--ogrid-sidebar-tab-size, 36px);\n height: var(--ogrid-sidebar-tab-size, 36px);\n border: none; cursor: pointer;\n color: var(--ogrid-fg, rgba(0, 0, 0, 0.87)); font-size: 14px;\n display: flex; align-items: center; justify-content: center;\n background: transparent; font-weight: normal;\n }\n .ogrid-sidebar-tab--active { background: var(--ogrid-bg, #ffffff); font-weight: bold; }\n .ogrid-sidebar-panel {\n width: var(--ogrid-sidebar-panel-width, 240px);\n display: flex; flex-direction: column; overflow: hidden;\n background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));\n }\n .ogrid-sidebar-panel--left { border-right: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); }\n .ogrid-sidebar-panel--right { border-left: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); }\n .ogrid-sidebar-panel-header {\n display: flex; justify-content: space-between; align-items: center;\n padding: 8px 12px; border-bottom: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); font-weight: 600;\n }\n .ogrid-sidebar-panel-close {\n border: none; background: transparent; cursor: pointer;\n font-size: 16px; color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));\n }\n .ogrid-sidebar-panel-body { flex: 1; overflow-y: auto; padding: 8px 12px; }\n .ogrid-sidebar-actions { display: flex; gap: 8px; margin-bottom: 8px; }\n .ogrid-sidebar-action-btn {\n flex: 1; cursor: pointer;\n background: var(--ogrid-header-bg, rgba(0, 0, 0, 0.04)); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));\n border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); border-radius: 4px; padding: 4px 8px;\n }\n .ogrid-sidebar-col-label { display: flex; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer; }\n .ogrid-sidebar-empty { color: var(--ogrid-fg-muted, rgba(0, 0, 0, 0.5)); font-style: italic; }\n .ogrid-sidebar-filter-group { margin-bottom: 12px; }\n .ogrid-sidebar-filter-label { font-weight: 500; margin-bottom: 4px; font-size: 13px; }\n .ogrid-sidebar-text-input {\n width: 100%; box-sizing: border-box; padding: 4px 6px;\n background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));\n border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); border-radius: 4px;\n }\n .ogrid-sidebar-date-row { display: flex; flex-direction: column; gap: 4px; }\n .ogrid-sidebar-date-label { display: flex; align-items: center; gap: 4px; font-size: 12px; }\n .ogrid-sidebar-date-input {\n flex: 1; padding: 2px 4px;\n background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));\n border: 1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12)); border-radius: 4px;\n }\n .ogrid-sidebar-multiselect-list { max-height: 120px; overflow-y: auto; }\n .ogrid-sidebar-multiselect-item {\n display: flex; align-items: center; gap: 4px;\n padding: 1px 0; cursor: pointer; font-size: 13px;\n }\n "] }]
|
|
428
|
+
}], null, { sideBarProps: [{
|
|
429
|
+
type: Input
|
|
430
|
+
}] }); })();
|
|
431
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SideBarComponent, { className: "SideBarComponent", filePath: "components/sidebar.component.ts", lineNumber: 208 }); })();
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { getStatusBarParts } from '@alaarab/ogrid-core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
const _forTrack0 = ($index, $item) => $item.key;
|
|
5
|
+
function StatusBarComponent_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
6
|
+
i0.ɵɵdomElementStart(0, "span")(1, "span");
|
|
7
|
+
i0.ɵɵtext(2);
|
|
8
|
+
i0.ɵɵdomElementEnd();
|
|
9
|
+
i0.ɵɵdomElementStart(3, "span");
|
|
10
|
+
i0.ɵɵtext(4);
|
|
11
|
+
i0.ɵɵdomElementEnd()();
|
|
12
|
+
} if (rf & 2) {
|
|
13
|
+
const part_r1 = ctx.$implicit;
|
|
14
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
15
|
+
i0.ɵɵclassMap((ctx_r1.classNames == null ? null : ctx_r1.classNames.statusBarItem) ?? "");
|
|
16
|
+
i0.ɵɵadvance();
|
|
17
|
+
i0.ɵɵclassMap((ctx_r1.classNames == null ? null : ctx_r1.classNames.statusBarLabel) ?? "");
|
|
18
|
+
i0.ɵɵadvance();
|
|
19
|
+
i0.ɵɵtextInterpolate(part_r1.label);
|
|
20
|
+
i0.ɵɵadvance();
|
|
21
|
+
i0.ɵɵclassMap((ctx_r1.classNames == null ? null : ctx_r1.classNames.statusBarValue) ?? "");
|
|
22
|
+
i0.ɵɵadvance();
|
|
23
|
+
i0.ɵɵtextInterpolate(part_r1.value.toLocaleString());
|
|
24
|
+
} }
|
|
25
|
+
export class StatusBarComponent {
|
|
26
|
+
constructor() {
|
|
27
|
+
this.filteredCount = undefined;
|
|
28
|
+
this.selectedCount = undefined;
|
|
29
|
+
this.selectedCellCount = undefined;
|
|
30
|
+
this.aggregation = undefined;
|
|
31
|
+
this.suppressRowCount = undefined;
|
|
32
|
+
this.classNames = undefined;
|
|
33
|
+
this.cachedParts = [];
|
|
34
|
+
}
|
|
35
|
+
ngOnChanges() {
|
|
36
|
+
this.cachedParts = getStatusBarParts({
|
|
37
|
+
totalCount: this.totalCount,
|
|
38
|
+
filteredCount: this.filteredCount,
|
|
39
|
+
selectedCount: this.selectedCount,
|
|
40
|
+
selectedCellCount: this.selectedCellCount,
|
|
41
|
+
aggregation: this.aggregation ?? undefined,
|
|
42
|
+
suppressRowCount: this.suppressRowCount,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
getParts() {
|
|
46
|
+
return this.cachedParts;
|
|
47
|
+
}
|
|
48
|
+
static { this.ɵfac = function StatusBarComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || StatusBarComponent)(); }; }
|
|
49
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: StatusBarComponent, selectors: [["ogrid-status-bar"]], inputs: { totalCount: "totalCount", filteredCount: "filteredCount", selectedCount: "selectedCount", selectedCellCount: "selectedCellCount", aggregation: "aggregation", suppressRowCount: "suppressRowCount", classNames: "classNames" }, features: [i0.ɵɵNgOnChangesFeature], decls: 3, vars: 2, consts: [["role", "status", "aria-live", "polite"], [3, "class"]], template: function StatusBarComponent_Template(rf, ctx) { if (rf & 1) {
|
|
50
|
+
i0.ɵɵdomElementStart(0, "div", 0);
|
|
51
|
+
i0.ɵɵrepeaterCreate(1, StatusBarComponent_For_2_Template, 5, 8, "span", 1, _forTrack0);
|
|
52
|
+
i0.ɵɵdomElementEnd();
|
|
53
|
+
} if (rf & 2) {
|
|
54
|
+
i0.ɵɵclassMap((ctx.classNames == null ? null : ctx.classNames.statusBar) ?? "");
|
|
55
|
+
i0.ɵɵadvance();
|
|
56
|
+
i0.ɵɵrepeater(ctx.getParts());
|
|
57
|
+
} }, encapsulation: 2, changeDetection: 0 }); }
|
|
58
|
+
}
|
|
59
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(StatusBarComponent, [{
|
|
60
|
+
type: Component,
|
|
61
|
+
args: [{
|
|
62
|
+
selector: 'ogrid-status-bar',
|
|
63
|
+
standalone: true,
|
|
64
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
65
|
+
template: `
|
|
66
|
+
<div [class]="classNames?.statusBar ?? ''" role="status" aria-live="polite">
|
|
67
|
+
@for (part of getParts(); track part.key) {
|
|
68
|
+
<span [class]="classNames?.statusBarItem ?? ''">
|
|
69
|
+
<span [class]="classNames?.statusBarLabel ?? ''">{{ part.label }}</span>
|
|
70
|
+
<span [class]="classNames?.statusBarValue ?? ''">{{ part.value.toLocaleString() }}</span>
|
|
71
|
+
</span>
|
|
72
|
+
}
|
|
73
|
+
</div>
|
|
74
|
+
`,
|
|
75
|
+
}]
|
|
76
|
+
}], null, { totalCount: [{
|
|
77
|
+
type: Input,
|
|
78
|
+
args: [{ required: true }]
|
|
79
|
+
}], filteredCount: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}], selectedCount: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}], selectedCellCount: [{
|
|
84
|
+
type: Input
|
|
85
|
+
}], aggregation: [{
|
|
86
|
+
type: Input
|
|
87
|
+
}], suppressRowCount: [{
|
|
88
|
+
type: Input
|
|
89
|
+
}], classNames: [{
|
|
90
|
+
type: Input
|
|
91
|
+
}] }); })();
|
|
92
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(StatusBarComponent, { className: "StatusBarComponent", filePath: "components/status-bar.component.ts", lineNumber: 19 }); })();
|