mis-crystal-design-system 17.0.2 → 17.0.4
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/analytics/analytics.service.d.ts +1 -1
- package/async-search-dropdown/async-dropdown.component.d.ts +4 -1
- package/esm2022/analytics/analytics.service.mjs +3 -3
- package/esm2022/async-search-dropdown/async-dropdown.component.mjs +27 -9
- package/esm2022/daterangepicker_v2/tz-drp-container/tz-drp-container.component.mjs +2 -1
- package/esm2022/filter/filter-panel/filter-panel.component.mjs +22 -22
- package/esm2022/input-stepper/input-stepper/input-stepper.component.mjs +29 -15
- package/esm2022/nested-multi-select-dropdown/nested-multi-select-dropdown.component.mjs +5 -5
- package/esm2022/slider/slider.component.mjs +2 -2
- package/esm2022/table/actions-cell/actions-cell.component.mjs +389 -0
- package/esm2022/table/public_api.mjs +5 -3
- package/esm2022/table/sort-icons.directive.mjs +139 -0
- package/esm2022/table/table.component.mjs +286 -109
- package/esm2022/table/table.module.mjs +41 -6
- package/esm2022/toast/public_api.mjs +3 -1
- package/esm2022/toast/toast.component.mjs +73 -16
- package/esm2022/toast/toast.constants.mjs +7 -0
- package/esm2022/toast/toast.data.service.mjs +1 -1
- package/esm2022/toast/toast.interface.mjs +2 -0
- package/esm2022/toast/toast.service.mjs +14 -7
- package/fesm2022/mis-crystal-design-system-action-list.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-analytics.mjs +2 -2
- package/fesm2022/mis-crystal-design-system-analytics.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-async-search-dropdown.mjs +26 -8
- package/fesm2022/mis-crystal-design-system-async-search-dropdown.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-button.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-checkbox.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-chip.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-datepicker_v2.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-daterangepicker_v2.mjs +1 -0
- package/fesm2022/mis-crystal-design-system-daterangepicker_v2.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-drawer.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-dropdown.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-dynamic-form.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-fab.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-filter.mjs +21 -21
- package/fesm2022/mis-crystal-design-system-filter.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-input-stepper.mjs +28 -14
- package/fesm2022/mis-crystal-design-system-input-stepper.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-input.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-loader.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-menu.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-mobile-filter.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-modal.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-multi-select-dropdown.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-nested-multi-select-dropdown.mjs +4 -4
- package/fesm2022/mis-crystal-design-system-nested-multi-select-dropdown.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-phone-input.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-radio-button.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-ske-loader.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-slider.mjs +2 -2
- package/fesm2022/mis-crystal-design-system-slider.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-snackbar.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-specificdatepicker.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-star-rating.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-switch.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-table.mjs +1143 -411
- package/fesm2022/mis-crystal-design-system-table.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-timepicker.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-timerangepicker.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-toast.mjs +93 -22
- package/fesm2022/mis-crystal-design-system-toast.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-tooltip.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-virtual-scroll.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-widgets.mjs.map +1 -1
- package/filter/filter-panel/filter-panel.component.d.ts +4 -3
- package/input-stepper/input-stepper/input-stepper.component.d.ts +5 -1
- package/package.json +13 -13
- package/table/actions-cell/actions-cell.component.d.ts +45 -0
- package/table/filter/filter.component.d.ts +1 -1
- package/table/public_api.d.ts +4 -2
- package/table/sort-icons.directive.d.ts +36 -0
- package/table/table.component.d.ts +56 -10
- package/table/table.module.d.ts +8 -4
- package/toast/public_api.d.ts +2 -0
- package/toast/toast.component.d.ts +13 -1
- package/toast/toast.constants.d.ts +5 -0
- package/toast/toast.data.service.d.ts +3 -2
- package/toast/toast.interface.d.ts +6 -0
- package/toast/toast.service.d.ts +2 -1
|
@@ -1,11 +1,674 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { EventEmitter, Component, Output, ViewChild, Input, ViewChildren, Directive, input, output, signal, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i2 from '@angular/cdk/scrolling';
|
|
6
6
|
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
7
7
|
import * as i2$1 from 'mis-crystal-design-system/checkbox';
|
|
8
8
|
import { CheckboxModule } from 'mis-crystal-design-system/checkbox';
|
|
9
|
+
import * as i1$1 from '@angular/cdk/overlay';
|
|
10
|
+
import { OverlayConfig, ConnectionPositionPair, OverlayModule } from '@angular/cdk/overlay';
|
|
11
|
+
import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
|
|
12
|
+
|
|
13
|
+
const _c0$3 = ["filter"];
|
|
14
|
+
const _c1$3 = ["table"];
|
|
15
|
+
const _c2$3 = ["colHeaderRef"];
|
|
16
|
+
const _c3$1 = (a0, a1, a2) => ({ height: a0, width: a1, "overflow-x": a2 });
|
|
17
|
+
const _c4$1 = (a0, a1, a2) => ({ "no-scrollbar": a0, scrollbar: a1, "scroll-horizontally": a2 });
|
|
18
|
+
const _c5$1 = (a0, a1, a2) => ({ width: a0, cursor: a1, "justify-content": a2 });
|
|
19
|
+
const _c6$1 = (a0, a1) => ({ "t-row-hover": a0, "active-row": a1 });
|
|
20
|
+
const _c7$1 = a0 => ({ "min-height": a0 });
|
|
21
|
+
const _c8 = a0 => ({ width: a0 });
|
|
22
|
+
const _c9 = a0 => ({ "t-col-container-hover": a0 });
|
|
23
|
+
const _c10 = (a0, a1) => ({ width: "100%", cursor: a0, "justify-content": a1 });
|
|
24
|
+
const _c11 = (a0, a1) => ({ color: a0, "--collapsed-lines": a1 });
|
|
25
|
+
const _c12 = a0 => ({ "collapsed-cell": a0 });
|
|
26
|
+
const _c13 = a0 => ({ "disable-actions": a0 });
|
|
27
|
+
const _c14 = () => ({ display: "flex", justifyContent: "center", alignItems: "center", padding: "16px" });
|
|
28
|
+
const _c15 = a0 => ({ "page-active": a0 });
|
|
29
|
+
const _c16 = () => ({ display: "flex" });
|
|
30
|
+
const _c17 = () => ({ "margin-right": "4px" });
|
|
31
|
+
function TableComponent_mis_table_filter_1_Template(rf, ctx) { if (rf & 1) {
|
|
32
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
33
|
+
i0.ɵɵelementStart(0, "mis-table-filter", 11, 1);
|
|
34
|
+
i0.ɵɵlistener("filtersApplied", function TableComponent_mis_table_filter_1_Template_mis_table_filter_filtersApplied_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.updateAppliedFilters($event)); });
|
|
35
|
+
i0.ɵɵelementEnd();
|
|
36
|
+
} if (rf & 2) {
|
|
37
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
38
|
+
i0.ɵɵproperty("containerStyles", ctx_r1.filterContainerStyles)("filtersData", ctx_r1.filterData);
|
|
39
|
+
} }
|
|
40
|
+
function TableComponent_div_5_p_2_Template(rf, ctx) { if (rf & 1) {
|
|
41
|
+
i0.ɵɵelementStart(0, "p", 18);
|
|
42
|
+
i0.ɵɵtext(1);
|
|
43
|
+
i0.ɵɵelementEnd();
|
|
44
|
+
} if (rf & 2) {
|
|
45
|
+
const colHeader_r4 = i0.ɵɵnextContext().$implicit;
|
|
46
|
+
i0.ɵɵadvance();
|
|
47
|
+
i0.ɵɵtextInterpolate1(" ", (colHeader_r4 == null ? null : colHeader_r4.data) || " ", " ");
|
|
48
|
+
} }
|
|
49
|
+
function TableComponent_div_5_span_3_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
50
|
+
i0.ɵɵelement(0, "span", 23);
|
|
51
|
+
} }
|
|
52
|
+
function TableComponent_div_5_span_3_Template(rf, ctx) { if (rf & 1) {
|
|
53
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
54
|
+
i0.ɵɵelementStart(0, "span", 19);
|
|
55
|
+
i0.ɵɵlistener("click", function TableComponent_div_5_span_3_Template_span_click_0_listener($event) { i0.ɵɵrestoreView(_r5); const colHeader_r4 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); ctx_r1.filterData = colHeader_r4.filters; ctx_r1.toggleFilter(colHeader_r4.data); return i0.ɵɵresetView($event.stopPropagation()); });
|
|
56
|
+
i0.ɵɵtemplate(1, TableComponent_div_5_span_3_span_1_Template, 1, 0, "span", 20);
|
|
57
|
+
i0.ɵɵnamespaceSVG();
|
|
58
|
+
i0.ɵɵelementStart(2, "svg", 21);
|
|
59
|
+
i0.ɵɵelement(3, "path", 22);
|
|
60
|
+
i0.ɵɵelementEnd()();
|
|
61
|
+
} if (rf & 2) {
|
|
62
|
+
const colHeader_r4 = i0.ɵɵnextContext().$implicit;
|
|
63
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
64
|
+
i0.ɵɵadvance();
|
|
65
|
+
i0.ɵɵproperty("ngIf", (ctx_r1.appliedFilters[colHeader_r4.data] == null ? null : ctx_r1.appliedFilters[colHeader_r4.data].length) > 0);
|
|
66
|
+
} }
|
|
67
|
+
function TableComponent_div_5_span_4_Template(rf, ctx) { if (rf & 1) {
|
|
68
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
69
|
+
i0.ɵɵelementStart(0, "span", 24);
|
|
70
|
+
i0.ɵɵlistener("click", function TableComponent_div_5_span_4_Template_span_click_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(2); ctx_r1.toggleCheckbox(); return i0.ɵɵresetView($event.stopPropagation()); });
|
|
71
|
+
i0.ɵɵelement(1, "mis-checkbox", 25);
|
|
72
|
+
i0.ɵɵelementEnd();
|
|
73
|
+
} if (rf & 2) {
|
|
74
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
75
|
+
i0.ɵɵadvance();
|
|
76
|
+
i0.ɵɵproperty("checked", ctx_r1.selectAllCheckbox);
|
|
77
|
+
} }
|
|
78
|
+
function TableComponent_div_5_span_5_Template(rf, ctx) { if (rf & 1) {
|
|
79
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
80
|
+
i0.ɵɵelementStart(0, "span", 26);
|
|
81
|
+
i0.ɵɵlistener("sortChange", function TableComponent_div_5_span_5_Template_span_sortChange_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onSortChange($event)); });
|
|
82
|
+
i0.ɵɵelementEnd();
|
|
83
|
+
} if (rf & 2) {
|
|
84
|
+
const colHeader_r4 = i0.ɵɵnextContext().$implicit;
|
|
85
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
86
|
+
i0.ɵɵproperty("column", colHeader_r4)("activeSort", ctx_r1.currentSort)("activeSorts", ctx_r1.multiColumnSort)("multiColumnSort", ctx_r1.config.multiColumnSort);
|
|
87
|
+
} }
|
|
88
|
+
function TableComponent_div_5_6_ng_template_0_Template(rf, ctx) { }
|
|
89
|
+
function TableComponent_div_5_6_Template(rf, ctx) { if (rf & 1) {
|
|
90
|
+
i0.ɵɵtemplate(0, TableComponent_div_5_6_ng_template_0_Template, 0, 0, "ng-template", 27);
|
|
91
|
+
} if (rf & 2) {
|
|
92
|
+
const colHeader_r4 = i0.ɵɵnextContext().$implicit;
|
|
93
|
+
i0.ɵɵproperty("customComponent", colHeader_r4 == null ? null : colHeader_r4.componentRef)("data", colHeader_r4.data);
|
|
94
|
+
} }
|
|
95
|
+
function TableComponent_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
96
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
97
|
+
i0.ɵɵelementStart(0, "div", 12, 2);
|
|
98
|
+
i0.ɵɵlistener("click", function TableComponent_div_5_Template_div_click_0_listener() { const colHeader_r4 = i0.ɵɵrestoreView(_r3).$implicit; return i0.ɵɵresetView((colHeader_r4 == null ? null : colHeader_r4.action) ? colHeader_r4 == null ? null : colHeader_r4.action(colHeader_r4) : null); });
|
|
99
|
+
i0.ɵɵtemplate(2, TableComponent_div_5_p_2_Template, 2, 1, "p", 13)(3, TableComponent_div_5_span_3_Template, 4, 1, "span", 14)(4, TableComponent_div_5_span_4_Template, 2, 1, "span", 15)(5, TableComponent_div_5_span_5_Template, 1, 4, "span", 16)(6, TableComponent_div_5_6_Template, 1, 2, null, 17);
|
|
100
|
+
i0.ɵɵelementEnd();
|
|
101
|
+
} if (rf & 2) {
|
|
102
|
+
const colHeader_r4 = ctx.$implicit;
|
|
103
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction3(6, _c5$1, (colHeader_r4 == null ? null : colHeader_r4.style == null ? null : colHeader_r4.style.width) || "", colHeader_r4.action ? "pointer" : "default", (colHeader_r4 == null ? null : colHeader_r4.style == null ? null : colHeader_r4.style.justifyContent) ? colHeader_r4 == null ? null : colHeader_r4.style == null ? null : colHeader_r4.style.justifyContent : colHeader_r4.type === "number" ? "flex-end" : "space-between"));
|
|
104
|
+
i0.ɵɵadvance(2);
|
|
105
|
+
i0.ɵɵproperty("ngIf", (colHeader_r4 == null ? null : colHeader_r4.type) !== "custom" && (colHeader_r4 == null ? null : colHeader_r4.type) !== "checkbox");
|
|
106
|
+
i0.ɵɵadvance();
|
|
107
|
+
i0.ɵɵproperty("ngIf", (colHeader_r4 == null ? null : colHeader_r4.type) !== "custom" && (colHeader_r4 == null ? null : colHeader_r4.filters) && (colHeader_r4 == null ? null : colHeader_r4.filters == null ? null : colHeader_r4.filters.length) > 0);
|
|
108
|
+
i0.ɵɵadvance();
|
|
109
|
+
i0.ɵɵproperty("ngIf", (colHeader_r4 == null ? null : colHeader_r4.type) === "checkbox");
|
|
110
|
+
i0.ɵɵadvance();
|
|
111
|
+
i0.ɵɵproperty("ngIf", (colHeader_r4 == null ? null : colHeader_r4.isSortable) && !(colHeader_r4 == null ? null : colHeader_r4.filters));
|
|
112
|
+
i0.ɵɵadvance();
|
|
113
|
+
i0.ɵɵproperty("ngIf", (colHeader_r4 == null ? null : colHeader_r4.type) === "custom");
|
|
114
|
+
} }
|
|
115
|
+
function TableComponent_div_7_div_2_p_2_Template(rf, ctx) { if (rf & 1) {
|
|
116
|
+
i0.ɵɵelementStart(0, "p", 36);
|
|
117
|
+
i0.ɵɵtext(1);
|
|
118
|
+
i0.ɵɵelementEnd();
|
|
119
|
+
} if (rf & 2) {
|
|
120
|
+
const ctx_r13 = i0.ɵɵnextContext();
|
|
121
|
+
const col_r12 = ctx_r13.$implicit;
|
|
122
|
+
const i_r13 = ctx_r13.index;
|
|
123
|
+
const rowIndex_r15 = i0.ɵɵnextContext().index;
|
|
124
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
125
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction2(3, _c11, (ctx_r1.config == null ? null : ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].style == null ? null : ctx_r1.config.colConfig[i_r13].style.color) || "", ctx_r1.previewLines || 3))("ngClass", i0.ɵɵpureFunction1(6, _c12, ctx_r1.collapseColIndex == i_r13 && ctx_r1.expandedMap[rowIndex_r15]));
|
|
126
|
+
i0.ɵɵadvance();
|
|
127
|
+
i0.ɵɵtextInterpolate1(" ", col_r12, " ");
|
|
128
|
+
} }
|
|
129
|
+
function TableComponent_div_7_div_2_3_ng_template_0_Template(rf, ctx) { }
|
|
130
|
+
function TableComponent_div_7_div_2_3_Template(rf, ctx) { if (rf & 1) {
|
|
131
|
+
i0.ɵɵtemplate(0, TableComponent_div_7_div_2_3_ng_template_0_Template, 0, 0, "ng-template", 27);
|
|
132
|
+
} if (rf & 2) {
|
|
133
|
+
const ctx_r13 = i0.ɵɵnextContext();
|
|
134
|
+
const col_r12 = ctx_r13.$implicit;
|
|
135
|
+
const i_r13 = ctx_r13.index;
|
|
136
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
137
|
+
i0.ɵɵproperty("customComponent", ctx_r1.config.colConfig[i_r13].componentRef)("data", col_r12);
|
|
138
|
+
} }
|
|
139
|
+
function TableComponent_div_7_div_2_mis_actions_cell_4_Template(rf, ctx) { if (rf & 1) {
|
|
140
|
+
const _r16 = i0.ɵɵgetCurrentView();
|
|
141
|
+
i0.ɵɵelementStart(0, "mis-actions-cell", 37);
|
|
142
|
+
i0.ɵɵlistener("actionClick", function TableComponent_div_7_div_2_mis_actions_cell_4_Template_mis_actions_cell_actionClick_0_listener($event) { i0.ɵɵrestoreView(_r16); const rowIndex_r15 = i0.ɵɵnextContext(2).index; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onActionClick($event, rowIndex_r15)); });
|
|
143
|
+
i0.ɵɵelementEnd();
|
|
144
|
+
} if (rf & 2) {
|
|
145
|
+
const ctx_r13 = i0.ɵɵnextContext();
|
|
146
|
+
const col_r12 = ctx_r13.$implicit;
|
|
147
|
+
const i_r13 = ctx_r13.index;
|
|
148
|
+
const row_r17 = i0.ɵɵnextContext().$implicit;
|
|
149
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
150
|
+
i0.ɵɵproperty("cellData", col_r12)("config", ctx_r1.config.colConfig[i_r13])("ngClass", i0.ɵɵpureFunction1(3, _c13, ((ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].actionType) === "checkbox" || (ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].actionType) === "row-collapse") && ctx_r1.isRowDisabled(row_r17)));
|
|
151
|
+
} }
|
|
152
|
+
function TableComponent_div_7_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
153
|
+
const _r10 = i0.ɵɵgetCurrentView();
|
|
154
|
+
i0.ɵɵelementStart(0, "div", 32);
|
|
155
|
+
i0.ɵɵlistener("click", function TableComponent_div_7_div_2_Template_div_click_0_listener() { const ctx_r10 = i0.ɵɵrestoreView(_r10); const col_r12 = ctx_r10.$implicit; const i_r13 = ctx_r10.index; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView((ctx_r1.config == null ? null : ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].action) && (ctx_r1.config == null ? null : ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].actionType) !== "checkbox" ? ctx_r1.config == null ? null : ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].action(col_r12) : null); });
|
|
156
|
+
i0.ɵɵelementStart(1, "div", 33);
|
|
157
|
+
i0.ɵɵtemplate(2, TableComponent_div_7_div_2_p_2_Template, 2, 8, "p", 34)(3, TableComponent_div_7_div_2_3_Template, 1, 2, null, 17)(4, TableComponent_div_7_div_2_mis_actions_cell_4_Template, 1, 5, "mis-actions-cell", 35);
|
|
158
|
+
i0.ɵɵelementEnd()();
|
|
159
|
+
} if (rf & 2) {
|
|
160
|
+
const i_r13 = ctx.index;
|
|
161
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
162
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(8, _c8, (ctx_r1.config == null ? null : ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].style == null ? null : ctx_r1.config.colConfig[i_r13].style.width) || (ctx_r1.config == null ? null : ctx_r1.config.colHeaderConfig[i_r13] == null ? null : ctx_r1.config.colHeaderConfig[i_r13].style == null ? null : ctx_r1.config.colHeaderConfig[i_r13].style.width) || ""))("ngClass", i0.ɵɵpureFunction1(10, _c9, ctx_r1.config.cellHover));
|
|
163
|
+
i0.ɵɵadvance();
|
|
164
|
+
i0.ɵɵstyleMap(ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].style);
|
|
165
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction2(12, _c10, (ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].action) ? "pointer" : "default", (ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].style == null ? null : ctx_r1.config.colConfig[i_r13].style.justifyContent) ? ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].style == null ? null : ctx_r1.config.colConfig[i_r13].style.justifyContent : (ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].type) === "number" ? "flex-end" : "space-between"));
|
|
166
|
+
i0.ɵɵadvance();
|
|
167
|
+
i0.ɵɵproperty("ngIf", (ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].type) !== "custom" && (ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].type) !== "actions");
|
|
168
|
+
i0.ɵɵadvance();
|
|
169
|
+
i0.ɵɵproperty("ngIf", (ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].type) === "custom");
|
|
170
|
+
i0.ɵɵadvance();
|
|
171
|
+
i0.ɵɵproperty("ngIf", (ctx_r1.config.colConfig[i_r13] == null ? null : ctx_r1.config.colConfig[i_r13].type) === "actions");
|
|
172
|
+
} }
|
|
173
|
+
function TableComponent_div_7_div_3_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
174
|
+
i0.ɵɵelementContainerStart(0);
|
|
175
|
+
i0.ɵɵelementStart(1, "div", 39);
|
|
176
|
+
i0.ɵɵtext(2, " Loading... ");
|
|
177
|
+
i0.ɵɵelementEnd();
|
|
178
|
+
i0.ɵɵelementContainerEnd();
|
|
179
|
+
} if (rf & 2) {
|
|
180
|
+
i0.ɵɵadvance();
|
|
181
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction0(1, _c14));
|
|
182
|
+
} }
|
|
183
|
+
function TableComponent_div_7_div_3_ng_container_2_Template(rf, ctx) { if (rf & 1) {
|
|
184
|
+
i0.ɵɵelementContainerStart(0);
|
|
185
|
+
i0.ɵɵelementStart(1, "div", 39);
|
|
186
|
+
i0.ɵɵtext(2, " No Data Available... ");
|
|
187
|
+
i0.ɵɵelementEnd();
|
|
188
|
+
i0.ɵɵelementContainerEnd();
|
|
189
|
+
} if (rf & 2) {
|
|
190
|
+
i0.ɵɵadvance();
|
|
191
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction0(1, _c14));
|
|
192
|
+
} }
|
|
193
|
+
function TableComponent_div_7_div_3_ng_container_3_Template(rf, ctx) { if (rf & 1) {
|
|
194
|
+
i0.ɵɵelementContainerStart(0);
|
|
195
|
+
i0.ɵɵelement(1, "sub-table", 40);
|
|
196
|
+
i0.ɵɵelementContainerEnd();
|
|
197
|
+
} if (rf & 2) {
|
|
198
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
199
|
+
i0.ɵɵadvance();
|
|
200
|
+
i0.ɵɵproperty("config", ctx_r1.subTableconfig)("tableData", ctx_r1.subTableData);
|
|
201
|
+
} }
|
|
202
|
+
function TableComponent_div_7_div_3_Template(rf, ctx) { if (rf & 1) {
|
|
203
|
+
i0.ɵɵelementStart(0, "div", 38);
|
|
204
|
+
i0.ɵɵtemplate(1, TableComponent_div_7_div_3_ng_container_1_Template, 3, 2, "ng-container", 17)(2, TableComponent_div_7_div_3_ng_container_2_Template, 3, 2, "ng-container", 17)(3, TableComponent_div_7_div_3_ng_container_3_Template, 2, 2, "ng-container", 17);
|
|
205
|
+
i0.ɵɵelementEnd();
|
|
206
|
+
} if (rf & 2) {
|
|
207
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
208
|
+
i0.ɵɵadvance();
|
|
209
|
+
i0.ɵɵproperty("ngIf", ctx_r1.subTableDataLoading);
|
|
210
|
+
i0.ɵɵadvance();
|
|
211
|
+
i0.ɵɵproperty("ngIf", !ctx_r1.subTableDataLoading && ctx_r1.subTableData.length === 0);
|
|
212
|
+
i0.ɵɵadvance();
|
|
213
|
+
i0.ɵɵproperty("ngIf", !ctx_r1.subTableDataLoading && ctx_r1.subTableData.length > 0);
|
|
214
|
+
} }
|
|
215
|
+
function TableComponent_div_7_Template(rf, ctx) { if (rf & 1) {
|
|
216
|
+
const _r8 = i0.ɵɵgetCurrentView();
|
|
217
|
+
i0.ɵɵelementStart(0, "div", 28)(1, "div", 29);
|
|
218
|
+
i0.ɵɵlistener("click", function TableComponent_div_7_Template_div_click_1_listener() { const i_r9 = i0.ɵɵrestoreView(_r8).index; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.selectRow(i_r9)); });
|
|
219
|
+
i0.ɵɵtemplate(2, TableComponent_div_7_div_2_Template, 5, 15, "div", 30);
|
|
220
|
+
i0.ɵɵelementEnd();
|
|
221
|
+
i0.ɵɵtemplate(3, TableComponent_div_7_div_3_Template, 4, 3, "div", 31);
|
|
222
|
+
i0.ɵɵelementEnd();
|
|
223
|
+
} if (rf & 2) {
|
|
224
|
+
const row_r17 = ctx.$implicit;
|
|
225
|
+
const i_r9 = ctx.index;
|
|
226
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
227
|
+
i0.ɵɵadvance();
|
|
228
|
+
i0.ɵɵclassProp("disabled-row", ctx_r1.isRowDisabled(row_r17));
|
|
229
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(6, _c6$1, ctx_r1.config.cellHover, ctx_r1.activeRowIndex.includes(i_r9)))("ngStyle", i0.ɵɵpureFunction1(9, _c7$1, (ctx_r1.config == null ? null : ctx_r1.config.rowConfig == null ? null : ctx_r1.config.rowConfig.height) ? ctx_r1.config.rowConfig.height : "44px"));
|
|
230
|
+
i0.ɵɵadvance();
|
|
231
|
+
i0.ɵɵproperty("ngForOf", row_r17);
|
|
232
|
+
i0.ɵɵadvance();
|
|
233
|
+
i0.ɵɵproperty("ngIf", (ctx_r1.config == null ? null : ctx_r1.config.canExpand) && ctx_r1.expandedIndex === i_r9);
|
|
234
|
+
} }
|
|
235
|
+
function TableComponent_div_8_ng_container_7_div_1_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
236
|
+
const _r19 = i0.ɵɵgetCurrentView();
|
|
237
|
+
i0.ɵɵelementStart(0, "span", 51);
|
|
238
|
+
i0.ɵɵlistener("click", function TableComponent_div_8_ng_container_7_div_1_span_1_Template_span_click_0_listener() { i0.ɵɵrestoreView(_r19); const pageNumber_r20 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.updateSelectedPage(pageNumber_r20)); });
|
|
239
|
+
i0.ɵɵtext(1);
|
|
240
|
+
i0.ɵɵelementEnd();
|
|
241
|
+
} if (rf & 2) {
|
|
242
|
+
const pageNumber_r20 = i0.ɵɵnextContext().$implicit;
|
|
243
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
244
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c15, pageNumber_r20 == (ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.selectedPage)));
|
|
245
|
+
i0.ɵɵadvance();
|
|
246
|
+
i0.ɵɵtextInterpolate(pageNumber_r20);
|
|
247
|
+
} }
|
|
248
|
+
function TableComponent_div_8_ng_container_7_div_1_span_2_Template(rf, ctx) { if (rf & 1) {
|
|
249
|
+
i0.ɵɵelementStart(0, "span", 52)(1, "div", 39);
|
|
250
|
+
i0.ɵɵelement(2, "span", 53)(3, "span", 53)(4, "span", 54);
|
|
251
|
+
i0.ɵɵelementEnd()();
|
|
252
|
+
} if (rf & 2) {
|
|
253
|
+
i0.ɵɵadvance();
|
|
254
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction0(3, _c16));
|
|
255
|
+
i0.ɵɵadvance();
|
|
256
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction0(4, _c17));
|
|
257
|
+
i0.ɵɵadvance();
|
|
258
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction0(5, _c17));
|
|
259
|
+
} }
|
|
260
|
+
function TableComponent_div_8_ng_container_7_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
261
|
+
i0.ɵɵelementStart(0, "div");
|
|
262
|
+
i0.ɵɵtemplate(1, TableComponent_div_8_ng_container_7_div_1_span_1_Template, 2, 4, "span", 49)(2, TableComponent_div_8_ng_container_7_div_1_span_2_Template, 5, 6, "span", 50);
|
|
263
|
+
i0.ɵɵelementEnd();
|
|
264
|
+
} if (rf & 2) {
|
|
265
|
+
const pageNumber_r20 = ctx.$implicit;
|
|
266
|
+
i0.ɵɵadvance();
|
|
267
|
+
i0.ɵɵproperty("ngIf", pageNumber_r20 != 0);
|
|
268
|
+
i0.ɵɵadvance();
|
|
269
|
+
i0.ɵɵproperty("ngIf", pageNumber_r20 == 0);
|
|
270
|
+
} }
|
|
271
|
+
function TableComponent_div_8_ng_container_7_Template(rf, ctx) { if (rf & 1) {
|
|
272
|
+
i0.ɵɵelementContainerStart(0);
|
|
273
|
+
i0.ɵɵtemplate(1, TableComponent_div_8_ng_container_7_div_1_Template, 3, 2, "div", 48);
|
|
274
|
+
i0.ɵɵelementContainerEnd();
|
|
275
|
+
} if (rf & 2) {
|
|
276
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
277
|
+
i0.ɵɵadvance();
|
|
278
|
+
i0.ɵɵproperty("ngForOf", ctx_r1.pages);
|
|
279
|
+
} }
|
|
280
|
+
function TableComponent_div_8_Template(rf, ctx) { if (rf & 1) {
|
|
281
|
+
const _r18 = i0.ɵɵgetCurrentView();
|
|
282
|
+
i0.ɵɵelementStart(0, "div", 41)(1, "p", 42);
|
|
283
|
+
i0.ɵɵtext(2);
|
|
284
|
+
i0.ɵɵelementEnd();
|
|
285
|
+
i0.ɵɵelementStart(3, "div", 43)(4, "span", 44);
|
|
286
|
+
i0.ɵɵlistener("click", function TableComponent_div_8_Template_span_click_4_listener() { i0.ɵɵrestoreView(_r18); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.selectedPage) > 1 && ctx_r1.updateSelectedPage((ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.selectedPage) - 1)); });
|
|
287
|
+
i0.ɵɵnamespaceSVG();
|
|
288
|
+
i0.ɵɵelementStart(5, "svg", 45);
|
|
289
|
+
i0.ɵɵelement(6, "path", 46);
|
|
290
|
+
i0.ɵɵelementEnd()();
|
|
291
|
+
i0.ɵɵtemplate(7, TableComponent_div_8_ng_container_7_Template, 2, 1, "ng-container", 17);
|
|
292
|
+
i0.ɵɵnamespaceHTML();
|
|
293
|
+
i0.ɵɵelementStart(8, "span", 44);
|
|
294
|
+
i0.ɵɵlistener("click", function TableComponent_div_8_Template_span_click_8_listener() { i0.ɵɵrestoreView(_r18); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.selectedPage) < (ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.noOfPages) && ctx_r1.updateSelectedPage((ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.selectedPage) + 1)); });
|
|
295
|
+
i0.ɵɵnamespaceSVG();
|
|
296
|
+
i0.ɵɵelementStart(9, "svg", 45);
|
|
297
|
+
i0.ɵɵelement(10, "path", 47);
|
|
298
|
+
i0.ɵɵelementEnd()()()();
|
|
299
|
+
} if (rf & 2) {
|
|
300
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
301
|
+
i0.ɵɵadvance(2);
|
|
302
|
+
i0.ɵɵtextInterpolate3(" Showing ", ((ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.selectedPage) - 1) * ctx_r1.config.paginationConfig.rowsPerPage + 1, "-", ((ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.selectedPage) - 1) * ctx_r1.config.paginationConfig.rowsPerPage + ctx_r1.tableLength, " of ", ctx_r1.config.paginationConfig.totalNoOfRows, " items ");
|
|
303
|
+
i0.ɵɵadvance(2);
|
|
304
|
+
i0.ɵɵclassProp("page-nav-inactive", (ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.selectedPage) === 1);
|
|
305
|
+
i0.ɵɵadvance(3);
|
|
306
|
+
i0.ɵɵproperty("ngIf", !(ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.disablePageJumping));
|
|
307
|
+
i0.ɵɵadvance();
|
|
308
|
+
i0.ɵɵclassProp("page-nav-inactive", (ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.selectedPage) === (ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.noOfPages));
|
|
309
|
+
} }
|
|
310
|
+
class TableComponent {
|
|
311
|
+
constructor(renderer) {
|
|
312
|
+
this.renderer = renderer;
|
|
313
|
+
// Initialize with -1 to indicate no row is colored at the beginning
|
|
314
|
+
this.activeRowIndex = [];
|
|
315
|
+
this.hasCheckboxActions = false;
|
|
316
|
+
this.selectAllCheckbox = false;
|
|
317
|
+
// Filter related variables
|
|
318
|
+
this.showFilter = false;
|
|
319
|
+
this.filterName = "";
|
|
320
|
+
this.filterData = [];
|
|
321
|
+
this.filterContainerStyles = {};
|
|
322
|
+
this.appliedFilters = {};
|
|
323
|
+
this.filtersUpdated = new EventEmitter();
|
|
324
|
+
// Pagination related variables
|
|
325
|
+
this.pages = [];
|
|
326
|
+
this.pageSelected = new EventEmitter();
|
|
327
|
+
this.tableData = [];
|
|
328
|
+
this.subTableData = [];
|
|
329
|
+
this.collapseColIndex = -1;
|
|
330
|
+
this.previewLines = 0;
|
|
331
|
+
this.rowCollapseConfigIndex = -1;
|
|
332
|
+
this.expandedMap = {};
|
|
333
|
+
// Sorting related properties
|
|
334
|
+
this.currentSort = null;
|
|
335
|
+
this.multiColumnSort = [];
|
|
336
|
+
this.sortChange = new EventEmitter();
|
|
337
|
+
this.headerAction = new EventEmitter();
|
|
338
|
+
}
|
|
339
|
+
// Function to handle row click
|
|
340
|
+
selectRow(index) {
|
|
341
|
+
if (this.hasCheckboxActions)
|
|
342
|
+
return;
|
|
343
|
+
this.activeRowIndex = [index]; // Set the selected index to the clicked row's index
|
|
344
|
+
!!this.config.rowConfig.action && this.config.rowConfig.action(index);
|
|
345
|
+
}
|
|
346
|
+
ngOnInit() {
|
|
347
|
+
this.hasCheckboxActions = this.config.colConfig?.some(col => col.type === "actions" && col.actionType === "checkbox");
|
|
348
|
+
this.tableLength = !!this.tableData ? this.tableData.length : 0;
|
|
349
|
+
this.initializeFilters();
|
|
350
|
+
if (this.config.paginationConfig) {
|
|
351
|
+
this.initializePagination();
|
|
352
|
+
}
|
|
353
|
+
if (this.config.canScrollHorizontally === undefined) {
|
|
354
|
+
this.config.canScrollHorizontally = false;
|
|
355
|
+
}
|
|
356
|
+
document.addEventListener("click", event => {
|
|
357
|
+
if (this.filter) {
|
|
358
|
+
let isCheckBoxClicked = true;
|
|
359
|
+
let targetElement = event.target;
|
|
360
|
+
if (targetElement.className === "checkmark") {
|
|
361
|
+
isCheckBoxClicked = true;
|
|
362
|
+
this.showFilter = true;
|
|
363
|
+
}
|
|
364
|
+
let isClickInsideElement = this.filter.container.nativeElement.contains(event.target);
|
|
365
|
+
if (!isClickInsideElement && !isCheckBoxClicked) {
|
|
366
|
+
this.toggleFilter(this.filterName);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
// fetch collapseColIndex and previewLines if present
|
|
371
|
+
this.rowCollapseConfigIndex = this.config?.colConfig?.findIndex(col => col.type === 'actions' && col.actionType === 'row-collapse');
|
|
372
|
+
if (this.rowCollapseConfigIndex !== -1) {
|
|
373
|
+
this.collapseColIndex = this.config.colConfig[this.rowCollapseConfigIndex].collapseColumnIndex ?? null;
|
|
374
|
+
this.collapseColIndex = this.config.colConfig[this.rowCollapseConfigIndex].collapseColumnIndex ?? null;
|
|
375
|
+
this.previewLines = this.config.colConfig[this.rowCollapseConfigIndex].previewLines ?? null;
|
|
376
|
+
this.buildExpandedMap();
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
buildExpandedMap() {
|
|
380
|
+
this.expandedMap = {};
|
|
381
|
+
this.tableData.forEach((row, rowIndex) => {
|
|
382
|
+
this.expandedMap[`${rowIndex}`] =
|
|
383
|
+
row[this.rowCollapseConfigIndex];
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
ngAfterViewInit() {
|
|
387
|
+
if (this.config.paginationConfig) {
|
|
388
|
+
let height = this.config.height;
|
|
389
|
+
this.renderer.setStyle(this.table.nativeElement, "height", height - 56 + "px");
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
ngOnChanges() {
|
|
393
|
+
this.tableLength = this.tableData?.length ?? 0;
|
|
394
|
+
if (this.config.activeRowIndex !== null) {
|
|
395
|
+
this.activeRowIndex = Array.isArray(this.config.activeRowIndex) ? this.config.activeRowIndex : [this.config.activeRowIndex];
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
// Filter related functions
|
|
399
|
+
initializeFilters() {
|
|
400
|
+
for (let colHeader of this.config?.colHeaderConfig) {
|
|
401
|
+
if (colHeader.filters) {
|
|
402
|
+
let filters = [];
|
|
403
|
+
for (let filter of colHeader.filters) {
|
|
404
|
+
if (filter.checked) {
|
|
405
|
+
filters.push({
|
|
406
|
+
name: filter.name,
|
|
407
|
+
value: filter.value
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
if (filters.length > 0)
|
|
412
|
+
this.appliedFilters[colHeader.data] = filters;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
toggleFilter(filterName) {
|
|
417
|
+
if (!this.showFilter) {
|
|
418
|
+
this.filterName = filterName;
|
|
419
|
+
this.showFilter = true;
|
|
420
|
+
let offSet = 0;
|
|
421
|
+
let colHeadersReversed = this.colHeaders.toArray().reverse();
|
|
422
|
+
for (let header of colHeadersReversed) {
|
|
423
|
+
if (header.nativeElement.innerText === filterName)
|
|
424
|
+
break;
|
|
425
|
+
offSet += header.nativeElement.offsetWidth;
|
|
426
|
+
}
|
|
427
|
+
this.filterContainerStyles = {
|
|
428
|
+
top: "44px",
|
|
429
|
+
right: offSet > 0 ? offSet - 116 + "px" : "12px"
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
this.filterName = "";
|
|
434
|
+
this.filterData = [];
|
|
435
|
+
this.showFilter = false;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
updateAppliedFilters(appliedFilters) {
|
|
439
|
+
if (appliedFilters.length == 0) {
|
|
440
|
+
delete this.appliedFilters[this.filterName];
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
this.appliedFilters[this.filterName] = appliedFilters;
|
|
444
|
+
}
|
|
445
|
+
this.filtersUpdated.emit({ ...this.appliedFilters });
|
|
446
|
+
this.toggleFilter(this.filterName);
|
|
447
|
+
}
|
|
448
|
+
// Pagination related functions
|
|
449
|
+
initializePagination() {
|
|
450
|
+
if (this.config.paginationConfig) {
|
|
451
|
+
let len = this.config.paginationConfig.noOfPages;
|
|
452
|
+
if (len <= 7) {
|
|
453
|
+
for (let i = 1; i <= len; i++) {
|
|
454
|
+
this.pages.push(i);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
this.pages = [1, 2, 3, 4, 0, len];
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
updateSelectedPage(pageNumber) {
|
|
463
|
+
// Guard clause to prevent out-of-range updates
|
|
464
|
+
if (pageNumber < 1 || pageNumber > this.config.paginationConfig.noOfPages)
|
|
465
|
+
return;
|
|
466
|
+
if (this.config.colHeaderConfig?.some(col => col.type === "checkbox")) {
|
|
467
|
+
this.selectAllCheckbox = false;
|
|
468
|
+
}
|
|
469
|
+
if (pageNumber < 1 || pageNumber > this.config.paginationConfig.noOfPages)
|
|
470
|
+
return;
|
|
471
|
+
this.config.paginationConfig.selectedPage = pageNumber;
|
|
472
|
+
let len = this.config.paginationConfig.noOfPages;
|
|
473
|
+
if (len > 7) {
|
|
474
|
+
if (pageNumber - 2 <= 1) {
|
|
475
|
+
this.pages = [1, 2, 3, 4, 0, len];
|
|
476
|
+
}
|
|
477
|
+
else if (pageNumber - 2 > 1 && pageNumber + 2 < len) {
|
|
478
|
+
this.pages = [1, 0, pageNumber - 1, pageNumber, pageNumber + 1, 0, len];
|
|
479
|
+
}
|
|
480
|
+
else if (pageNumber + 2 >= len) {
|
|
481
|
+
this.pages = [1, 0, len - 3, len - 2, len - 1, len];
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
this.pageSelected.emit(this.config.paginationConfig?.selectedPage);
|
|
485
|
+
}
|
|
486
|
+
// Main container related functions
|
|
487
|
+
getContainerHeight() {
|
|
488
|
+
if (this.config?.height)
|
|
489
|
+
return this.config.height;
|
|
490
|
+
else
|
|
491
|
+
return "";
|
|
492
|
+
}
|
|
493
|
+
getContainerWidth() {
|
|
494
|
+
if (this.config?.width)
|
|
495
|
+
return this.config.width;
|
|
496
|
+
else
|
|
497
|
+
return "";
|
|
498
|
+
}
|
|
499
|
+
// Column Headers related functions
|
|
500
|
+
getColHeadersRowStyles() {
|
|
501
|
+
const { colHeadersRowConfig } = this.config;
|
|
502
|
+
const minHeight = colHeadersRowConfig?.height || "44px";
|
|
503
|
+
const borderTop = colHeadersRowConfig?.style?.borderTop || "";
|
|
504
|
+
const borderBottom = colHeadersRowConfig?.style?.borderBottom || "1px solid #E0E0E0";
|
|
505
|
+
const backgroundColor = colHeadersRowConfig?.style?.backgroundColor || "#FFFFFF";
|
|
506
|
+
const fontSize = colHeadersRowConfig?.style?.fontSize || "14px";
|
|
507
|
+
return {
|
|
508
|
+
"min-height": minHeight,
|
|
509
|
+
"border-top": borderTop,
|
|
510
|
+
"border-bottom": borderBottom,
|
|
511
|
+
"background-color": backgroundColor,
|
|
512
|
+
"font-size": fontSize
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
onSortChange(sortState) {
|
|
516
|
+
this.currentSort = sortState;
|
|
517
|
+
if (this.config.multiColumnSort) {
|
|
518
|
+
const index = this.multiColumnSort.findIndex(sort => sort.column === sortState.column);
|
|
519
|
+
if (index !== -1) {
|
|
520
|
+
if (sortState.direction === null) {
|
|
521
|
+
this.multiColumnSort.splice(index, 1);
|
|
522
|
+
}
|
|
523
|
+
else {
|
|
524
|
+
this.multiColumnSort[index] = sortState;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
else if (sortState.direction !== null) {
|
|
528
|
+
this.multiColumnSort.push(sortState);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
this.sortChange.emit(sortState);
|
|
532
|
+
}
|
|
533
|
+
getActionsCellStyle(style) {
|
|
534
|
+
if (!style)
|
|
535
|
+
return {};
|
|
536
|
+
const { width, ...restStyle } = style;
|
|
537
|
+
return restStyle;
|
|
538
|
+
}
|
|
539
|
+
onActionClick(event, rowIndex) {
|
|
540
|
+
if (event.actionType === 'checkbox') {
|
|
541
|
+
if (event.value) {
|
|
542
|
+
this.activeRowIndex.push(rowIndex);
|
|
543
|
+
}
|
|
544
|
+
else {
|
|
545
|
+
this.activeRowIndex = this.activeRowIndex.filter(index => index !== rowIndex);
|
|
546
|
+
}
|
|
547
|
+
const actionInfo = this.findActionConfig('checkbox');
|
|
548
|
+
if (actionInfo && this.tableData[rowIndex]) {
|
|
549
|
+
const { index, config } = actionInfo;
|
|
550
|
+
this.tableData[rowIndex][index] = event.value;
|
|
551
|
+
const checkedItems = this.tableData.filter(row => row[index] === true);
|
|
552
|
+
config.action?.(checkedItems);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
else if (event.actionType === 'row-collapse') {
|
|
556
|
+
const rowCollapse = this.findActionConfig('row-collapse');
|
|
557
|
+
if (rowCollapse && this.tableData[rowIndex]) {
|
|
558
|
+
this.tableData[rowIndex][rowCollapse.index] = event.value;
|
|
559
|
+
rowCollapse.config.action?.(this.tableData);
|
|
560
|
+
this.buildExpandedMap();
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
findActionConfig(actionType) {
|
|
565
|
+
for (let i = 0; i < this.config.colConfig.length; i++) {
|
|
566
|
+
const col = this.config.colConfig[i];
|
|
567
|
+
if (col.type === 'actions' && col.actionType === actionType) {
|
|
568
|
+
return { index: i, config: col };
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
return null;
|
|
572
|
+
}
|
|
573
|
+
isRowDisabled(row) {
|
|
574
|
+
return typeof this.config.rowConfig.disableRow === "function" ? this.config.rowConfig.disableRow(row) : false;
|
|
575
|
+
}
|
|
576
|
+
toggleCheckbox() {
|
|
577
|
+
this.selectAllCheckbox = !this.selectAllCheckbox;
|
|
578
|
+
const checkboxColIndex = this.config.colConfig.findIndex(col => col.type === 'actions' && col.actionType === 'checkbox');
|
|
579
|
+
if (checkboxColIndex !== -1) {
|
|
580
|
+
this.tableData = this.tableData.map((row) => {
|
|
581
|
+
const updatedRow = [...row];
|
|
582
|
+
const currentCheckbox = updatedRow[checkboxColIndex];
|
|
583
|
+
const isDisabled = this.isRowDisabled(row);
|
|
584
|
+
if (!isDisabled) {
|
|
585
|
+
updatedRow[checkboxColIndex] = {
|
|
586
|
+
...currentCheckbox,
|
|
587
|
+
value: this.selectAllCheckbox
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
return updatedRow;
|
|
591
|
+
});
|
|
592
|
+
this.headerAction?.emit({
|
|
593
|
+
type: "checkboxToggle",
|
|
594
|
+
payload: this.tableData
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
static { this.ɵfac = function TableComponent_Factory(t) { return new (t || TableComponent)(i0.ɵɵdirectiveInject(i0.Renderer2)); }; }
|
|
599
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TableComponent, selectors: [["mis-table"]], viewQuery: function TableComponent_Query(rf, ctx) { if (rf & 1) {
|
|
600
|
+
i0.ɵɵviewQuery(_c0$3, 5);
|
|
601
|
+
i0.ɵɵviewQuery(_c1$3, 5);
|
|
602
|
+
i0.ɵɵviewQuery(_c2$3, 5);
|
|
603
|
+
} if (rf & 2) {
|
|
604
|
+
let _t;
|
|
605
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.filter = _t.first);
|
|
606
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.table = _t.first);
|
|
607
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.colHeaders = _t);
|
|
608
|
+
} }, inputs: { config: [i0.ɵɵInputFlags.None, "tableConfig", "config"], subTableconfig: "subTableconfig", tableDataLoading: "tableDataLoading", expandedIndex: "expandedIndex", tableData: "tableData", subTableData: "subTableData", subTableDataLoading: "subTableDataLoading" }, outputs: { filtersUpdated: "filtersUpdated", pageSelected: "pageSelected", sortChange: "sortChange", headerAction: "headerAction" }, features: [i0.ɵɵNgOnChangesFeature], decls: 9, vars: 15, consts: [["table", ""], ["filter", ""], ["colHeaderRef", ""], ["id", "main-container", 3, "ngStyle"], [3, "containerStyles", "filtersData", "filtersApplied", 4, "ngIf"], ["id", "table-container", 3, "ngClass"], ["id", "col-headers-container", 3, "ngStyle"], ["class", "col-header", 3, "ngStyle", "click", 4, "ngFor", "ngForOf"], ["id", "data-container"], ["class", "row-wrapper", 4, "ngFor", "ngForOf"], ["id", "pagination-container", 4, "ngIf"], [3, "filtersApplied", "containerStyles", "filtersData"], [1, "col-header", 3, "click", "ngStyle"], ["class", "col-header-text", 4, "ngIf"], ["class", "filter-icon", 3, "click", 4, "ngIf"], ["class", "checkbox-icon", 3, "click", 4, "ngIf"], ["appSortIcons", "", "class", "sort-icon", 3, "column", "activeSort", "activeSorts", "multiColumnSort", "sortChange", 4, "ngIf"], [4, "ngIf"], [1, "col-header-text"], [1, "filter-icon", 3, "click"], ["id", "filter-active", 4, "ngIf"], ["fill", "none", "height", "10", "viewBox", "0 0 13 10", "width", "13", "xmlns", "http://www.w3.org/2000/svg"], ["clip-rule", "evenodd", "d", "M4.97546 10H7.64213V8H4.97546V10ZM0.308472 0V2H12.3085V0H0.308472ZM2.30847 6H10.3085V4H2.30847V6Z", "fill", "#181F33", "fill-rule", "evenodd"], ["id", "filter-active"], [1, "checkbox-icon", 3, "click"], [3, "checked"], ["appSortIcons", "", 1, "sort-icon", 3, "sortChange", "column", "activeSort", "activeSorts", "multiColumnSort"], ["customTableCell", "", 3, "customComponent", "data"], [1, "row-wrapper"], [1, "t-row", 3, "click", "ngClass", "ngStyle"], ["class", "t-col-container", 3, "ngStyle", "ngClass", "click", 4, "ngFor", "ngForOf"], ["class", "sub-row", 4, "ngIf"], [1, "t-col-container", 3, "click", "ngStyle", "ngClass"], [1, "t-col", 3, "ngStyle"], ["class", "t-col-text", 3, "ngStyle", "ngClass", 4, "ngIf"], [3, "cellData", "config", "ngClass", "actionClick", 4, "ngIf"], [1, "t-col-text", 3, "ngStyle", "ngClass"], [3, "actionClick", "cellData", "config", "ngClass"], [1, "sub-row"], [3, "ngStyle"], [3, "config", "tableData"], ["id", "pagination-container"], ["id", "pagination-text"], ["id", "pages-container"], [1, "page", 3, "click"], ["fill", "none", "height", "10", "viewBox", "0 0 7 10", "width", "7", "xmlns", "http://www.w3.org/2000/svg"], ["clip-rule", "evenodd", "d", "M0.857405 5.56295C0.855794 5.56139 0.854188 5.55982 0.852588 5.55824C0.695955 5.40408 0.617641 5.20203 0.617647 4.99998C0.617641 4.79793 0.695955 4.59588 0.852588 4.44172C0.854188 4.44014 0.855794 4.43858 0.857404 4.43702L5.13066 0.231231C5.44392 -0.0770771 5.9518 -0.0770771 6.26506 0.231231C6.57831 0.53954 6.57831 1.03941 6.26506 1.34772L2.5542 4.99998L6.26506 8.65225C6.57831 8.96055 6.57831 9.46042 6.26506 9.76873C5.9518 10.077 5.44392 10.077 5.13066 9.76873L0.857405 5.56295Z", "fill", "#181F33", "fill-rule", "evenodd"], ["clip-rule", "evenodd", "d", "M6.1426 5.56295C6.14421 5.56139 6.14581 5.55982 6.14741 5.55824C6.30405 5.40408 6.38236 5.20203 6.38236 4.99998C6.38236 4.79793 6.30405 4.59588 6.14741 4.44172C6.14581 4.44014 6.14421 4.43858 6.1426 4.43702L1.86934 0.231231C1.55608 -0.0770771 1.0482 -0.0770771 0.734942 0.231231C0.421688 0.53954 0.421688 1.03941 0.734942 1.34772L4.4458 4.99998L0.734941 8.65225C0.421686 8.96055 0.421686 9.46042 0.734941 9.76873C1.0482 10.077 1.55608 10.077 1.86934 9.76873L6.1426 5.56295Z", "fill", "#181F33", "fill-rule", "evenodd"], [4, "ngFor", "ngForOf"], ["class", "page page-jumping-enabled", 3, "ngClass", "click", 4, "ngIf"], ["class", "page-seperator", 4, "ngIf"], [1, "page", "page-jumping-enabled", 3, "click", "ngClass"], [1, "page-seperator"], [1, "dot", 3, "ngStyle"], [1, "dot"]], template: function TableComponent_Template(rf, ctx) { if (rf & 1) {
|
|
609
|
+
i0.ɵɵelementStart(0, "div", 3);
|
|
610
|
+
i0.ɵɵtemplate(1, TableComponent_mis_table_filter_1_Template, 2, 2, "mis-table-filter", 4);
|
|
611
|
+
i0.ɵɵelementStart(2, "div", 5, 0)(4, "div", 6);
|
|
612
|
+
i0.ɵɵtemplate(5, TableComponent_div_5_Template, 7, 10, "div", 7);
|
|
613
|
+
i0.ɵɵelementEnd();
|
|
614
|
+
i0.ɵɵelementStart(6, "div", 8);
|
|
615
|
+
i0.ɵɵtemplate(7, TableComponent_div_7_Template, 4, 11, "div", 9);
|
|
616
|
+
i0.ɵɵelementEnd()();
|
|
617
|
+
i0.ɵɵtemplate(8, TableComponent_div_8_Template, 11, 8, "div", 10);
|
|
618
|
+
i0.ɵɵelementEnd();
|
|
619
|
+
} if (rf & 2) {
|
|
620
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction3(7, _c3$1, ctx.getContainerHeight(), ctx.getContainerWidth(), ctx.config.canScrollHorizontally ? "auto" : "unset"));
|
|
621
|
+
i0.ɵɵadvance();
|
|
622
|
+
i0.ɵɵproperty("ngIf", ctx.showFilter);
|
|
623
|
+
i0.ɵɵadvance();
|
|
624
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction3(11, _c4$1, ctx.expandedIndex < 0, !(ctx.expandedIndex < 0), ctx.config.canScrollHorizontally));
|
|
625
|
+
i0.ɵɵadvance(2);
|
|
626
|
+
i0.ɵɵproperty("ngStyle", ctx.getColHeadersRowStyles());
|
|
627
|
+
i0.ɵɵadvance();
|
|
628
|
+
i0.ɵɵproperty("ngForOf", ctx.config == null ? null : ctx.config.colHeaderConfig);
|
|
629
|
+
i0.ɵɵadvance(2);
|
|
630
|
+
i0.ɵɵproperty("ngForOf", ctx.tableData);
|
|
631
|
+
i0.ɵɵadvance();
|
|
632
|
+
i0.ɵɵproperty("ngIf", (ctx.config == null ? null : ctx.config.paginationConfig) && (ctx.tableLength >= ctx.config.paginationConfig.rowsPerPage || (ctx.config.paginationConfig == null ? null : ctx.config.paginationConfig.selectedPage) !== 1));
|
|
633
|
+
} }, styles: ["#main-container[_ngcontent-%COMP%]{font-family:Lato,sans-serif;position:relative}.no-scrollbar[_ngcontent-%COMP%]::-webkit-scrollbar{width:0}.scrollbar[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px;height:8px;border-radius:15px}.scrollbar[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9aa7b4;border-radius:15px}#table-container[_ngcontent-%COMP%]{height:inherit;overflow-y:auto}.scroll-horizontally[_ngcontent-%COMP%]{height:inherit;width:fit-content;overflow-y:unset!important;overflow-x:visible}#col-headers-container[_ngcontent-%COMP%]{display:flex;align-items:center;position:sticky;background-color:#fff;width:100%;z-index:1;min-height:44px;border-bottom:1px solid #e0e0e0;top:0;left:0;right:0}.col-header[_ngcontent-%COMP%]{padding:0 16px;display:flex;align-items:center;height:100%}.col-header-text[_ngcontent-%COMP%]{font-style:normal;font-weight:700;line-height:20px;display:flex;align-items:center;letter-spacing:.2px;margin:0}.sort-icon[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.filter-icon[_ngcontent-%COMP%]{margin-left:8px;padding:0 8px;position:relative;cursor:pointer}#filter-active[_ngcontent-%COMP%]{height:8px;width:8px;background:#16cbbc;border-radius:50%;position:absolute;top:4px;right:4px}.sub-row[_ngcontent-%COMP%]{height:auto;border-bottom:none}.loader[_ngcontent-%COMP%] .mat-progress-spinner circle, .mat-spinner[_ngcontent-%COMP%] circle[_ngcontent-%COMP%]{stroke:#0937b2}.t-row[_ngcontent-%COMP%]{display:flex;min-height:44px;background-color:#fff;width:100%;border-bottom:1px solid #e0e0e0}.t-row[_ngcontent-%COMP%]:hover{background-color:#e7eefd}.active-row[_ngcontent-%COMP%]{background-color:#e6f6fd}.t-col-container[_ngcontent-%COMP%]{padding:0 16px;min-width:0}.t-row-hover[_ngcontent-%COMP%]:hover{background-color:#0000}.t-col-container-hover[_ngcontent-%COMP%]:hover{background-color:#e6ebf7}.t-col-container-hover[_ngcontent-%COMP%]:first-child{border-left:1px solid #e0e0e0}.t-col-container-hover[_ngcontent-%COMP%]{border-right:1px solid #e0e0e0}.t-col[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%}.t-col-text[_ngcontent-%COMP%]{font-style:normal;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;letter-spacing:.2px;margin:0}#pagination-container[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;height:56px}#pagination-text[_ngcontent-%COMP%]{font-style:normal;font-weight:400;font-size:12px;line-height:18px;letter-spacing:.4px;color:#6a737d;margin:0 56px 0 0}#pages-container[_ngcontent-%COMP%]{display:flex;margin-right:32px}.page[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;border-radius:4px;width:32px;height:32px;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d;margin-right:8px;cursor:pointer}.page.page-jumping-enabled[_ngcontent-%COMP%]{border:1px solid #6a737d}.page-seperator[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;width:32px;height:32px;margin-right:8px}.dot[_ngcontent-%COMP%]{height:3px;width:3px;border-radius:50%;background:#6a737d}.page-active[_ngcontent-%COMP%]{color:#0937b2;border:1px solid #0937b2}.sort-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;margin-left:4px;cursor:pointer}.sort-icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:16px;height:16px;transition:opacity .2s ease}.sort-icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover{opacity:.8}.disabled-row[_ngcontent-%COMP%] .t-col-container[_ngcontent-%COMP%]{opacity:.4;pointer-events:none}.disabled-row[_ngcontent-%COMP%] .t-col-container[_ngcontent-%COMP%]:has(mis-actions-cell){opacity:1;pointer-events:auto}.row[_ngcontent-%COMP%]{transition:background-color .2s}.row[_ngcontent-%COMP%]:hover:not(.disabled-row), .row.selected[_ngcontent-%COMP%]:not(.disabled-row){background-color:#e6f5fd}.disabled-row[_ngcontent-%COMP%] .t-col-container[_ngcontent-%COMP%]{pointer-events:none;opacity:.4}.disabled-row[_ngcontent-%COMP%] .t-col-container[_ngcontent-%COMP%]:has(mis-actions-cell){pointer-events:auto!important;opacity:1!important;color:inherit!important}mis-actions-cell.disable-actions[_ngcontent-%COMP%]{pointer-events:none;opacity:.4;filter:grayscale(.5)}.page-nav-inactive[_ngcontent-%COMP%]{pointer-events:none;opacity:.5;cursor:default}.collapsed-cell[_ngcontent-%COMP%]{overflow:hidden!important;white-space:nowrap!important;text-overflow:ellipsis!important;display:block;@supports (-webkit-line-clamp: 2){display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:var(--collapsed-lines, 2);white-space:normal!important}}"] }); }
|
|
634
|
+
}
|
|
635
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableComponent, [{
|
|
636
|
+
type: Component,
|
|
637
|
+
args: [{ selector: "mis-table", template: "<div\n [ngStyle]=\"{\n height: getContainerHeight(),\n width: getContainerWidth(),\n 'overflow-x': config.canScrollHorizontally ? 'auto' : 'unset'\n }\"\n id=\"main-container\"\n>\n <mis-table-filter\n #filter\n (filtersApplied)=\"updateAppliedFilters($event)\"\n *ngIf=\"showFilter\"\n [containerStyles]=\"filterContainerStyles\"\n [filtersData]=\"filterData\"\n ></mis-table-filter>\n <div\n #table\n id=\"table-container\"\n [ngClass]=\"{ 'no-scrollbar': expandedIndex < 0, scrollbar: !(expandedIndex < 0), 'scroll-horizontally': config.canScrollHorizontally }\"\n >\n <div\n [ngStyle]=\"getColHeadersRowStyles()\"\n id=\"col-headers-container\"\n >\n <div\n #colHeaderRef\n (click)=\"colHeader?.action ? colHeader?.action(colHeader) : null\"\n *ngFor=\"let colHeader of config?.colHeaderConfig\"\n class=\"col-header\"\n [ngStyle]=\"{\n width: colHeader?.style?.width || '',\n cursor: colHeader.action ? 'pointer' : 'default',\n 'justify-content': colHeader?.style?.justifyContent\n ? colHeader?.style?.justifyContent\n : colHeader.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p *ngIf=\"colHeader?.type !== 'custom' && colHeader?.type !== 'checkbox'\" class=\"col-header-text\">\n {{ colHeader?.data || \" \" }}\n </p>\n <span\n (click)=\"filterData = colHeader.filters; toggleFilter(colHeader.data); $event.stopPropagation()\"\n *ngIf=\"colHeader?.type !== 'custom' && colHeader?.filters && colHeader?.filters?.length > 0\"\n class=\"filter-icon\"\n >\n <span *ngIf=\"appliedFilters[colHeader.data]?.length > 0\" id=\"filter-active\"></span>\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 13 10\" width=\"13\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M4.97546 10H7.64213V8H4.97546V10ZM0.308472 0V2H12.3085V0H0.308472ZM2.30847 6H10.3085V4H2.30847V6Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n <span\n (click)=\"toggleCheckbox(); $event.stopPropagation()\"\n *ngIf=\"colHeader?.type === 'checkbox'\"\n class=\"checkbox-icon\"\n >\n <mis-checkbox [checked]=\"selectAllCheckbox\"></mis-checkbox>\n </span>\n <span *ngIf=\"colHeader?.isSortable && !colHeader?.filters\" appSortIcons\n [column]=\"colHeader\"\n [activeSort]=\"currentSort\"\n [activeSorts]=\"multiColumnSort\"\n [multiColumnSort]=\"config.multiColumnSort\"\n (sortChange)=\"onSortChange($event)\"\n class=\"sort-icon\">\n </span>\n <ng-template *ngIf=\"colHeader?.type === 'custom'\" customTableCell [customComponent]=\"colHeader?.componentRef\" [data]=\"colHeader.data\"></ng-template>\n </div>\n </div>\n <div id=\"data-container\">\n <div class=\"row-wrapper\" *ngFor=\"let row of tableData; let i = index; let rowIndex = index\">\n <div\n class=\"t-row\"\n [ngClass]=\"{ 't-row-hover': config.cellHover, 'active-row': activeRowIndex.includes(i) }\"\n [ngStyle]=\"{ 'min-height': config?.rowConfig?.height ? config.rowConfig.height : '44px' }\"\n (click)=\"selectRow(i)\"\n [class.disabled-row]=\"isRowDisabled(row)\"\n >\n <div\n (click)=\"config?.colConfig[i]?.action && config?.colConfig[i]?.actionType !== 'checkbox' ? config?.colConfig[i]?.action(col) : null\"\n *ngFor=\"let col of row; let i = index\"\n [ngStyle]=\"{\n width: config?.colConfig[i]?.style?.width || config?.colHeaderConfig[i]?.style?.width || ''\n }\"\n class=\"t-col-container\"\n [ngClass]=\"{ 't-col-container-hover': config.cellHover }\"\n >\n <div\n class=\"t-col\"\n [style]=\"config.colConfig[i]?.style\"\n [ngStyle]=\"{\n width: '100%',\n cursor: config.colConfig[i]?.action ? 'pointer' : 'default',\n 'justify-content': config.colConfig[i]?.style?.justifyContent\n ? config.colConfig[i]?.style?.justifyContent\n : config.colConfig[i]?.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p\n *ngIf=\"config.colConfig[i]?.type !== 'custom' && config.colConfig[i]?.type !== 'actions'\"\n [ngStyle]=\"{\n color: config?.colConfig[i]?.style?.color || '',\n '--collapsed-lines': previewLines || 3\n }\"\n [ngClass]=\"{\n 'collapsed-cell': collapseColIndex == i && expandedMap[rowIndex]\n }\" \n class=\"t-col-text\"\n >\n {{col}}\n </p>\n \n <ng-template\n *ngIf=\"config.colConfig[i]?.type === 'custom'\"\n [customComponent]=\"config.colConfig[i].componentRef\"\n [data]=\"col\"\n customTableCell\n ></ng-template>\n <mis-actions-cell\n *ngIf=\"config.colConfig[i]?.type === 'actions'\"\n [cellData]=\"col\"\n [config]=\"config.colConfig[i]\"\n (actionClick)=\"onActionClick($event, rowIndex)\"\n [ngClass]=\"{\n 'disable-actions': (config.colConfig[i]?.actionType === 'checkbox' || config.colConfig[i]?.actionType === 'row-collapse') && isRowDisabled(row)\n }\"\n ></mis-actions-cell>\n\n </div>\n </div>\n </div>\n <div *ngIf=\"config?.canExpand && expandedIndex === i\" class=\"sub-row\">\n <ng-container *ngIf=\"subTableDataLoading\">\n <div [ngStyle]=\"{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n padding: '16px'\n }\">\n Loading...\n </div>\n </ng-container>\n \n <ng-container *ngIf=\"!subTableDataLoading && subTableData.length === 0\">\n <div [ngStyle]=\"{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n padding: '16px'\n }\">\n No Data Available...\n </div>\n </ng-container>\n \n <ng-container *ngIf=\"!subTableDataLoading && subTableData.length > 0\">\n <sub-table [config]=\"subTableconfig\" [tableData]=\"subTableData\"></sub-table>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"config?.paginationConfig && (tableLength >= config.paginationConfig.rowsPerPage || config.paginationConfig?.selectedPage !== 1)\"\n id=\"pagination-container\"\n >\n <p id=\"pagination-text\">\n Showing\n {{ (config.paginationConfig?.selectedPage - 1) * config.paginationConfig.rowsPerPage + 1 }}-{{\n (config.paginationConfig?.selectedPage - 1) * config.paginationConfig.rowsPerPage + tableLength\n }}\n of {{ config.paginationConfig.totalNoOfRows }} items\n </p>\n <div id=\"pages-container\">\n <span (click)=\"config.paginationConfig?.selectedPage > 1 && updateSelectedPage(config.paginationConfig?.selectedPage - 1)\" class=\"page\" [class.page-nav-inactive]=\"config.paginationConfig?.selectedPage === 1\">\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 7 10\" width=\"7\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M0.857405 5.56295C0.855794 5.56139 0.854188 5.55982 0.852588 5.55824C0.695955 5.40408 0.617641 5.20203 0.617647 4.99998C0.617641 4.79793 0.695955 4.59588 0.852588 4.44172C0.854188 4.44014 0.855794 4.43858 0.857404 4.43702L5.13066 0.231231C5.44392 -0.0770771 5.9518 -0.0770771 6.26506 0.231231C6.57831 0.53954 6.57831 1.03941 6.26506 1.34772L2.5542 4.99998L6.26506 8.65225C6.57831 8.96055 6.57831 9.46042 6.26506 9.76873C5.9518 10.077 5.44392 10.077 5.13066 9.76873L0.857405 5.56295Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n <!-- Page numbers (only show if disablePageJumping is false) -->\n <ng-container *ngIf=\"!config.paginationConfig?.disablePageJumping\">\n <div *ngFor=\"let pageNumber of pages\">\n <span\n (click)=\"updateSelectedPage(pageNumber)\"\n *ngIf=\"pageNumber != 0\"\n [ngClass]=\"{ 'page-active': pageNumber == config.paginationConfig?.selectedPage }\"\n class=\"page page-jumping-enabled\"\n >{{ pageNumber }}</span>\n <span *ngIf=\"pageNumber == 0\" class=\"page-seperator\">\n <div [ngStyle]=\"{ display: 'flex' }\">\n <span class=\"dot\" [ngStyle]=\"{ 'margin-right': '4px' }\"></span>\n <span class=\"dot\" [ngStyle]=\"{ 'margin-right': '4px' }\"></span>\n <span class=\"dot\"></span>\n </div> \n </span>\n </div>\n </ng-container>\n \n <span [class.page-nav-inactive]=\"config.paginationConfig?.selectedPage === config.paginationConfig?.noOfPages\"\n (click)=\"config.paginationConfig?.selectedPage < config.paginationConfig?.noOfPages && updateSelectedPage(config.paginationConfig?.selectedPage + 1)\" class=\"page\">\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 7 10\" width=\"7\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M6.1426 5.56295C6.14421 5.56139 6.14581 5.55982 6.14741 5.55824C6.30405 5.40408 6.38236 5.20203 6.38236 4.99998C6.38236 4.79793 6.30405 4.59588 6.14741 4.44172C6.14581 4.44014 6.14421 4.43858 6.1426 4.43702L1.86934 0.231231C1.55608 -0.0770771 1.0482 -0.0770771 0.734942 0.231231C0.421688 0.53954 0.421688 1.03941 0.734942 1.34772L4.4458 4.99998L0.734941 8.65225C0.421686 8.96055 0.421686 9.46042 0.734941 9.76873C1.0482 10.077 1.55608 10.077 1.86934 9.76873L6.1426 5.56295Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n </div>\n </div>\n</div>\n", styles: ["#main-container{font-family:Lato,sans-serif;position:relative}.no-scrollbar::-webkit-scrollbar{width:0}.scrollbar::-webkit-scrollbar{width:8px;height:8px;border-radius:15px}.scrollbar::-webkit-scrollbar-thumb{background:#9aa7b4;border-radius:15px}#table-container{height:inherit;overflow-y:auto}.scroll-horizontally{height:inherit;width:fit-content;overflow-y:unset!important;overflow-x:visible}#col-headers-container{display:flex;align-items:center;position:sticky;background-color:#fff;width:100%;z-index:1;min-height:44px;border-bottom:1px solid #e0e0e0;top:0;left:0;right:0}.col-header{padding:0 16px;display:flex;align-items:center;height:100%}.col-header-text{font-style:normal;font-weight:700;line-height:20px;display:flex;align-items:center;letter-spacing:.2px;margin:0}.sort-icon{display:flex;justify-content:center;align-items:center}.filter-icon{margin-left:8px;padding:0 8px;position:relative;cursor:pointer}#filter-active{height:8px;width:8px;background:#16cbbc;border-radius:50%;position:absolute;top:4px;right:4px}.sub-row{height:auto;border-bottom:none}.loader ::ng-deep .mat-progress-spinner circle,.mat-spinner circle{stroke:#0937b2}.t-row{display:flex;min-height:44px;background-color:#fff;width:100%;border-bottom:1px solid #e0e0e0}.t-row:hover{background-color:#e7eefd}.active-row{background-color:#e6f6fd}.t-col-container{padding:0 16px;min-width:0}.t-row-hover:hover{background-color:#0000}.t-col-container-hover:hover{background-color:#e6ebf7}.t-col-container-hover:first-child{border-left:1px solid #e0e0e0}.t-col-container-hover{border-right:1px solid #e0e0e0}.t-col{display:flex;align-items:center;height:100%}.t-col-text{font-style:normal;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;letter-spacing:.2px;margin:0}#pagination-container{display:flex;justify-content:flex-end;align-items:center;height:56px}#pagination-text{font-style:normal;font-weight:400;font-size:12px;line-height:18px;letter-spacing:.4px;color:#6a737d;margin:0 56px 0 0}#pages-container{display:flex;margin-right:32px}.page{display:flex;justify-content:center;align-items:center;box-sizing:border-box;border-radius:4px;width:32px;height:32px;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d;margin-right:8px;cursor:pointer}.page.page-jumping-enabled{border:1px solid #6a737d}.page-seperator{display:flex;justify-content:center;align-items:center;width:32px;height:32px;margin-right:8px}.dot{height:3px;width:3px;border-radius:50%;background:#6a737d}.page-active{color:#0937b2;border:1px solid #0937b2}.sort-icon{display:inline-flex;align-items:center;margin-left:4px;cursor:pointer}.sort-icon img{width:16px;height:16px;transition:opacity .2s ease}.sort-icon img:hover{opacity:.8}.disabled-row .t-col-container{opacity:.4;pointer-events:none}.disabled-row .t-col-container:has(mis-actions-cell){opacity:1;pointer-events:auto}.row{transition:background-color .2s}.row:hover:not(.disabled-row),.row.selected:not(.disabled-row){background-color:#e6f5fd}.disabled-row .t-col-container{pointer-events:none;opacity:.4}.disabled-row .t-col-container:has(mis-actions-cell){pointer-events:auto!important;opacity:1!important;color:inherit!important}mis-actions-cell.disable-actions{pointer-events:none;opacity:.4;filter:grayscale(.5)}.page-nav-inactive{pointer-events:none;opacity:.5;cursor:default}.collapsed-cell{overflow:hidden!important;white-space:nowrap!important;text-overflow:ellipsis!important;display:block;@supports (-webkit-line-clamp: 2){display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:var(--collapsed-lines, 2);white-space:normal!important}}\n"] }]
|
|
638
|
+
}], () => [{ type: i0.Renderer2 }], { filtersUpdated: [{
|
|
639
|
+
type: Output
|
|
640
|
+
}], filter: [{
|
|
641
|
+
type: ViewChild,
|
|
642
|
+
args: ["filter"]
|
|
643
|
+
}], colHeaders: [{
|
|
644
|
+
type: ViewChildren,
|
|
645
|
+
args: ["colHeaderRef"]
|
|
646
|
+
}], pageSelected: [{
|
|
647
|
+
type: Output
|
|
648
|
+
}], config: [{
|
|
649
|
+
type: Input,
|
|
650
|
+
args: ["tableConfig"]
|
|
651
|
+
}], subTableconfig: [{
|
|
652
|
+
type: Input
|
|
653
|
+
}], tableDataLoading: [{
|
|
654
|
+
type: Input
|
|
655
|
+
}], expandedIndex: [{
|
|
656
|
+
type: Input
|
|
657
|
+
}], tableData: [{
|
|
658
|
+
type: Input
|
|
659
|
+
}], subTableData: [{
|
|
660
|
+
type: Input
|
|
661
|
+
}], subTableDataLoading: [{
|
|
662
|
+
type: Input
|
|
663
|
+
}], table: [{
|
|
664
|
+
type: ViewChild,
|
|
665
|
+
args: ["table"]
|
|
666
|
+
}], sortChange: [{
|
|
667
|
+
type: Output
|
|
668
|
+
}], headerAction: [{
|
|
669
|
+
type: Output
|
|
670
|
+
}] }); })();
|
|
671
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TableComponent, { className: "TableComponent" }); })();
|
|
9
672
|
|
|
10
673
|
class CustomTableCellDirective {
|
|
11
674
|
set customComponent(value) {
|
|
@@ -50,11 +713,11 @@ class CustomTableCellDirective {
|
|
|
50
713
|
const _c0$2 = ["table"];
|
|
51
714
|
const _c1$2 = (a0, a1) => ({ height: a0, width: a1 });
|
|
52
715
|
const _c2$2 = (a0, a1, a2) => ({ height: a0, "border-top": a1, "border-bottom": a2 });
|
|
53
|
-
const _c3
|
|
54
|
-
const _c4
|
|
55
|
-
const _c5
|
|
56
|
-
const _c6
|
|
57
|
-
const _c7
|
|
716
|
+
const _c3 = (a0, a1, a2) => ({ width: a0, cursor: a1, "justify-content": a2 });
|
|
717
|
+
const _c4 = a0 => ({ backgroundColor: a0 });
|
|
718
|
+
const _c5 = a0 => ({ width: a0 });
|
|
719
|
+
const _c6 = (a0, a1) => ({ width: "100%", cursor: a0, "justify-content": a1 });
|
|
720
|
+
const _c7 = a0 => ({ color: a0 });
|
|
58
721
|
function SubTableComponent_div_3_div_1_p_1_Template(rf, ctx) { if (rf & 1) {
|
|
59
722
|
i0.ɵɵelementStart(0, "p", 11);
|
|
60
723
|
i0.ɵɵtext(1);
|
|
@@ -80,7 +743,7 @@ function SubTableComponent_div_3_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
80
743
|
} if (rf & 2) {
|
|
81
744
|
const colHeader_r2 = ctx.$implicit;
|
|
82
745
|
i0.ɵɵstyleMap(colHeader_r2 == null ? null : colHeader_r2.style);
|
|
83
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction3(5, _c3
|
|
746
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction3(5, _c3, (colHeader_r2 == null ? null : colHeader_r2.style == null ? null : colHeader_r2.style.width) || "", colHeader_r2.action ? "pointer" : "default", (colHeader_r2 == null ? null : colHeader_r2.style == null ? null : colHeader_r2.style.justifyContent) ? colHeader_r2 == null ? null : colHeader_r2.style == null ? null : colHeader_r2.style.justifyContent : colHeader_r2.type === "number" ? "flex-end" : "space-between"));
|
|
84
747
|
i0.ɵɵadvance();
|
|
85
748
|
i0.ɵɵproperty("ngIf", (colHeader_r2 == null ? null : colHeader_r2.type) !== "custom");
|
|
86
749
|
i0.ɵɵadvance();
|
|
@@ -105,7 +768,7 @@ function SubTableComponent_div_6_div_2_p_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
105
768
|
const col_r6 = ctx_r7.$implicit;
|
|
106
769
|
const i_r7 = ctx_r7.index;
|
|
107
770
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
108
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(2, _c7
|
|
771
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(2, _c7, (ctx_r2.config == null ? null : ctx_r2.config.colConfig[i_r7] == null ? null : ctx_r2.config.colConfig[i_r7].style == null ? null : ctx_r2.config.colConfig[i_r7].style.color) ? ctx_r2.config == null ? null : ctx_r2.config.colConfig[i_r7] == null ? null : ctx_r2.config.colConfig[i_r7].style == null ? null : ctx_r2.config.colConfig[i_r7].style.color : ""));
|
|
109
772
|
i0.ɵɵadvance();
|
|
110
773
|
i0.ɵɵtextInterpolate1(" ", col_r6, " ");
|
|
111
774
|
} }
|
|
@@ -129,10 +792,10 @@ function SubTableComponent_div_6_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
129
792
|
} if (rf & 2) {
|
|
130
793
|
const i_r7 = ctx.index;
|
|
131
794
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
132
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(6, _c5
|
|
795
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(6, _c5, (ctx_r2.config == null ? null : ctx_r2.config.colConfig[i_r7] == null ? null : ctx_r2.config.colConfig[i_r7].style == null ? null : ctx_r2.config.colConfig[i_r7].style.width) || (ctx_r2.config == null ? null : ctx_r2.config.colHeaderConfig[i_r7] == null ? null : ctx_r2.config.colHeaderConfig[i_r7].style == null ? null : ctx_r2.config.colHeaderConfig[i_r7].style.width) || ""));
|
|
133
796
|
i0.ɵɵadvance();
|
|
134
797
|
i0.ɵɵstyleMap(ctx_r2.config.colConfig[i_r7] == null ? null : ctx_r2.config.colConfig[i_r7].style);
|
|
135
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction2(8, _c6
|
|
798
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction2(8, _c6, ctx_r2.config.colConfig[i_r7].action ? "pointer" : "default", (ctx_r2.config.colConfig[i_r7] == null ? null : ctx_r2.config.colConfig[i_r7].style == null ? null : ctx_r2.config.colConfig[i_r7].style.justifyContent) ? ctx_r2.config.colConfig[i_r7] == null ? null : ctx_r2.config.colConfig[i_r7].style == null ? null : ctx_r2.config.colConfig[i_r7].style.justifyContent : ctx_r2.config.colConfig[i_r7].type === "number" ? "flex-end" : "space-between"));
|
|
136
799
|
i0.ɵɵadvance();
|
|
137
800
|
i0.ɵɵproperty("ngIf", ctx_r2.config.colConfig[i_r7].type !== "custom");
|
|
138
801
|
i0.ɵɵadvance();
|
|
@@ -145,7 +808,7 @@ function SubTableComponent_div_6_Template(rf, ctx) { if (rf & 1) {
|
|
|
145
808
|
} if (rf & 2) {
|
|
146
809
|
const row_r9 = ctx.$implicit;
|
|
147
810
|
const i_r10 = ctx.index;
|
|
148
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(2, _c4
|
|
811
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(2, _c4, i_r10 % 2 === 0 ? "#FAFAFA" : null));
|
|
149
812
|
i0.ɵɵadvance(2);
|
|
150
813
|
i0.ɵɵproperty("ngForOf", row_r9);
|
|
151
814
|
} }
|
|
@@ -407,484 +1070,524 @@ class TableFilterComponent {
|
|
|
407
1070
|
}] }); })();
|
|
408
1071
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TableFilterComponent, { className: "TableFilterComponent" }); })();
|
|
409
1072
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
1073
|
+
class SortIconsDirective {
|
|
1074
|
+
constructor(el, renderer) {
|
|
1075
|
+
this.el = el;
|
|
1076
|
+
this.renderer = renderer;
|
|
1077
|
+
// Convert inputs to signals
|
|
1078
|
+
this.column = input();
|
|
1079
|
+
this.activeSort = input();
|
|
1080
|
+
this.activeSorts = input();
|
|
1081
|
+
this.multiColumnSort = input(false);
|
|
1082
|
+
// Convert output to signal
|
|
1083
|
+
this.sortChange = output();
|
|
1084
|
+
this.multiSortChange = output();
|
|
1085
|
+
// Internal state as signals
|
|
1086
|
+
this.currentDirection = signal('');
|
|
1087
|
+
}
|
|
1088
|
+
ngOnInit() {
|
|
1089
|
+
// Create a container for the icons
|
|
1090
|
+
const container = this.renderer.createElement('div');
|
|
1091
|
+
this.renderer?.setStyle(container, 'display', 'inline-flex');
|
|
1092
|
+
this.renderer?.setStyle(container, 'align-items', 'center');
|
|
1093
|
+
const iconContainer = this.renderer.createElement('div');
|
|
1094
|
+
this.renderer?.setStyle(iconContainer, 'display', 'inline-flex');
|
|
1095
|
+
this.renderer?.setStyle(iconContainer, 'flex-direction', 'column');
|
|
1096
|
+
this.renderer?.setStyle(iconContainer, 'align-items', 'center');
|
|
1097
|
+
this.upIcon = this.renderer.createElement('img');
|
|
1098
|
+
this.renderer?.setAttribute(this.upIcon, 'src', this.column()?.sortAscIcon);
|
|
1099
|
+
this.renderer?.setStyle(this.upIcon, 'opacity', '0.5');
|
|
1100
|
+
this.renderer?.setStyle(this.upIcon, 'transition', 'opacity 0.3s ease');
|
|
1101
|
+
this.renderer?.setStyle(this.upIcon, 'width', '9px');
|
|
1102
|
+
this.renderer?.setStyle(this.upIcon, 'cursor', 'pointer');
|
|
1103
|
+
this.renderer?.listen(this.upIcon, 'click', () => this.setSortDirection('ASC'));
|
|
1104
|
+
this.downIcon = this.renderer.createElement('img');
|
|
1105
|
+
this.renderer?.setAttribute(this.downIcon, 'src', this.column()?.sortDescIcon);
|
|
1106
|
+
this.renderer?.setStyle(this.downIcon, 'opacity', '0.5');
|
|
1107
|
+
this.renderer?.setStyle(this.downIcon, 'transition', 'opacity 0.3s ease');
|
|
1108
|
+
this.renderer?.setStyle(this.downIcon, 'width', '9px');
|
|
1109
|
+
this.renderer?.setStyle(this.downIcon, 'cursor', 'pointer');
|
|
1110
|
+
this.renderer?.listen(this.downIcon, 'click', () => this.setSortDirection('DESC'));
|
|
1111
|
+
this.renderer?.appendChild(iconContainer, this.upIcon);
|
|
1112
|
+
this.renderer?.appendChild(iconContainer, this.downIcon);
|
|
1113
|
+
this.renderer?.appendChild(container, iconContainer);
|
|
1114
|
+
if (this.multiColumnSort()) {
|
|
1115
|
+
this.sortOrderElement = this.renderer.createElement('span');
|
|
1116
|
+
this.renderer?.setStyle(this.sortOrderElement, 'font-size', '12px');
|
|
1117
|
+
this.renderer?.setStyle(this.sortOrderElement, 'font-weight', 'bold');
|
|
1118
|
+
this.renderer?.setStyle(this.sortOrderElement, 'color', '#000');
|
|
1119
|
+
this.renderer?.appendChild(container, this.sortOrderElement);
|
|
1120
|
+
}
|
|
1121
|
+
this.renderer?.appendChild(this.el.nativeElement, container);
|
|
1122
|
+
this.updateIconStyles();
|
|
1123
|
+
}
|
|
1124
|
+
ngOnChanges(changes) {
|
|
1125
|
+
if (changes['activeSort'] || changes['activeSorts']) {
|
|
1126
|
+
this.updateIconStyles();
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
setSortDirection(direction) {
|
|
1130
|
+
if (this.multiColumnSort()) {
|
|
1131
|
+
this.handleMultiColumnSort(direction);
|
|
1132
|
+
}
|
|
1133
|
+
else {
|
|
1134
|
+
this.handleSingleColumnSort(direction);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
handleSingleColumnSort(direction) {
|
|
1138
|
+
if (this.currentDirection() === direction) {
|
|
1139
|
+
this.currentDirection.set(''); // Reset sorting if the same direction is clicked
|
|
1140
|
+
}
|
|
1141
|
+
else {
|
|
1142
|
+
this.currentDirection.set(direction);
|
|
1143
|
+
}
|
|
1144
|
+
this.sortChange.emit({
|
|
1145
|
+
column: this.column()?.data || '',
|
|
1146
|
+
direction: this.currentDirection()
|
|
1147
|
+
});
|
|
1148
|
+
this.updateIconStyles();
|
|
1149
|
+
}
|
|
1150
|
+
handleMultiColumnSort(direction) {
|
|
1151
|
+
const existingSortIndex = this.activeSorts().findIndex(sort => sort.column === this.column()?.data);
|
|
1152
|
+
if (existingSortIndex !== -1) {
|
|
1153
|
+
if (this.activeSorts()[existingSortIndex].direction !== direction) {
|
|
1154
|
+
this.activeSorts()[existingSortIndex].direction = direction;
|
|
1155
|
+
}
|
|
1156
|
+
else {
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
else {
|
|
1161
|
+
this.activeSorts().push({
|
|
1162
|
+
column: this.column()?.data || '',
|
|
1163
|
+
direction
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
this.multiSortChange.emit([...this.activeSorts()]);
|
|
1167
|
+
this.updateIconStyles();
|
|
1168
|
+
}
|
|
1169
|
+
updateIconStyles() {
|
|
1170
|
+
if (this.multiColumnSort()) {
|
|
1171
|
+
this.updateMultiColumnIconStyles();
|
|
1172
|
+
}
|
|
1173
|
+
else {
|
|
1174
|
+
this.updateSingleColumnIconStyles();
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
updateSingleColumnIconStyles() {
|
|
1178
|
+
const isActiveColumn = this.activeSort()?.column === this.column()?.data;
|
|
1179
|
+
setTimeout(() => {
|
|
1180
|
+
this.renderer?.setStyle(this.upIcon, 'opacity', isActiveColumn && this.currentDirection() === 'ASC' ? '1' : '0.5');
|
|
1181
|
+
this.renderer?.setStyle(this.downIcon, 'opacity', isActiveColumn && this.currentDirection() === 'DESC' ? '1' : '0.5');
|
|
1182
|
+
}, 0);
|
|
1183
|
+
}
|
|
1184
|
+
updateMultiColumnIconStyles() {
|
|
1185
|
+
const columnSort = this.activeSorts().find(sort => sort.column === this.column()?.data);
|
|
1186
|
+
setTimeout(() => {
|
|
1187
|
+
this.renderer?.setStyle(this.upIcon, 'opacity', columnSort?.direction === 'ASC' ? '1' : '0.5');
|
|
1188
|
+
this.renderer?.setStyle(this.downIcon, 'opacity', columnSort?.direction === 'DESC' ? '1' : '0.5');
|
|
1189
|
+
if (this.sortOrderElement) {
|
|
1190
|
+
const sortIndex = this.activeSorts().findIndex(sort => sort.column === this.column()?.data);
|
|
1191
|
+
if (sortIndex !== -1) {
|
|
1192
|
+
this.renderer?.setProperty(this.sortOrderElement, 'textContent', (sortIndex + 1).toString());
|
|
1193
|
+
}
|
|
1194
|
+
else {
|
|
1195
|
+
this.renderer?.setProperty(this.sortOrderElement, 'textContent', '');
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
}, 0);
|
|
1199
|
+
}
|
|
1200
|
+
static { this.ɵfac = function SortIconsDirective_Factory(t) { return new (t || SortIconsDirective)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2)); }; }
|
|
1201
|
+
static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: SortIconsDirective, selectors: [["", "appSortIcons", ""]], inputs: { column: [i0.ɵɵInputFlags.SignalBased, "column"], activeSort: [i0.ɵɵInputFlags.SignalBased, "activeSort"], activeSorts: [i0.ɵɵInputFlags.SignalBased, "activeSorts"], multiColumnSort: [i0.ɵɵInputFlags.SignalBased, "multiColumnSort"] }, outputs: { sortChange: "sortChange", multiSortChange: "multiSortChange" }, features: [i0.ɵɵNgOnChangesFeature] }); }
|
|
1202
|
+
}
|
|
1203
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SortIconsDirective, [{
|
|
1204
|
+
type: Directive,
|
|
1205
|
+
args: [{
|
|
1206
|
+
selector: '[appSortIcons]',
|
|
1207
|
+
}]
|
|
1208
|
+
}], () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], null); })();
|
|
1209
|
+
|
|
1210
|
+
const _c0 = ["dropdownMenu"];
|
|
1211
|
+
const _c1 = ["dropdownTrigger"];
|
|
1212
|
+
const _c2 = a0 => ({ disabled: a0 });
|
|
1213
|
+
function ActionsCellComponent_div_1_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
427
1214
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
428
|
-
i0.ɵɵelementStart(0, "
|
|
429
|
-
i0.ɵɵlistener("
|
|
430
|
-
i0.ɵɵ
|
|
431
|
-
} if (rf & 2) {
|
|
432
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
433
|
-
i0.ɵɵproperty("containerStyles", ctx_r1.filterContainerStyles)("filtersData", ctx_r1.filterData);
|
|
434
|
-
} }
|
|
435
|
-
function TableComponent_div_5_p_2_Template(rf, ctx) { if (rf & 1) {
|
|
436
|
-
i0.ɵɵelementStart(0, "p", 16);
|
|
437
|
-
i0.ɵɵtext(1);
|
|
438
|
-
i0.ɵɵelementEnd();
|
|
439
|
-
} if (rf & 2) {
|
|
440
|
-
const colHeader_r4 = i0.ɵɵnextContext().$implicit;
|
|
441
|
-
i0.ɵɵadvance();
|
|
442
|
-
i0.ɵɵtextInterpolate1(" ", (colHeader_r4 == null ? null : colHeader_r4.data) || " ", " ");
|
|
443
|
-
} }
|
|
444
|
-
function TableComponent_div_5_span_3_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
445
|
-
i0.ɵɵelement(0, "span", 21);
|
|
446
|
-
} }
|
|
447
|
-
function TableComponent_div_5_span_3_Template(rf, ctx) { if (rf & 1) {
|
|
448
|
-
const _r5 = i0.ɵɵgetCurrentView();
|
|
449
|
-
i0.ɵɵelementStart(0, "span", 17);
|
|
450
|
-
i0.ɵɵlistener("click", function TableComponent_div_5_span_3_Template_span_click_0_listener($event) { i0.ɵɵrestoreView(_r5); const colHeader_r4 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); ctx_r1.filterData = colHeader_r4.filters; ctx_r1.toggleFilter(colHeader_r4.data); return i0.ɵɵresetView($event.stopPropagation()); });
|
|
451
|
-
i0.ɵɵtemplate(1, TableComponent_div_5_span_3_span_1_Template, 1, 0, "span", 18);
|
|
452
|
-
i0.ɵɵnamespaceSVG();
|
|
453
|
-
i0.ɵɵelementStart(2, "svg", 19);
|
|
454
|
-
i0.ɵɵelement(3, "path", 20);
|
|
455
|
-
i0.ɵɵelementEnd()();
|
|
456
|
-
} if (rf & 2) {
|
|
457
|
-
const colHeader_r4 = i0.ɵɵnextContext().$implicit;
|
|
458
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
459
|
-
i0.ɵɵadvance();
|
|
460
|
-
i0.ɵɵproperty("ngIf", (ctx_r1.appliedFilters[colHeader_r4.data] == null ? null : ctx_r1.appliedFilters[colHeader_r4.data].length) > 0);
|
|
461
|
-
} }
|
|
462
|
-
function TableComponent_div_5_4_ng_template_0_Template(rf, ctx) { }
|
|
463
|
-
function TableComponent_div_5_4_Template(rf, ctx) { if (rf & 1) {
|
|
464
|
-
i0.ɵɵtemplate(0, TableComponent_div_5_4_ng_template_0_Template, 0, 0, "ng-template", 22);
|
|
465
|
-
} if (rf & 2) {
|
|
466
|
-
const colHeader_r4 = i0.ɵɵnextContext().$implicit;
|
|
467
|
-
i0.ɵɵproperty("customComponent", colHeader_r4 == null ? null : colHeader_r4.componentRef)("data", colHeader_r4.data);
|
|
468
|
-
} }
|
|
469
|
-
function TableComponent_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
470
|
-
const _r3 = i0.ɵɵgetCurrentView();
|
|
471
|
-
i0.ɵɵelementStart(0, "div", 12, 2);
|
|
472
|
-
i0.ɵɵlistener("click", function TableComponent_div_5_Template_div_click_0_listener() { const colHeader_r4 = i0.ɵɵrestoreView(_r3).$implicit; return i0.ɵɵresetView((colHeader_r4 == null ? null : colHeader_r4.action) ? colHeader_r4 == null ? null : colHeader_r4.action(colHeader_r4) : null); });
|
|
473
|
-
i0.ɵɵtemplate(2, TableComponent_div_5_p_2_Template, 2, 1, "p", 13)(3, TableComponent_div_5_span_3_Template, 4, 1, "span", 14)(4, TableComponent_div_5_4_Template, 1, 2, null, 15);
|
|
1215
|
+
i0.ɵɵelementStart(0, "div", 10);
|
|
1216
|
+
i0.ɵɵlistener("click", function ActionsCellComponent_div_1_div_1_Template_div_click_0_listener($event) { const item_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onActionClick(item_r2, $event)); });
|
|
1217
|
+
i0.ɵɵelement(1, "img", 11);
|
|
474
1218
|
i0.ɵɵelementEnd();
|
|
475
1219
|
} if (rf & 2) {
|
|
476
|
-
const
|
|
477
|
-
|
|
478
|
-
i0.ɵɵ
|
|
479
|
-
i0.ɵɵproperty("ngIf", (colHeader_r4 == null ? null : colHeader_r4.type) !== "custom");
|
|
480
|
-
i0.ɵɵadvance();
|
|
481
|
-
i0.ɵɵproperty("ngIf", (colHeader_r4 == null ? null : colHeader_r4.type) !== "custom" && (colHeader_r4 == null ? null : colHeader_r4.filters) && (colHeader_r4 == null ? null : colHeader_r4.filters == null ? null : colHeader_r4.filters.length) > 0);
|
|
1220
|
+
const item_r2 = ctx.$implicit;
|
|
1221
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
1222
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c2, ctx_r2.isDisabled(item_r2)));
|
|
482
1223
|
i0.ɵɵadvance();
|
|
483
|
-
i0.ɵɵproperty("
|
|
1224
|
+
i0.ɵɵproperty("src", item_r2.icon, i0.ɵɵsanitizeUrl)("alt", item_r2.label);
|
|
484
1225
|
} }
|
|
485
|
-
function
|
|
486
|
-
i0.ɵɵelementStart(0, "
|
|
487
|
-
i0.ɵɵ
|
|
1226
|
+
function ActionsCellComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
1227
|
+
i0.ɵɵelementStart(0, "div", 8);
|
|
1228
|
+
i0.ɵɵtemplate(1, ActionsCellComponent_div_1_div_1_Template, 2, 5, "div", 9);
|
|
488
1229
|
i0.ɵɵelementEnd();
|
|
489
1230
|
} if (rf & 2) {
|
|
490
|
-
const
|
|
491
|
-
const col_r10 = ctx_r11.$implicit;
|
|
492
|
-
const i_r11 = ctx_r11.index;
|
|
493
|
-
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
494
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(2, _c11, (ctx_r1.config == null ? null : ctx_r1.config.colConfig[i_r11] == null ? null : ctx_r1.config.colConfig[i_r11].style == null ? null : ctx_r1.config.colConfig[i_r11].style.color) ? ctx_r1.config == null ? null : ctx_r1.config.colConfig[i_r11] == null ? null : ctx_r1.config.colConfig[i_r11].style == null ? null : ctx_r1.config.colConfig[i_r11].style.color : ""));
|
|
1231
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
495
1232
|
i0.ɵɵadvance();
|
|
496
|
-
i0.ɵɵ
|
|
1233
|
+
i0.ɵɵproperty("ngForOf", ctx_r2.actionItems)("ngForTrackBy", ctx_r2.trackByAction);
|
|
497
1234
|
} }
|
|
498
|
-
function
|
|
499
|
-
|
|
500
|
-
i0.ɵɵ
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
i0.ɵɵproperty("customComponent", ctx_r1.config.colConfig[i_r11].componentRef)("data", col_r10);
|
|
1235
|
+
function ActionsCellComponent_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
1236
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
1237
|
+
i0.ɵɵelementStart(0, "div", 12)(1, "div", 13, 1);
|
|
1238
|
+
i0.ɵɵlistener("click", function ActionsCellComponent_div_2_Template_div_click_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.toggleDropdown($event)); });
|
|
1239
|
+
i0.ɵɵnamespaceSVG();
|
|
1240
|
+
i0.ɵɵelementStart(3, "svg", 14);
|
|
1241
|
+
i0.ɵɵelement(4, "circle", 15)(5, "circle", 16)(6, "circle", 17);
|
|
1242
|
+
i0.ɵɵelementEnd()()();
|
|
507
1243
|
} }
|
|
508
|
-
function
|
|
509
|
-
const
|
|
510
|
-
i0.ɵɵelementStart(0, "div",
|
|
511
|
-
i0.ɵɵlistener("
|
|
512
|
-
i0.ɵɵelementStart(1, "div", 28);
|
|
513
|
-
i0.ɵɵtemplate(2, TableComponent_div_7_div_2_p_2_Template, 2, 4, "p", 29)(3, TableComponent_div_7_div_2_3_Template, 1, 2, null, 15);
|
|
1244
|
+
function ActionsCellComponent_div_3_Template(rf, ctx) { if (rf & 1) {
|
|
1245
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
1246
|
+
i0.ɵɵelementStart(0, "div", 18)(1, "mis-checkbox", 19);
|
|
1247
|
+
i0.ɵɵlistener("valueChange", function ActionsCellComponent_div_3_Template_mis_checkbox_valueChange_1_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onClick($event)); });
|
|
514
1248
|
i0.ɵɵelementEnd()();
|
|
515
1249
|
} if (rf & 2) {
|
|
516
|
-
const
|
|
517
|
-
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
518
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(7, _c8, (ctx_r1.config == null ? null : ctx_r1.config.colConfig[i_r11] == null ? null : ctx_r1.config.colConfig[i_r11].style == null ? null : ctx_r1.config.colConfig[i_r11].style.width) || (ctx_r1.config == null ? null : ctx_r1.config.colHeaderConfig[i_r11] == null ? null : ctx_r1.config.colHeaderConfig[i_r11].style == null ? null : ctx_r1.config.colHeaderConfig[i_r11].style.width) || ""))("ngClass", i0.ɵɵpureFunction1(9, _c9, ctx_r1.config.cellHover));
|
|
519
|
-
i0.ɵɵadvance();
|
|
520
|
-
i0.ɵɵstyleMap(ctx_r1.config.colConfig[i_r11] == null ? null : ctx_r1.config.colConfig[i_r11].style);
|
|
521
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction2(11, _c10, (ctx_r1.config.colConfig[i_r11] == null ? null : ctx_r1.config.colConfig[i_r11].action) ? "pointer" : "default", (ctx_r1.config.colConfig[i_r11] == null ? null : ctx_r1.config.colConfig[i_r11].style == null ? null : ctx_r1.config.colConfig[i_r11].style.justifyContent) ? ctx_r1.config.colConfig[i_r11] == null ? null : ctx_r1.config.colConfig[i_r11].style == null ? null : ctx_r1.config.colConfig[i_r11].style.justifyContent : (ctx_r1.config.colConfig[i_r11] == null ? null : ctx_r1.config.colConfig[i_r11].type) === "number" ? "flex-end" : "space-between"));
|
|
522
|
-
i0.ɵɵadvance();
|
|
523
|
-
i0.ɵɵproperty("ngIf", (ctx_r1.config.colConfig[i_r11] == null ? null : ctx_r1.config.colConfig[i_r11].type) !== "custom");
|
|
524
|
-
i0.ɵɵadvance();
|
|
525
|
-
i0.ɵɵproperty("ngIf", (ctx_r1.config.colConfig[i_r11] == null ? null : ctx_r1.config.colConfig[i_r11].type) === "custom");
|
|
526
|
-
} }
|
|
527
|
-
function TableComponent_div_7_div_3_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
528
|
-
i0.ɵɵelementContainerStart(0);
|
|
529
|
-
i0.ɵɵelementStart(1, "div", 32);
|
|
530
|
-
i0.ɵɵtext(2, " Loading... ");
|
|
531
|
-
i0.ɵɵelementEnd();
|
|
532
|
-
i0.ɵɵelementContainerEnd();
|
|
533
|
-
} if (rf & 2) {
|
|
1250
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
534
1251
|
i0.ɵɵadvance();
|
|
535
|
-
i0.ɵɵproperty("
|
|
1252
|
+
i0.ɵɵproperty("checked", ctx_r2.currentState)("disabled", ctx_r2.disable ? ctx_r2.disable(ctx_r2.currentState) : false);
|
|
536
1253
|
} }
|
|
537
|
-
function
|
|
538
|
-
i0.ɵɵ
|
|
539
|
-
i0.ɵɵelementStart(
|
|
540
|
-
i0.ɵɵ
|
|
1254
|
+
function ActionsCellComponent_div_4__svg_svg_2_Template(rf, ctx) { if (rf & 1) {
|
|
1255
|
+
i0.ɵɵnamespaceSVG();
|
|
1256
|
+
i0.ɵɵelementStart(0, "svg", 23);
|
|
1257
|
+
i0.ɵɵelement(1, "path", 24);
|
|
541
1258
|
i0.ɵɵelementEnd();
|
|
542
|
-
i0.ɵɵelementContainerEnd();
|
|
543
|
-
} if (rf & 2) {
|
|
544
|
-
i0.ɵɵadvance();
|
|
545
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction0(1, _c12));
|
|
546
|
-
} }
|
|
547
|
-
function TableComponent_div_7_div_3_ng_container_3_Template(rf, ctx) { if (rf & 1) {
|
|
548
|
-
i0.ɵɵelementContainerStart(0);
|
|
549
|
-
i0.ɵɵelement(1, "sub-table", 33);
|
|
550
|
-
i0.ɵɵelementContainerEnd();
|
|
551
|
-
} if (rf & 2) {
|
|
552
|
-
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
553
|
-
i0.ɵɵadvance();
|
|
554
|
-
i0.ɵɵproperty("config", ctx_r1.subTableconfig)("tableData", ctx_r1.subTableData);
|
|
555
1259
|
} }
|
|
556
|
-
function
|
|
557
|
-
i0.ɵɵ
|
|
558
|
-
i0.ɵɵ
|
|
1260
|
+
function ActionsCellComponent_div_4__svg_svg_3_Template(rf, ctx) { if (rf & 1) {
|
|
1261
|
+
i0.ɵɵnamespaceSVG();
|
|
1262
|
+
i0.ɵɵelementStart(0, "svg", 23);
|
|
1263
|
+
i0.ɵɵelement(1, "path", 25);
|
|
559
1264
|
i0.ɵɵelementEnd();
|
|
1265
|
+
} }
|
|
1266
|
+
function ActionsCellComponent_div_4_Template(rf, ctx) { if (rf & 1) {
|
|
1267
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
1268
|
+
i0.ɵɵelementStart(0, "div", 20)(1, "div", 21);
|
|
1269
|
+
i0.ɵɵlistener("click", function ActionsCellComponent_div_4_Template_div_click_1_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onClick($event)); });
|
|
1270
|
+
i0.ɵɵtemplate(2, ActionsCellComponent_div_4__svg_svg_2_Template, 2, 0, "svg", 22)(3, ActionsCellComponent_div_4__svg_svg_3_Template, 2, 0, "svg", 22);
|
|
1271
|
+
i0.ɵɵelementEnd()();
|
|
560
1272
|
} if (rf & 2) {
|
|
561
|
-
const
|
|
1273
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
562
1274
|
i0.ɵɵadvance();
|
|
563
|
-
i0.ɵɵproperty("
|
|
1275
|
+
i0.ɵɵproperty("title", ctx_r2.currentState ? "Expand" : "Collapse");
|
|
564
1276
|
i0.ɵɵadvance();
|
|
565
|
-
i0.ɵɵproperty("ngIf",
|
|
1277
|
+
i0.ɵɵproperty("ngIf", ctx_r2.currentState);
|
|
566
1278
|
i0.ɵɵadvance();
|
|
567
|
-
i0.ɵɵproperty("ngIf", !
|
|
1279
|
+
i0.ɵɵproperty("ngIf", !ctx_r2.currentState);
|
|
568
1280
|
} }
|
|
569
|
-
function
|
|
570
|
-
|
|
571
|
-
i0.ɵɵ
|
|
572
|
-
i0.ɵɵlistener("click", function TableComponent_div_7_Template_div_click_1_listener() { const i_r7 = i0.ɵɵrestoreView(_r6).index; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.selectRow(i_r7)); });
|
|
573
|
-
i0.ɵɵtemplate(2, TableComponent_div_7_div_2_Template, 4, 14, "div", 25);
|
|
574
|
-
i0.ɵɵelementEnd();
|
|
575
|
-
i0.ɵɵtemplate(3, TableComponent_div_7_div_3_Template, 4, 3, "div", 26);
|
|
1281
|
+
function ActionsCellComponent_ng_template_5_div_1_ng_container_1_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
1282
|
+
i0.ɵɵelementStart(0, "span", 36);
|
|
1283
|
+
i0.ɵɵelement(1, "img", 37);
|
|
576
1284
|
i0.ɵɵelementEnd();
|
|
577
1285
|
} if (rf & 2) {
|
|
578
|
-
const
|
|
579
|
-
const i_r7 = ctx.index;
|
|
580
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
581
|
-
i0.ɵɵadvance();
|
|
582
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(4, _c6, ctx_r1.config.cellHover, i_r7 === ctx_r1.activeRowIndex))("ngStyle", i0.ɵɵpureFunction1(7, _c7, (ctx_r1.config == null ? null : ctx_r1.config.rowConfig == null ? null : ctx_r1.config.rowConfig.height) ? ctx_r1.config.rowConfig.height : "44px"));
|
|
1286
|
+
const item_r8 = i0.ɵɵnextContext(2).$implicit;
|
|
583
1287
|
i0.ɵɵadvance();
|
|
584
|
-
i0.ɵɵproperty("
|
|
585
|
-
i0.ɵɵadvance();
|
|
586
|
-
i0.ɵɵproperty("ngIf", (ctx_r1.config == null ? null : ctx_r1.config.canExpand) && ctx_r1.expandedIndex === i_r7);
|
|
1288
|
+
i0.ɵɵproperty("src", item_r8.icon, i0.ɵɵsanitizeUrl);
|
|
587
1289
|
} }
|
|
588
|
-
function
|
|
589
|
-
|
|
590
|
-
i0.ɵɵ
|
|
591
|
-
i0.ɵɵlistener("click", function TableComponent_div_8_div_7_span_1_Template_span_click_0_listener() { i0.ɵɵrestoreView(_r15); const pageNumber_r16 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.updateSelectedPage(pageNumber_r16)); });
|
|
592
|
-
i0.ɵɵtext(1);
|
|
1290
|
+
function ActionsCellComponent_ng_template_5_div_1_ng_container_1_div_7_div_1_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
1291
|
+
i0.ɵɵelementStart(0, "span", 36);
|
|
1292
|
+
i0.ɵɵelement(1, "img", 37);
|
|
593
1293
|
i0.ɵɵelementEnd();
|
|
594
1294
|
} if (rf & 2) {
|
|
595
|
-
const
|
|
596
|
-
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
597
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c13, pageNumber_r16 == (ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.selectedPage)));
|
|
1295
|
+
const child_r10 = i0.ɵɵnextContext().$implicit;
|
|
598
1296
|
i0.ɵɵadvance();
|
|
599
|
-
i0.ɵɵ
|
|
1297
|
+
i0.ɵɵproperty("src", child_r10.icon, i0.ɵɵsanitizeUrl);
|
|
600
1298
|
} }
|
|
601
|
-
function
|
|
602
|
-
i0.ɵɵ
|
|
603
|
-
i0.ɵɵ
|
|
1299
|
+
function ActionsCellComponent_ng_template_5_div_1_ng_container_1_div_7_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
1300
|
+
const _r9 = i0.ɵɵgetCurrentView();
|
|
1301
|
+
i0.ɵɵelementStart(0, "div", 28);
|
|
1302
|
+
i0.ɵɵlistener("click", function ActionsCellComponent_ng_template_5_div_1_ng_container_1_div_7_div_1_Template_div_click_0_listener($event) { const child_r10 = i0.ɵɵrestoreView(_r9).$implicit; const ctx_r2 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r2.onDropdownItemClick(child_r10, $event)); });
|
|
1303
|
+
i0.ɵɵtemplate(1, ActionsCellComponent_ng_template_5_div_1_ng_container_1_div_7_div_1_span_1_Template, 2, 1, "span", 30);
|
|
1304
|
+
i0.ɵɵelementStart(2, "span", 31);
|
|
1305
|
+
i0.ɵɵtext(3);
|
|
604
1306
|
i0.ɵɵelementEnd()();
|
|
605
1307
|
} if (rf & 2) {
|
|
1308
|
+
const child_r10 = ctx.$implicit;
|
|
1309
|
+
const ctx_r2 = i0.ɵɵnextContext(5);
|
|
1310
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c2, ctx_r2.isDisabled(child_r10)));
|
|
606
1311
|
i0.ɵɵadvance();
|
|
607
|
-
i0.ɵɵproperty("
|
|
608
|
-
i0.ɵɵadvance();
|
|
609
|
-
i0.ɵɵ
|
|
1312
|
+
i0.ɵɵproperty("ngIf", child_r10.icon);
|
|
1313
|
+
i0.ɵɵadvance(2);
|
|
1314
|
+
i0.ɵɵtextInterpolate(child_r10.label);
|
|
1315
|
+
} }
|
|
1316
|
+
function ActionsCellComponent_ng_template_5_div_1_ng_container_1_div_7_Template(rf, ctx) { if (rf & 1) {
|
|
1317
|
+
i0.ɵɵelementStart(0, "div", 38);
|
|
1318
|
+
i0.ɵɵtemplate(1, ActionsCellComponent_ng_template_5_div_1_ng_container_1_div_7_div_1_Template, 4, 5, "div", 27);
|
|
1319
|
+
i0.ɵɵelementEnd();
|
|
1320
|
+
} if (rf & 2) {
|
|
1321
|
+
const item_r8 = i0.ɵɵnextContext(2).$implicit;
|
|
610
1322
|
i0.ɵɵadvance();
|
|
611
|
-
i0.ɵɵproperty("
|
|
1323
|
+
i0.ɵɵproperty("ngForOf", item_r8.children);
|
|
612
1324
|
} }
|
|
613
|
-
function
|
|
614
|
-
i0.ɵɵ
|
|
615
|
-
i0.ɵɵtemplate(1,
|
|
1325
|
+
function ActionsCellComponent_ng_template_5_div_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
1326
|
+
i0.ɵɵelementContainerStart(0);
|
|
1327
|
+
i0.ɵɵtemplate(1, ActionsCellComponent_ng_template_5_div_1_ng_container_1_span_1_Template, 2, 1, "span", 30);
|
|
1328
|
+
i0.ɵɵelementStart(2, "span", 31);
|
|
1329
|
+
i0.ɵɵtext(3);
|
|
616
1330
|
i0.ɵɵelementEnd();
|
|
1331
|
+
i0.ɵɵelementStart(4, "span", 32);
|
|
1332
|
+
i0.ɵɵnamespaceSVG();
|
|
1333
|
+
i0.ɵɵelementStart(5, "svg", 33);
|
|
1334
|
+
i0.ɵɵelement(6, "path", 34);
|
|
1335
|
+
i0.ɵɵelementEnd()();
|
|
1336
|
+
i0.ɵɵtemplate(7, ActionsCellComponent_ng_template_5_div_1_ng_container_1_div_7_Template, 2, 1, "div", 35);
|
|
1337
|
+
i0.ɵɵelementContainerEnd();
|
|
617
1338
|
} if (rf & 2) {
|
|
618
|
-
const
|
|
1339
|
+
const item_r8 = i0.ɵɵnextContext().$implicit;
|
|
619
1340
|
i0.ɵɵadvance();
|
|
620
|
-
i0.ɵɵproperty("ngIf",
|
|
1341
|
+
i0.ɵɵproperty("ngIf", item_r8.icon);
|
|
1342
|
+
i0.ɵɵadvance(2);
|
|
1343
|
+
i0.ɵɵtextInterpolate(item_r8.label);
|
|
1344
|
+
i0.ɵɵadvance(4);
|
|
1345
|
+
i0.ɵɵproperty("ngIf", item_r8.showSubmenu);
|
|
1346
|
+
} }
|
|
1347
|
+
function ActionsCellComponent_ng_template_5_div_1_ng_template_2_span_0_Template(rf, ctx) { if (rf & 1) {
|
|
1348
|
+
i0.ɵɵelementStart(0, "span", 36);
|
|
1349
|
+
i0.ɵɵelement(1, "img", 37);
|
|
1350
|
+
i0.ɵɵelementEnd();
|
|
1351
|
+
} if (rf & 2) {
|
|
1352
|
+
const item_r8 = i0.ɵɵnextContext(2).$implicit;
|
|
621
1353
|
i0.ɵɵadvance();
|
|
622
|
-
i0.ɵɵproperty("
|
|
1354
|
+
i0.ɵɵproperty("src", item_r8.icon, i0.ɵɵsanitizeUrl);
|
|
623
1355
|
} }
|
|
624
|
-
function
|
|
625
|
-
|
|
626
|
-
i0.ɵɵelementStart(
|
|
1356
|
+
function ActionsCellComponent_ng_template_5_div_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
|
|
1357
|
+
i0.ɵɵtemplate(0, ActionsCellComponent_ng_template_5_div_1_ng_template_2_span_0_Template, 2, 1, "span", 30);
|
|
1358
|
+
i0.ɵɵelementStart(1, "span", 31);
|
|
627
1359
|
i0.ɵɵtext(2);
|
|
628
1360
|
i0.ɵɵelementEnd();
|
|
629
|
-
i0.ɵɵelementStart(3, "div", 36)(4, "span", 37);
|
|
630
|
-
i0.ɵɵlistener("click", function TableComponent_div_8_Template_span_click_4_listener() { i0.ɵɵrestoreView(_r14); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.updateSelectedPage((ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.selectedPage) - 1)); });
|
|
631
|
-
i0.ɵɵnamespaceSVG();
|
|
632
|
-
i0.ɵɵelementStart(5, "svg", 38);
|
|
633
|
-
i0.ɵɵelement(6, "path", 39);
|
|
634
|
-
i0.ɵɵelementEnd()();
|
|
635
|
-
i0.ɵɵtemplate(7, TableComponent_div_8_div_7_Template, 3, 2, "div", 40);
|
|
636
|
-
i0.ɵɵnamespaceHTML();
|
|
637
|
-
i0.ɵɵelementStart(8, "span", 37);
|
|
638
|
-
i0.ɵɵlistener("click", function TableComponent_div_8_Template_span_click_8_listener() { i0.ɵɵrestoreView(_r14); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.updateSelectedPage((ctx_r1.config.paginationConfig == null ? null : ctx_r1.config.paginationConfig.selectedPage) + 1)); });
|
|
639
|
-
i0.ɵɵnamespaceSVG();
|
|
640
|
-
i0.ɵɵelementStart(9, "svg", 38);
|
|
641
|
-
i0.ɵɵelement(10, "path", 41);
|
|
642
|
-
i0.ɵɵelementEnd()()()();
|
|
643
1361
|
} if (rf & 2) {
|
|
644
|
-
const
|
|
1362
|
+
const item_r8 = i0.ɵɵnextContext().$implicit;
|
|
1363
|
+
i0.ɵɵproperty("ngIf", item_r8.icon);
|
|
645
1364
|
i0.ɵɵadvance(2);
|
|
646
|
-
i0.ɵɵ
|
|
647
|
-
i0.ɵɵadvance(5);
|
|
648
|
-
i0.ɵɵproperty("ngForOf", ctx_r1.pages);
|
|
1365
|
+
i0.ɵɵtextInterpolate(item_r8.label);
|
|
649
1366
|
} }
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
1367
|
+
function ActionsCellComponent_ng_template_5_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
1368
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
1369
|
+
i0.ɵɵelementStart(0, "div", 28);
|
|
1370
|
+
i0.ɵɵlistener("click", function ActionsCellComponent_ng_template_5_div_1_Template_div_click_0_listener($event) { const item_r8 = i0.ɵɵrestoreView(_r7).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onDropdownItemClick(item_r8, $event)); });
|
|
1371
|
+
i0.ɵɵtemplate(1, ActionsCellComponent_ng_template_5_div_1_ng_container_1_Template, 8, 3, "ng-container", 29)(2, ActionsCellComponent_ng_template_5_div_1_ng_template_2_Template, 3, 2, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
|
|
1372
|
+
i0.ɵɵelementEnd();
|
|
1373
|
+
} if (rf & 2) {
|
|
1374
|
+
const item_r8 = ctx.$implicit;
|
|
1375
|
+
const noChildren_r11 = i0.ɵɵreference(3);
|
|
1376
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
1377
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c2, ctx_r2.isDisabled(item_r8)));
|
|
1378
|
+
i0.ɵɵadvance();
|
|
1379
|
+
i0.ɵɵproperty("ngIf", item_r8.children == null ? null : item_r8.children.length)("ngIfElse", noChildren_r11);
|
|
1380
|
+
} }
|
|
1381
|
+
function ActionsCellComponent_ng_template_5_Template(rf, ctx) { if (rf & 1) {
|
|
1382
|
+
i0.ɵɵelementStart(0, "div", 26);
|
|
1383
|
+
i0.ɵɵtemplate(1, ActionsCellComponent_ng_template_5_div_1_Template, 4, 5, "div", 27);
|
|
1384
|
+
i0.ɵɵelementEnd();
|
|
1385
|
+
} if (rf & 2) {
|
|
1386
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
1387
|
+
i0.ɵɵadvance();
|
|
1388
|
+
i0.ɵɵproperty("ngForOf", ctx_r2.actionItems);
|
|
1389
|
+
} }
|
|
1390
|
+
class ActionsCellComponent {
|
|
1391
|
+
constructor(overlay, viewContainerRef) {
|
|
1392
|
+
this.overlay = overlay;
|
|
1393
|
+
this.viewContainerRef = viewContainerRef;
|
|
1394
|
+
this.actionClick = new EventEmitter();
|
|
1395
|
+
this.isDropdownOpen = false;
|
|
1396
|
+
this.actionItems = [];
|
|
1397
|
+
this.actionType = "inline";
|
|
1398
|
+
this.currentState = false;
|
|
1399
|
+
this._style = {};
|
|
1400
|
+
this.containerStyle = {};
|
|
1401
|
+
this.overlayRef = null;
|
|
672
1402
|
}
|
|
673
1403
|
ngOnInit() {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
this.
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
this.
|
|
1404
|
+
if (this.config) {
|
|
1405
|
+
this.actionItems = this.config.actionItems;
|
|
1406
|
+
this.actionType = this.config.actionType;
|
|
1407
|
+
this._style = this.config.style;
|
|
1408
|
+
this.action = this.config.action;
|
|
1409
|
+
this.disable = this.config.disable;
|
|
1410
|
+
this.processStyle();
|
|
681
1411
|
}
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
this.toggleFilter(this.filterName);
|
|
693
|
-
}
|
|
1412
|
+
if (this.cellData !== null) {
|
|
1413
|
+
const defaultStates = {
|
|
1414
|
+
'checkbox': false,
|
|
1415
|
+
'row-collapse': true,
|
|
1416
|
+
};
|
|
1417
|
+
if (this.actionType in defaultStates) {
|
|
1418
|
+
this.currentState = typeof this.cellData === 'boolean' ? this.cellData : defaultStates[this.actionType];
|
|
1419
|
+
}
|
|
1420
|
+
else {
|
|
1421
|
+
this.data = this.cellData;
|
|
694
1422
|
}
|
|
695
|
-
});
|
|
696
|
-
}
|
|
697
|
-
ngAfterViewInit() {
|
|
698
|
-
if (this.config.paginationConfig) {
|
|
699
|
-
let height = this.config.height;
|
|
700
|
-
this.renderer.setStyle(this.table.nativeElement, "height", height - 56 + "px");
|
|
701
1423
|
}
|
|
702
1424
|
}
|
|
703
|
-
|
|
704
|
-
this.
|
|
705
|
-
this.activeRowIndex = this.config.activeRowIndex || 0;
|
|
1425
|
+
ngOnDestroy() {
|
|
1426
|
+
this.closeDropdown();
|
|
706
1427
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
let filters = [];
|
|
712
|
-
for (let filter of colHeader.filters) {
|
|
713
|
-
if (filter.checked) {
|
|
714
|
-
filters.push({
|
|
715
|
-
name: filter.name,
|
|
716
|
-
value: filter.value
|
|
717
|
-
});
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
if (filters.length > 0)
|
|
721
|
-
this.appliedFilters[colHeader.data] = filters;
|
|
722
|
-
}
|
|
723
|
-
}
|
|
1428
|
+
processStyle() {
|
|
1429
|
+
// Remove width from style to avoid conflicts with table column width
|
|
1430
|
+
const { width, ...restStyle } = this._style;
|
|
1431
|
+
this.containerStyle = restStyle;
|
|
724
1432
|
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
break;
|
|
734
|
-
offSet += header.nativeElement.offsetWidth;
|
|
735
|
-
}
|
|
736
|
-
this.filterContainerStyles = {
|
|
737
|
-
top: "44px",
|
|
738
|
-
right: offSet > 0 ? offSet - 116 + "px" : "12px"
|
|
739
|
-
};
|
|
1433
|
+
onActionClick(item, event) {
|
|
1434
|
+
event.stopPropagation();
|
|
1435
|
+
// Check permissions before executing action
|
|
1436
|
+
if (this.isDisabled(item))
|
|
1437
|
+
return;
|
|
1438
|
+
// Execute action only if permitted
|
|
1439
|
+
if (item.action) {
|
|
1440
|
+
item.action(this.data);
|
|
740
1441
|
}
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
1442
|
+
this.actionClick.emit({ item });
|
|
1443
|
+
}
|
|
1444
|
+
trackByAction(index, item) {
|
|
1445
|
+
return item.value;
|
|
1446
|
+
}
|
|
1447
|
+
isSvgFile(iconPath) {
|
|
1448
|
+
if (!iconPath)
|
|
1449
|
+
return false;
|
|
1450
|
+
return iconPath.toLowerCase().includes(".svg") || iconPath.toLowerCase().includes("assets/icons/");
|
|
1451
|
+
}
|
|
1452
|
+
onDocumentClick() {
|
|
1453
|
+
if (this.isDropdownOpen) {
|
|
1454
|
+
this.closeDropdown();
|
|
745
1455
|
}
|
|
746
1456
|
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
1457
|
+
toggleDropdown(event) {
|
|
1458
|
+
event.stopPropagation();
|
|
1459
|
+
if (this.isDropdownOpen) {
|
|
1460
|
+
this.closeDropdown();
|
|
750
1461
|
}
|
|
751
1462
|
else {
|
|
752
|
-
this.
|
|
1463
|
+
this.openDropdown();
|
|
753
1464
|
}
|
|
754
|
-
this.filtersUpdated.emit({ ...this.appliedFilters });
|
|
755
|
-
this.toggleFilter(this.filterName);
|
|
756
1465
|
}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
1466
|
+
openDropdown() {
|
|
1467
|
+
if (!this.dropdownTrigger || !this.dropdownMenu)
|
|
1468
|
+
return;
|
|
1469
|
+
// Close all submenus when opening main menu
|
|
1470
|
+
this.actionItems.forEach((item) => (item.showSubmenu = false));
|
|
1471
|
+
const positions = this.getDropdownPositions();
|
|
1472
|
+
const overlayConfig = new OverlayConfig({
|
|
1473
|
+
hasBackdrop: true,
|
|
1474
|
+
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
1475
|
+
positionStrategy: this.overlay
|
|
1476
|
+
.position()
|
|
1477
|
+
.flexibleConnectedTo(this.dropdownTrigger)
|
|
1478
|
+
.withPositions(positions)
|
|
1479
|
+
.withPush(true),
|
|
1480
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition()
|
|
1481
|
+
});
|
|
1482
|
+
this.overlayRef = this.overlay.create(overlayConfig);
|
|
1483
|
+
const portal = new TemplatePortal(this.dropdownMenu, this.viewContainerRef);
|
|
1484
|
+
this.overlayRef.attach(portal);
|
|
1485
|
+
this.overlayRef.backdropClick().subscribe(() => {
|
|
1486
|
+
this.closeDropdown();
|
|
1487
|
+
});
|
|
1488
|
+
this.isDropdownOpen = true;
|
|
1489
|
+
}
|
|
1490
|
+
closeDropdown() {
|
|
1491
|
+
if (this.overlayRef) {
|
|
1492
|
+
this.overlayRef.dispose();
|
|
1493
|
+
this.overlayRef = null;
|
|
769
1494
|
}
|
|
1495
|
+
this.isDropdownOpen = false;
|
|
770
1496
|
}
|
|
771
|
-
|
|
772
|
-
|
|
1497
|
+
getDropdownPositions() {
|
|
1498
|
+
// Use CDK Overlay's flexible positioning - it will automatically choose the best position
|
|
1499
|
+
return [
|
|
1500
|
+
// Primary position: below and aligned to end (right)
|
|
1501
|
+
new ConnectionPositionPair({ originX: 'end', originY: 'bottom' }, { overlayX: 'end', overlayY: 'top' }, 0, 4),
|
|
1502
|
+
// Fallback position: above and aligned to end (right)
|
|
1503
|
+
new ConnectionPositionPair({ originX: 'end', originY: 'top' }, { overlayX: 'end', overlayY: 'bottom' }, 0, -4),
|
|
1504
|
+
// Fallback position: below and aligned to start (left)
|
|
1505
|
+
new ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }, 0, 4),
|
|
1506
|
+
// Fallback position: above and aligned to start (left)
|
|
1507
|
+
new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'bottom' }, 0, -4)
|
|
1508
|
+
];
|
|
1509
|
+
}
|
|
1510
|
+
onDropdownItemClick(item, event) {
|
|
1511
|
+
event.stopPropagation();
|
|
1512
|
+
if (this.isDisabled(item))
|
|
773
1513
|
return;
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
1514
|
+
if (item?.children?.length) {
|
|
1515
|
+
// Toggle submenu
|
|
1516
|
+
item.showSubmenu = !item.showSubmenu;
|
|
1517
|
+
// Optionally close other submenus
|
|
1518
|
+
this.actionItems.forEach((i) => {
|
|
1519
|
+
if (i !== item)
|
|
1520
|
+
i.showSubmenu = false;
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1523
|
+
else {
|
|
1524
|
+
// Handle action
|
|
1525
|
+
if (item.action)
|
|
1526
|
+
item.action(this.data);
|
|
1527
|
+
this.actionClick.emit({ item, data: this.data });
|
|
1528
|
+
this.closeDropdown(); // Only close if action was executed
|
|
786
1529
|
}
|
|
787
|
-
this.pageSelected.emit(this.config.paginationConfig?.selectedPage);
|
|
788
|
-
}
|
|
789
|
-
// Main container related functions
|
|
790
|
-
getContainerHeight() {
|
|
791
|
-
if (this.config?.height)
|
|
792
|
-
return this.config.height;
|
|
793
|
-
else
|
|
794
|
-
return "";
|
|
795
1530
|
}
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
1531
|
+
onClick(event) {
|
|
1532
|
+
this.currentState = !this.currentState;
|
|
1533
|
+
this.actionClick.emit({
|
|
1534
|
+
actionType: this.actionType,
|
|
1535
|
+
value: this.currentState
|
|
1536
|
+
});
|
|
801
1537
|
}
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
const borderBottom = colHeadersRowConfig?.style?.borderBottom || "1px solid #E0E0E0";
|
|
808
|
-
const backgroundColor = colHeadersRowConfig?.style?.backgroundColor || "#FFFFFF";
|
|
809
|
-
const fontSize = colHeadersRowConfig?.style?.fontSize || "14px";
|
|
810
|
-
return {
|
|
811
|
-
'min-height': minHeight,
|
|
812
|
-
'border-top': borderTop,
|
|
813
|
-
'border-bottom': borderBottom,
|
|
814
|
-
'background-color': backgroundColor,
|
|
815
|
-
'font-size': fontSize
|
|
816
|
-
};
|
|
1538
|
+
isDisabled(item) {
|
|
1539
|
+
if (typeof item.disable === "function") {
|
|
1540
|
+
return item.disable(this.data);
|
|
1541
|
+
}
|
|
1542
|
+
return false;
|
|
817
1543
|
}
|
|
818
|
-
static { this.ɵfac = function
|
|
819
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
1544
|
+
static { this.ɵfac = function ActionsCellComponent_Factory(t) { return new (t || ActionsCellComponent)(i0.ɵɵdirectiveInject(i1$1.Overlay), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); }; }
|
|
1545
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ActionsCellComponent, selectors: [["mis-actions-cell"]], viewQuery: function ActionsCellComponent_Query(rf, ctx) { if (rf & 1) {
|
|
820
1546
|
i0.ɵɵviewQuery(_c0, 5);
|
|
821
1547
|
i0.ɵɵviewQuery(_c1, 5);
|
|
822
|
-
i0.ɵɵviewQuery(_c2, 5);
|
|
823
1548
|
} if (rf & 2) {
|
|
824
1549
|
let _t;
|
|
825
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
826
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
827
|
-
|
|
828
|
-
|
|
1550
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.dropdownMenu = _t.first);
|
|
1551
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.dropdownTrigger = _t.first);
|
|
1552
|
+
} }, hostBindings: function ActionsCellComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
|
1553
|
+
i0.ɵɵlistener("click", function ActionsCellComponent_click_HostBindingHandler() { return ctx.onDocumentClick(); }, false, i0.ɵɵresolveDocument);
|
|
1554
|
+
} }, inputs: { cellData: "cellData", config: "config" }, outputs: { actionClick: "actionClick" }, decls: 7, vars: 5, consts: [["dropdownMenu", ""], ["dropdownTrigger", ""], ["noChildren", ""], [1, "actions-cell-container", 3, "ngStyle"], ["class", "inline-actions", 4, "ngIf"], ["class", "dropdown-actions", 4, "ngIf"], ["class", "checkbox-actions", 4, "ngIf"], ["class", "collapse-toggle-action", 4, "ngIf"], [1, "inline-actions"], ["class", "action-item", 3, "ngClass", "click", 4, "ngFor", "ngForOf", "ngForTrackBy"], [1, "action-item", 3, "click", "ngClass"], [1, "action-icon-svg", 3, "src", "alt"], [1, "dropdown-actions"], ["title", "More actions", 1, "dropdown-trigger", 3, "click"], ["width", "20", "height", "20", "viewBox", "0 0 20 20", "fill", "none"], ["cx", "10", "cy", "4", "r", "2", "fill", "#333"], ["cx", "10", "cy", "10", "r", "2", "fill", "#333"], ["cx", "10", "cy", "16", "r", "2", "fill", "#333"], [1, "checkbox-actions"], [3, "valueChange", "checked", "disabled"], [1, "collapse-toggle-action"], [1, "collapse-icon", 3, "click", "title"], ["width", "20", "height", "20", "viewBox", "0 0 24 24", 4, "ngIf"], ["width", "20", "height", "20", "viewBox", "0 0 24 24"], ["d", "M7 10l5 5 5-5", "stroke", "#0D1321", "stroke-width", "2", "fill", "none", "stroke-linecap", "round", "stroke-linejoin", "round"], ["d", "M7 14l5-5 5 5", "stroke", "#0D1321", "stroke-width", "2", "fill", "none", "stroke-linecap", "round", "stroke-linejoin", "round"], [1, "dropdown-menu-overlay"], ["class", "dropdown-menu-item", 3, "ngClass", "click", 4, "ngFor", "ngForOf"], [1, "dropdown-menu-item", 3, "click", "ngClass"], [4, "ngIf", "ngIfElse"], ["class", "dropdown-icon", 4, "ngIf"], [1, "dropdown-label"], [1, "submenu-arrow"], ["width", "20", "height", "20", "viewBox", "0 0 24 24", "fill", "none"], ["d", "M9 6L15 12L9 18", "stroke", "#0D1321", "stroke-width", "2", "stroke-linecap", "round", "stroke-linejoin", "round"], ["class", "dropdown-submenu", 4, "ngIf"], [1, "dropdown-icon"], [3, "src"], [1, "dropdown-submenu"]], template: function ActionsCellComponent_Template(rf, ctx) { if (rf & 1) {
|
|
829
1555
|
i0.ɵɵelementStart(0, "div", 3);
|
|
830
|
-
i0.ɵɵtemplate(1,
|
|
831
|
-
i0.ɵɵelementStart(2, "div", 5, 0)(4, "div", 6);
|
|
832
|
-
i0.ɵɵtemplate(5, TableComponent_div_5_Template, 5, 8, "div", 7);
|
|
833
|
-
i0.ɵɵelementEnd();
|
|
834
|
-
i0.ɵɵelementStart(6, "div", 8);
|
|
835
|
-
i0.ɵɵtemplate(7, TableComponent_div_7_Template, 4, 9, "div", 9);
|
|
836
|
-
i0.ɵɵelementEnd()();
|
|
837
|
-
i0.ɵɵtemplate(8, TableComponent_div_8_Template, 11, 4, "div", 10);
|
|
1556
|
+
i0.ɵɵtemplate(1, ActionsCellComponent_div_1_Template, 2, 2, "div", 4)(2, ActionsCellComponent_div_2_Template, 7, 0, "div", 5)(3, ActionsCellComponent_div_3_Template, 2, 2, "div", 6);
|
|
838
1557
|
i0.ɵɵelementEnd();
|
|
1558
|
+
i0.ɵɵtemplate(4, ActionsCellComponent_div_4_Template, 4, 3, "div", 7)(5, ActionsCellComponent_ng_template_5_Template, 2, 1, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
|
|
839
1559
|
} if (rf & 2) {
|
|
840
|
-
i0.ɵɵproperty("ngStyle",
|
|
1560
|
+
i0.ɵɵproperty("ngStyle", ctx.containerStyle);
|
|
841
1561
|
i0.ɵɵadvance();
|
|
842
|
-
i0.ɵɵproperty("ngIf", ctx.
|
|
1562
|
+
i0.ɵɵproperty("ngIf", ctx.actionType === "inline");
|
|
843
1563
|
i0.ɵɵadvance();
|
|
844
|
-
i0.ɵɵproperty("
|
|
845
|
-
i0.ɵɵadvance(2);
|
|
846
|
-
i0.ɵɵproperty("ngStyle", ctx.getColHeadersRowStyles());
|
|
1564
|
+
i0.ɵɵproperty("ngIf", ctx.actionType === "dropdown");
|
|
847
1565
|
i0.ɵɵadvance();
|
|
848
|
-
i0.ɵɵproperty("
|
|
849
|
-
i0.ɵɵadvance(2);
|
|
850
|
-
i0.ɵɵproperty("ngForOf", ctx.tableData);
|
|
1566
|
+
i0.ɵɵproperty("ngIf", ctx.actionType === "checkbox");
|
|
851
1567
|
i0.ɵɵadvance();
|
|
852
|
-
i0.ɵɵproperty("ngIf",
|
|
853
|
-
} }, dependencies: [i1.NgClass, i1.NgForOf, i1.NgIf, i1.NgStyle,
|
|
1568
|
+
i0.ɵɵproperty("ngIf", ctx.actionType === "row-collapse");
|
|
1569
|
+
} }, dependencies: [i1.NgClass, i1.NgForOf, i1.NgIf, i1.NgStyle, i2$1.CheckboxComponent], styles: [".actions-cell-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:100%;height:100%;position:relative;box-sizing:border-box}.inline-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;flex-wrap:nowrap;padding:4px 0;flex-direction:row}.action-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:20px;border-radius:4px;cursor:pointer;transition:all .2s ease;background-color:transparent;border:none;outline:none;flex-shrink:0;min-height:20px}.action-item[_ngcontent-%COMP%]:hover:not(.disabled){background-color:#0000000a;transform:scale(1.05)}.action-item[_ngcontent-%COMP%]:active:not(.disabled){transform:scale(.95)}.action-item.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed}.action-item.disabled[_ngcontent-%COMP%]:hover{background-color:transparent;transform:none}.action-icon[_ngcontent-%COMP%]{font-size:16px;color:#666;display:flex;align-items:center;justify-content:center;width:100%;height:100%}.action-icon-svg[_ngcontent-%COMP%]{width:18px;height:18px;object-fit:contain;filter:brightness(0) saturate(100%) invert(40%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(.6) contrast(1);flex-shrink:0}.action-icon-svg[_ngcontent-%COMP%]:hover{filter:brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0) contrast(1)}.dropdown-trigger[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center}.dropdown-actions[_ngcontent-%COMP%]{position:relative}.dropdown-menu-overlay[_ngcontent-%COMP%]{width:232px;background:#fff;border-radius:12px;box-shadow:0 4px 24px #0000001f;padding:8px 0;z-index:1000}.dropdown-menu-item.disabled[_ngcontent-%COMP%]{color:#aaa;cursor:not-allowed}.dropdown-menu-item[_ngcontent-%COMP%]:hover:not(.disabled), .dropdown-menu-item.has-submenu[_ngcontent-%COMP%]:hover{background:#f5f5f5}.dropdown-menu-item[_ngcontent-%COMP%]{display:flex;align-items:center;padding:10px 18px;cursor:pointer;font-size:14px;position:relative}.dropdown-menu-item[_ngcontent-%COMP%] .dropdown-label[_ngcontent-%COMP%]{flex:1;margin-left:8px}.dropdown-menu-item[_ngcontent-%COMP%] .submenu-arrow[_ngcontent-%COMP%]{margin-left:auto;width:16px;height:16px}.dropdown-submenu[_ngcontent-%COMP%]{position:absolute;top:0;min-width:132px;background:#fff;border-radius:12px;box-shadow:0 4px 24px #0000001f;padding:8px 0;z-index:1001}.dropdown-submenu[_ngcontent-%COMP%]{left:100%;margin-left:4px}.submenu-arrow[_ngcontent-%COMP%]{display:flex;align-items:center;margin-left:auto;z-index:9999}.dropdown-icon[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.dropdown-menu-item.disabled[_ngcontent-%COMP%]{color:#181f33;filter:grayscale(100%) opacity(.3);cursor:not-allowed}.checkbox-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:100%;height:100%}"] }); }
|
|
854
1570
|
}
|
|
855
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(
|
|
1571
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActionsCellComponent, [{
|
|
856
1572
|
type: Component,
|
|
857
|
-
args: [{ selector: "mis-table", template: "<div\n [ngStyle]=\"{\n height: getContainerHeight(),\n width: getContainerWidth(),\n 'overflow-x': config.canScrollHorizontally ? 'auto' : 'unset'\n }\"\n id=\"main-container\"\n>\n <mis-table-filter\n #filter\n (filtersApplied)=\"updateAppliedFilters($event)\"\n *ngIf=\"showFilter\"\n [containerStyles]=\"filterContainerStyles\"\n [filtersData]=\"filterData\"\n ></mis-table-filter>\n <div\n #table\n id=\"table-container\"\n [ngClass]=\"{ 'no-scrollbar': expandedIndex < 0, scrollbar: !(expandedIndex < 0), 'scroll-horizontally': config.canScrollHorizontally }\"\n >\n <div\n [ngStyle]=\"getColHeadersRowStyles()\"\n id=\"col-headers-container\"\n >\n <div\n #colHeaderRef\n (click)=\"colHeader?.action ? colHeader?.action(colHeader) : null\"\n *ngFor=\"let colHeader of config?.colHeaderConfig\"\n class=\"col-header\"\n [ngStyle]=\"{\n width: colHeader?.style?.width || '',\n cursor: colHeader.action ? 'pointer' : 'default',\n 'justify-content': colHeader?.style?.justifyContent\n ? colHeader?.style?.justifyContent\n : colHeader.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p *ngIf=\"colHeader?.type !== 'custom'\" class=\"col-header-text\">\n {{ colHeader?.data || \" \" }}\n </p>\n <span\n (click)=\"filterData = colHeader.filters; toggleFilter(colHeader.data); $event.stopPropagation()\"\n *ngIf=\"colHeader?.type !== 'custom' && colHeader?.filters && colHeader?.filters?.length > 0\"\n class=\"filter-icon\"\n >\n <span *ngIf=\"appliedFilters[colHeader.data]?.length > 0\" id=\"filter-active\"></span>\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 13 10\" width=\"13\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M4.97546 10H7.64213V8H4.97546V10ZM0.308472 0V2H12.3085V0H0.308472ZM2.30847 6H10.3085V4H2.30847V6Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n <ng-template\n *ngIf=\"colHeader?.type === 'custom'\"\n [customComponent]=\"colHeader?.componentRef\"\n [data]=\"colHeader.data\"\n customTableCell\n ></ng-template>\n </div>\n </div>\n <div id=\"data-container\">\n <div class=\"row-wrapper\" *ngFor=\"let row of tableData; let i = index\">\n <div\n class=\"t-row\"\n [ngClass]=\"{ 't-row-hover': config.cellHover, 'active-row': i === activeRowIndex }\"\n [ngStyle]=\"{ 'min-height': config?.rowConfig?.height ? config.rowConfig.height : '44px' }\"\n (click)=\"selectRow(i)\"\n >\n <div\n (click)=\"config?.colConfig[i]?.action ? config?.colConfig[i]?.action(col) : null\"\n *ngFor=\"let col of row; let i = index\"\n [ngStyle]=\"{\n width: config?.colConfig[i]?.style?.width || config?.colHeaderConfig[i]?.style?.width || ''\n }\"\n class=\"t-col-container\"\n [ngClass]=\"{ 't-col-container-hover': config.cellHover }\"\n >\n <div\n class=\"t-col\"\n [style]=\"config.colConfig[i]?.style\"\n [ngStyle]=\"{\n width: '100%',\n cursor: config.colConfig[i]?.action ? 'pointer' : 'default',\n 'justify-content': config.colConfig[i]?.style?.justifyContent\n ? config.colConfig[i]?.style?.justifyContent\n : config.colConfig[i]?.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <p\n *ngIf=\"config.colConfig[i]?.type !== 'custom'\"\n [ngStyle]=\"{\n color: config?.colConfig[i]?.style?.color ? config?.colConfig[i]?.style?.color : ''\n }\"\n class=\"t-col-text\"\n >\n {{ col }}\n </p>\n <ng-template\n *ngIf=\"config.colConfig[i]?.type === 'custom'\"\n [customComponent]=\"config.colConfig[i].componentRef\"\n [data]=\"col\"\n customTableCell\n ></ng-template>\n </div>\n </div>\n </div>\n <div *ngIf=\"config?.canExpand && expandedIndex === i\" class=\"sub-row\">\n <ng-container *ngIf=\"subTableDataLoading\">\n <div [ngStyle]=\"{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n padding: '16px'\n }\">\n Loading...\n </div>\n </ng-container>\n \n <ng-container *ngIf=\"!subTableDataLoading && subTableData.length === 0\">\n <div [ngStyle]=\"{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n padding: '16px'\n }\">\n No Data Available...\n </div>\n </ng-container>\n \n <ng-container *ngIf=\"!subTableDataLoading && subTableData.length > 0\">\n <sub-table [config]=\"subTableconfig\" [tableData]=\"subTableData\"></sub-table>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"config?.paginationConfig && (tableLength >= config.paginationConfig.rowsPerPage || config.paginationConfig?.selectedPage !== 1)\"\n id=\"pagination-container\"\n >\n <p id=\"pagination-text\">\n Showing\n {{ (config.paginationConfig?.selectedPage - 1) * config.paginationConfig.rowsPerPage + 1 }}-{{\n (config.paginationConfig?.selectedPage - 1) * config.paginationConfig.rowsPerPage + tableLength\n }}\n of {{ config.paginationConfig.totalNoOfRows }} items\n </p>\n <div id=\"pages-container\">\n <span (click)=\"updateSelectedPage(config.paginationConfig?.selectedPage - 1)\" class=\"page\">\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 7 10\" width=\"7\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M0.857405 5.56295C0.855794 5.56139 0.854188 5.55982 0.852588 5.55824C0.695955 5.40408 0.617641 5.20203 0.617647 4.99998C0.617641 4.79793 0.695955 4.59588 0.852588 4.44172C0.854188 4.44014 0.855794 4.43858 0.857404 4.43702L5.13066 0.231231C5.44392 -0.0770771 5.9518 -0.0770771 6.26506 0.231231C6.57831 0.53954 6.57831 1.03941 6.26506 1.34772L2.5542 4.99998L6.26506 8.65225C6.57831 8.96055 6.57831 9.46042 6.26506 9.76873C5.9518 10.077 5.44392 10.077 5.13066 9.76873L0.857405 5.56295Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n <div *ngFor=\"let pageNumber of pages\">\n <span\n (click)=\"updateSelectedPage(pageNumber)\"\n *ngIf=\"pageNumber != 0\"\n [ngClass]=\"{ 'page-active': pageNumber == config.paginationConfig?.selectedPage }\"\n class=\"page\"\n >{{ pageNumber }}</span\n >\n <span *ngIf=\"pageNumber == 0\" class=\"page-seperator\">\n <div [ngStyle]=\"{ display: 'flex' }\">\n <span class=\"dot\" [ngStyle]=\"{ 'margin-right': '4px' }\"></span>\n <span class=\"dot\" [ngStyle]=\"{ 'margin-right': '4px' }\"></span>\n <span class=\"dot\"></span>\n </div> \n </span>\n </div>\n <span (click)=\"updateSelectedPage(config.paginationConfig?.selectedPage + 1)\" class=\"page\">\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 7 10\" width=\"7\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n clip-rule=\"evenodd\"\n d=\"M6.1426 5.56295C6.14421 5.56139 6.14581 5.55982 6.14741 5.55824C6.30405 5.40408 6.38236 5.20203 6.38236 4.99998C6.38236 4.79793 6.30405 4.59588 6.14741 4.44172C6.14581 4.44014 6.14421 4.43858 6.1426 4.43702L1.86934 0.231231C1.55608 -0.0770771 1.0482 -0.0770771 0.734942 0.231231C0.421688 0.53954 0.421688 1.03941 0.734942 1.34772L4.4458 4.99998L0.734941 8.65225C0.421686 8.96055 0.421686 9.46042 0.734941 9.76873C1.0482 10.077 1.55608 10.077 1.86934 9.76873L6.1426 5.56295Z\"\n fill=\"#181F33\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </span>\n </div>\n </div>\n</div>\n", styles: ["#main-container{font-family:Lato,sans-serif;position:relative}.no-scrollbar::-webkit-scrollbar{width:0}.scrollbar::-webkit-scrollbar{width:8px;height:8px;border-radius:15px}.scrollbar::-webkit-scrollbar-thumb{background:#9aa7b4;border-radius:15px}#table-container{height:inherit;overflow-y:auto}.scroll-horizontally{height:inherit;width:fit-content;overflow-y:unset!important;overflow-x:visible}#col-headers-container{display:flex;align-items:center;position:sticky;background-color:#fff;width:100%;z-index:1;min-height:44px;border-bottom:1px solid #e0e0e0;top:0;left:0;right:0}.col-header{padding:0 16px;display:flex;align-items:center;height:100%}.col-header-text{font-style:normal;font-weight:700;line-height:20px;display:flex;align-items:center;letter-spacing:.2px;margin:0}.filter-icon{margin-left:8px;padding:0 8px;position:relative;cursor:pointer}#filter-active{height:8px;width:8px;background:#16cbbc;border-radius:50%;position:absolute;top:4px;right:4px}.sub-row{height:auto;border-bottom:none}.loader ::ng-deep .mat-progress-spinner circle,.mat-spinner circle{stroke:#0937b2}.t-row{display:flex;min-height:44px;background-color:#fff;width:100%;border-bottom:1px solid #e0e0e0}.t-row:hover{background-color:#e7eefd}.active-row{background-color:#e6f6fd}.t-col-container{padding:0 16px}.t-row-hover:hover{background-color:#0000}.t-col-container-hover:hover{background-color:#e6ebf7}.t-col-container-hover:first-child{border-left:1px solid #e0e0e0}.t-col-container-hover{border-right:1px solid #e0e0e0}.t-col{display:flex;align-items:center;height:100%}.t-col-text{font-style:normal;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;letter-spacing:.2px;margin:0}#pagination-container{display:flex;justify-content:flex-end;align-items:center;height:56px}#pagination-text{font-style:normal;font-weight:400;font-size:12px;line-height:18px;letter-spacing:.4px;color:#6a737d;margin:0 96px 0 0}#pages-container{display:flex;margin-right:32px}.page{display:flex;justify-content:center;align-items:center;border:1px solid #6a737d;box-sizing:border-box;border-radius:4px;width:32px;height:32px;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d;margin-right:8px;cursor:pointer}.page-seperator{display:flex;justify-content:center;align-items:center;width:32px;height:32px;margin-right:8px}.dot{height:3px;width:3px;border-radius:50%;background:#6a737d}.page-active{color:#0937b2;border:1px solid #0937b2}\n"] }]
|
|
858
|
-
}], () => [{ type: i0.
|
|
859
|
-
type: Output
|
|
860
|
-
}], filter: [{
|
|
861
|
-
type: ViewChild,
|
|
862
|
-
args: ["filter"]
|
|
863
|
-
}], colHeaders: [{
|
|
864
|
-
type: ViewChildren,
|
|
865
|
-
args: ["colHeaderRef"]
|
|
866
|
-
}], pageSelected: [{
|
|
867
|
-
type: Output
|
|
868
|
-
}], config: [{
|
|
869
|
-
type: Input,
|
|
870
|
-
args: ["tableConfig"]
|
|
871
|
-
}], subTableconfig: [{
|
|
872
|
-
type: Input
|
|
873
|
-
}], tableDataLoading: [{
|
|
874
|
-
type: Input
|
|
875
|
-
}], expandedIndex: [{
|
|
876
|
-
type: Input
|
|
877
|
-
}], tableData: [{
|
|
878
|
-
type: Input
|
|
879
|
-
}], subTableData: [{
|
|
1573
|
+
args: [{ selector: "mis-actions-cell", template: "<div class=\"actions-cell-container\" [ngStyle]=\"containerStyle\">\n <!-- Inline Actions -->\n <div *ngIf=\"actionType === 'inline'\" class=\"inline-actions\">\n <div\n *ngFor=\"let item of actionItems; trackBy: trackByAction\"\n class=\"action-item\"\n [ngClass]=\"{ disabled: isDisabled(item) }\"\n (click)=\"onActionClick(item, $event)\"\n >\n <img [src]=\"item.icon\" [alt]=\"item.label\" class=\"action-icon-svg\" />\n </div>\n </div>\n\n <!-- Dropdown Actions -->\n <div *ngIf=\"actionType === 'dropdown'\" class=\"dropdown-actions\">\n <div #dropdownTrigger class=\"dropdown-trigger\" (click)=\"toggleDropdown($event)\" title=\"More actions\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <circle cx=\"10\" cy=\"4\" r=\"2\" fill=\"#333\" />\n <circle cx=\"10\" cy=\"10\" r=\"2\" fill=\"#333\" />\n <circle cx=\"10\" cy=\"16\" r=\"2\" fill=\"#333\" />\n </svg>\n </div>\n </div>\n\n <!-- Checkbox Actions -->\n <div *ngIf=\"actionType === 'checkbox'\" class=\"checkbox-actions\">\n <mis-checkbox [checked]=\"currentState\" (valueChange)=\"onClick($event)\" [disabled]=\"disable ? disable(currentState) : false\"> </mis-checkbox>\n </div>\n</div>\n\n<!-- Collapse / Expand Actions -->\n<div *ngIf=\"actionType === 'row-collapse'\" class=\"collapse-toggle-action\">\n <div class=\"collapse-icon\" (click)=\"onClick($event)\" [title]=\"currentState ? 'Expand' : 'Collapse'\">\n <svg *ngIf=\"currentState\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\">\n <path d=\"M7 10l5 5 5-5\" stroke=\"#0D1321\" stroke-width=\"2\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n <svg *ngIf=\"!currentState\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\">\n <path d=\"M7 14l5-5 5 5\" stroke=\"#0D1321\" stroke-width=\"2\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n </div>\n</div>\n\n<!-- CDK Overlay Template for Dropdown Menu -->\n<ng-template #dropdownMenu>\n <div class=\"dropdown-menu-overlay\">\n <div\n class=\"dropdown-menu-item\"\n *ngFor=\"let item of actionItems\"\n (click)=\"onDropdownItemClick(item, $event)\"\n [ngClass]=\"{ disabled: isDisabled(item) }\"\n >\n <ng-container *ngIf=\"item.children?.length; else noChildren\">\n <span class=\"dropdown-icon\" *ngIf=\"item.icon\">\n <img [src]=\"item.icon\" />\n </span>\n <span class=\"dropdown-label\">{{ item.label }}</span>\n <span class=\"submenu-arrow\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M9 6L15 12L9 18\" stroke=\"#0D1321\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n </span>\n\n <!-- DYNAMIC SUBMENU -->\n <div class=\"dropdown-submenu\" *ngIf=\"item.showSubmenu\">\n <div\n class=\"dropdown-menu-item\"\n *ngFor=\"let child of item.children\"\n [ngClass]=\"{ disabled: isDisabled(child) }\"\n (click)=\"onDropdownItemClick(child, $event)\"\n >\n <span class=\"dropdown-icon\" *ngIf=\"child.icon\">\n <img [src]=\"child.icon\" />\n </span>\n <span class=\"dropdown-label\">{{ child.label }}</span>\n </div>\n </div>\n </ng-container>\n\n <ng-template #noChildren>\n <span class=\"dropdown-icon\" *ngIf=\"item.icon\">\n <img [src]=\"item.icon\" />\n </span>\n <span class=\"dropdown-label\">{{ item.label }}</span>\n </ng-template>\n </div>\n </div>\n</ng-template>\n", styles: [".actions-cell-container{display:flex;align-items:center;justify-content:center;width:100%;height:100%;position:relative;box-sizing:border-box}.inline-actions{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;flex-wrap:nowrap;padding:4px 0;flex-direction:row}.action-item{display:flex;align-items:center;justify-content:center;height:20px;border-radius:4px;cursor:pointer;transition:all .2s ease;background-color:transparent;border:none;outline:none;flex-shrink:0;min-height:20px}.action-item:hover:not(.disabled){background-color:#0000000a;transform:scale(1.05)}.action-item:active:not(.disabled){transform:scale(.95)}.action-item.disabled{opacity:.5;cursor:not-allowed}.action-item.disabled:hover{background-color:transparent;transform:none}.action-icon{font-size:16px;color:#666;display:flex;align-items:center;justify-content:center;width:100%;height:100%}.action-icon-svg{width:18px;height:18px;object-fit:contain;filter:brightness(0) saturate(100%) invert(40%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(.6) contrast(1);flex-shrink:0}.action-icon-svg:hover{filter:brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0) contrast(1)}.dropdown-trigger{cursor:pointer;display:flex;align-items:center;justify-content:center}.dropdown-actions{position:relative}.dropdown-menu-overlay{width:232px;background:#fff;border-radius:12px;box-shadow:0 4px 24px #0000001f;padding:8px 0;z-index:1000}.dropdown-menu-item.disabled{color:#aaa;cursor:not-allowed}.dropdown-menu-item:hover:not(.disabled),.dropdown-menu-item.has-submenu:hover{background:#f5f5f5}.dropdown-menu-item{display:flex;align-items:center;padding:10px 18px;cursor:pointer;font-size:14px;position:relative}.dropdown-menu-item .dropdown-label{flex:1;margin-left:8px}.dropdown-menu-item .submenu-arrow{margin-left:auto;width:16px;height:16px}.dropdown-submenu{position:absolute;top:0;min-width:132px;background:#fff;border-radius:12px;box-shadow:0 4px 24px #0000001f;padding:8px 0;z-index:1001}.dropdown-submenu{left:100%;margin-left:4px}.submenu-arrow{display:flex;align-items:center;margin-left:auto;z-index:9999}.dropdown-icon{display:flex;justify-content:center;align-items:center}.dropdown-menu-item.disabled{color:#181f33;filter:grayscale(100%) opacity(.3);cursor:not-allowed}.checkbox-actions{display:flex;align-items:center;justify-content:center;width:100%;height:100%}\n"] }]
|
|
1574
|
+
}], () => [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }], { cellData: [{
|
|
880
1575
|
type: Input
|
|
881
|
-
}],
|
|
1576
|
+
}], config: [{
|
|
882
1577
|
type: Input
|
|
883
|
-
}],
|
|
1578
|
+
}], actionClick: [{
|
|
1579
|
+
type: Output
|
|
1580
|
+
}], dropdownMenu: [{
|
|
884
1581
|
type: ViewChild,
|
|
885
|
-
args: [
|
|
1582
|
+
args: ['dropdownMenu', { static: false }]
|
|
1583
|
+
}], dropdownTrigger: [{
|
|
1584
|
+
type: ViewChild,
|
|
1585
|
+
args: ['dropdownTrigger', { static: false }]
|
|
1586
|
+
}], onDocumentClick: [{
|
|
1587
|
+
type: HostListener,
|
|
1588
|
+
args: ["document:click"]
|
|
886
1589
|
}] }); })();
|
|
887
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(
|
|
1590
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ActionsCellComponent, { className: "ActionsCellComponent" }); })();
|
|
888
1591
|
|
|
889
1592
|
class TableModule {
|
|
890
1593
|
static forRoot() {
|
|
@@ -892,21 +1595,50 @@ class TableModule {
|
|
|
892
1595
|
}
|
|
893
1596
|
static { this.ɵfac = function TableModule_Factory(t) { return new (t || TableModule)(); }; }
|
|
894
1597
|
static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: TableModule }); }
|
|
895
|
-
static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule, CheckboxModule, ScrollingModule] }); }
|
|
1598
|
+
static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule, CheckboxModule, ScrollingModule, OverlayModule, PortalModule] }); }
|
|
896
1599
|
}
|
|
897
1600
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableModule, [{
|
|
898
1601
|
type: NgModule,
|
|
899
1602
|
args: [{
|
|
900
|
-
declarations: [
|
|
901
|
-
|
|
902
|
-
|
|
1603
|
+
declarations: [
|
|
1604
|
+
TableComponent,
|
|
1605
|
+
SubTableComponent,
|
|
1606
|
+
TableFilterComponent,
|
|
1607
|
+
CustomTableCellDirective,
|
|
1608
|
+
SortIconsDirective,
|
|
1609
|
+
ActionsCellComponent
|
|
1610
|
+
],
|
|
1611
|
+
imports: [CommonModule, CheckboxModule, ScrollingModule, OverlayModule, PortalModule],
|
|
1612
|
+
exports: [
|
|
1613
|
+
TableComponent,
|
|
1614
|
+
SubTableComponent,
|
|
1615
|
+
TableFilterComponent,
|
|
1616
|
+
CustomTableCellDirective,
|
|
1617
|
+
SortIconsDirective,
|
|
1618
|
+
ActionsCellComponent
|
|
1619
|
+
]
|
|
903
1620
|
}]
|
|
904
1621
|
}], null, null); })();
|
|
905
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(TableModule, { declarations: [TableComponent,
|
|
1622
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(TableModule, { declarations: [TableComponent,
|
|
1623
|
+
SubTableComponent,
|
|
1624
|
+
TableFilterComponent,
|
|
1625
|
+
CustomTableCellDirective,
|
|
1626
|
+
SortIconsDirective,
|
|
1627
|
+
ActionsCellComponent], imports: [CommonModule, CheckboxModule, ScrollingModule, OverlayModule, PortalModule], exports: [TableComponent,
|
|
1628
|
+
SubTableComponent,
|
|
1629
|
+
TableFilterComponent,
|
|
1630
|
+
CustomTableCellDirective,
|
|
1631
|
+
SortIconsDirective,
|
|
1632
|
+
ActionsCellComponent] }); })();
|
|
1633
|
+
i0.ɵɵsetComponentScope(TableComponent, [i1.NgClass, i1.NgForOf, i1.NgIf, i1.NgStyle, i2$1.CheckboxComponent, SubTableComponent,
|
|
1634
|
+
TableFilterComponent,
|
|
1635
|
+
CustomTableCellDirective,
|
|
1636
|
+
SortIconsDirective,
|
|
1637
|
+
ActionsCellComponent], []);
|
|
906
1638
|
|
|
907
1639
|
/**
|
|
908
1640
|
* Generated bundle index. Do not edit.
|
|
909
1641
|
*/
|
|
910
1642
|
|
|
911
|
-
export { CustomTableCellDirective, SubTableComponent, TableComponent, TableFilterComponent, TableModule };
|
|
1643
|
+
export { ActionsCellComponent, CustomTableCellDirective, SortIconsDirective, SubTableComponent, TableComponent, TableFilterComponent, TableModule };
|
|
912
1644
|
//# sourceMappingURL=mis-crystal-design-system-table.mjs.map
|