mis-crystal-design-system 18.0.25 → 18.1.0-signal-test
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/action-list/action-list.component.d.ts +17 -15
- package/async-search-dropdown/async-dropdown.component.d.ts +43 -61
- package/button/button.component.d.ts +35 -13
- package/button/button.directive.d.ts +10 -8
- package/button/button.directive.scss +13 -15
- package/checkbox/checkbox.component.d.ts +15 -12
- package/chip/chip.component.d.ts +9 -11
- package/datepicker_v2/models/dp-config.model.d.ts +1 -0
- package/datepicker_v2/tz-datepicker.directive.d.ts +15 -18
- package/datepicker_v2/tz-dp-container/tz-dp-container.component.d.ts +42 -21
- package/daterangepicker_v2/tz-daterangepicker.directive.d.ts +12 -14
- package/daterangepicker_v2/tz-drp-container/tz-drp-container.component.d.ts +46 -23
- package/drawer/drawer-body/drawer-body.component.d.ts +2 -2
- package/drawer/drawer.scss +1 -1
- package/dropdown/calculate-container-height.directive.d.ts +7 -8
- package/dropdown/dropdown.component.d.ts +41 -49
- package/dynamic-form/dynamic-form.component.d.ts +20 -16
- package/esm2022/action-list/action-list.component.mjs +113 -90
- package/esm2022/async-search-dropdown/async-dropdown.component.mjs +257 -327
- package/esm2022/button/button.component.mjs +56 -49
- package/esm2022/button/button.directive.mjs +36 -40
- package/esm2022/checkbox/checkbox.component.mjs +75 -70
- package/esm2022/chip/chip.component.mjs +20 -33
- package/esm2022/datepicker_v2/models/dp-config.model.mjs +1 -1
- package/esm2022/datepicker_v2/tz-datepicker.directive.mjs +42 -71
- package/esm2022/datepicker_v2/tz-dp-container/tz-dp-container.component.mjs +203 -173
- package/esm2022/datepicker_v2/utils/index.mjs +2 -1
- package/esm2022/daterangepicker_v2/tz-daterangepicker.directive.mjs +26 -51
- package/esm2022/daterangepicker_v2/tz-drp-container/tz-drp-container.component.mjs +283 -236
- package/esm2022/drawer/drawer-body/drawer-body.component.mjs +8 -7
- package/esm2022/dropdown/calculate-container-height.directive.mjs +25 -22
- package/esm2022/dropdown/dropdown.component.mjs +163 -187
- package/esm2022/dynamic-form/dynamic-form.component.mjs +119 -73
- package/esm2022/fab/fab.component.mjs +30 -34
- package/esm2022/filter/filter-panel/filter-panel.component.mjs +61 -59
- package/esm2022/input/directives/input/input.directive.mjs +22 -26
- package/esm2022/input/mis-input.component.mjs +42 -46
- package/esm2022/input-stepper/input-stepper/input-stepper.component.mjs +42 -52
- package/esm2022/loader/loader.component.mjs +8 -11
- package/esm2022/mobile-filter/mobile-filter.component.mjs +62 -62
- package/esm2022/modal/module-wrapper/module-wrapper.component.mjs +11 -9
- package/esm2022/multi-select-dropdown/multi-select-dropdown.component.mjs +235 -281
- package/esm2022/nested-multi-select-dropdown/nested-multi-select-dropdown.component.mjs +250 -287
- package/esm2022/phone-input/phone-input.component.mjs +21 -43
- package/esm2022/public-api.mjs +1 -1
- package/esm2022/radio-button/radio-button.component.mjs +15 -27
- package/esm2022/ske-loader/ske-loader.component.mjs +15 -29
- package/esm2022/slider/slider.component.mjs +23 -33
- package/esm2022/slider/slider.module.mjs +4 -11
- package/esm2022/snackbar/snackbar/snackbar.component.mjs +21 -15
- package/esm2022/snackbar/snackbar.service.mjs +3 -2
- package/esm2022/specificdatepicker/tz-sdp-container/tz-sdp-container.component.mjs +231 -344
- package/esm2022/specificdatepicker/tz-specificdatepicker.directive.mjs +77 -105
- package/esm2022/star-rating/star-rating.component.mjs +58 -72
- package/esm2022/switch/switch.component.mjs +34 -36
- package/esm2022/table/actions-cell/actions-cell.component.mjs +56 -55
- package/esm2022/table/custom-table-cell.directive.mjs +22 -18
- package/esm2022/table/filter/filter.component.mjs +60 -42
- package/esm2022/table/sort-icons.directive.mjs +16 -8
- package/esm2022/table/sub-table/sub-table.component.mjs +42 -45
- package/esm2022/table/table.component.mjs +182 -166
- package/esm2022/timepicker/timepicker.component.mjs +245 -160
- package/esm2022/timepicker/timepicker.directive.mjs +3 -2
- package/esm2022/timerangepicker/timerangepicker.component.mjs +200 -159
- package/esm2022/toast/toast.component.mjs +7 -8
- package/esm2022/toast/toast.data.service.mjs +15 -9
- package/esm2022/tooltip/tooltip-container/tooltip.component.mjs +12 -12
- package/esm2022/tooltip/tooltip.directive.mjs +4 -4
- package/esm2022/virtual-scroll/virtual-scroll.component.mjs +57 -59
- package/fab/fab.component.d.ts +12 -8
- package/fesm2022/mis-crystal-design-system-action-list.mjs +112 -89
- package/fesm2022/mis-crystal-design-system-action-list.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-async-search-dropdown.mjs +254 -325
- package/fesm2022/mis-crystal-design-system-async-search-dropdown.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-button.mjs +89 -86
- package/fesm2022/mis-crystal-design-system-button.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-checkbox.mjs +74 -69
- package/fesm2022/mis-crystal-design-system-checkbox.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-chip.mjs +19 -32
- package/fesm2022/mis-crystal-design-system-chip.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-datepicker_v2.mjs +243 -241
- package/fesm2022/mis-crystal-design-system-datepicker_v2.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-daterangepicker_v2.mjs +306 -284
- package/fesm2022/mis-crystal-design-system-daterangepicker_v2.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-drawer.mjs +7 -6
- package/fesm2022/mis-crystal-design-system-drawer.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-dropdown.mjs +184 -205
- package/fesm2022/mis-crystal-design-system-dropdown.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-dynamic-form.mjs +119 -73
- package/fesm2022/mis-crystal-design-system-dynamic-form.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-fab.mjs +29 -33
- package/fesm2022/mis-crystal-design-system-fab.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-filter.mjs +60 -58
- package/fesm2022/mis-crystal-design-system-filter.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-input-stepper.mjs +41 -51
- package/fesm2022/mis-crystal-design-system-input-stepper.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-input.mjs +62 -71
- package/fesm2022/mis-crystal-design-system-input.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-loader.mjs +7 -10
- package/fesm2022/mis-crystal-design-system-loader.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-mobile-filter.mjs +61 -61
- package/fesm2022/mis-crystal-design-system-mobile-filter.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-modal.mjs +10 -8
- package/fesm2022/mis-crystal-design-system-modal.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-multi-select-dropdown.mjs +233 -279
- package/fesm2022/mis-crystal-design-system-multi-select-dropdown.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-nested-multi-select-dropdown.mjs +249 -286
- package/fesm2022/mis-crystal-design-system-nested-multi-select-dropdown.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-phone-input.mjs +20 -42
- package/fesm2022/mis-crystal-design-system-phone-input.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-radio-button.mjs +14 -26
- package/fesm2022/mis-crystal-design-system-radio-button.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-ske-loader.mjs +14 -28
- package/fesm2022/mis-crystal-design-system-ske-loader.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-slider.mjs +25 -42
- package/fesm2022/mis-crystal-design-system-slider.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-snackbar.mjs +22 -15
- package/fesm2022/mis-crystal-design-system-snackbar.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-specificdatepicker.mjs +305 -446
- package/fesm2022/mis-crystal-design-system-specificdatepicker.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-star-rating.mjs +57 -71
- package/fesm2022/mis-crystal-design-system-star-rating.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-switch.mjs +33 -35
- package/fesm2022/mis-crystal-design-system-switch.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-table.mjs +368 -324
- package/fesm2022/mis-crystal-design-system-table.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-timepicker.mjs +246 -160
- package/fesm2022/mis-crystal-design-system-timepicker.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-timerangepicker.mjs +199 -158
- package/fesm2022/mis-crystal-design-system-timerangepicker.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-toast.mjs +19 -14
- package/fesm2022/mis-crystal-design-system-toast.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-tooltip.mjs +14 -14
- package/fesm2022/mis-crystal-design-system-tooltip.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system-virtual-scroll.mjs +57 -59
- package/fesm2022/mis-crystal-design-system-virtual-scroll.mjs.map +1 -1
- package/fesm2022/mis-crystal-design-system.mjs.map +1 -1
- package/filter/filter-panel/filter-panel.component.d.ts +14 -14
- package/input/directives/input/input.directive.d.ts +6 -10
- package/input/mis-input.component.d.ts +12 -13
- package/input/mis-input.component.scss +18 -18
- package/input-stepper/input-stepper/input-stepper.component.d.ts +8 -7
- package/loader/loader.component.d.ts +3 -6
- package/mobile-filter/mobile-filter.component.d.ts +15 -15
- package/modal/modal.scss +1 -1
- package/modal/module-wrapper/module-wrapper.component.d.ts +2 -3
- package/multi-select-dropdown/multi-select-dropdown.component.d.ts +89 -51
- package/nested-multi-select-dropdown/nested-multi-select-dropdown.component.d.ts +99 -56
- package/package.json +17 -23
- package/phone-input/phone-input.component.d.ts +16 -18
- package/radio-button/radio-button.component.d.ts +9 -11
- package/ske-loader/ske-loader.component.d.ts +8 -11
- package/slider/slider.component.d.ts +8 -11
- package/slider/slider.module.d.ts +1 -2
- package/snackbar/snackbar/snackbar.component.d.ts +3 -3
- package/specificdatepicker/tz-sdp-container/tz-sdp-container.component.d.ts +35 -35
- package/specificdatepicker/tz-specificdatepicker.directive.d.ts +24 -28
- package/star-rating/star-rating.component.d.ts +18 -18
- package/styles/mis-color-constants.scss +0 -204
- package/styles/mis-icons.scss +56 -56
- package/styles/mis-old-icon-styles.scss +21 -21
- package/switch/switch.component.d.ts +8 -10
- package/table/actions-cell/actions-cell.component.d.ts +14 -14
- package/table/custom-table-cell.directive.d.ts +3 -3
- package/table/filter/filter.component.d.ts +9 -9
- package/table/sub-table/sub-table.component.d.ts +5 -5
- package/table/table.component.d.ts +38 -35
- package/timepicker/timepicker.component.d.ts +29 -28
- package/timerangepicker/timerangepicker.component.d.ts +36 -33
- package/toast/toast.data.service.d.ts +1 -1
- package/tooltip/tooltip-container/tooltip.component.d.ts +4 -4
- package/virtual-scroll/virtual-scroll.component.d.ts +8 -9
- package/dynamic-theme/branding.types.d.ts +0 -84
- package/dynamic-theme/dynamic-theme.module.d.ts +0 -9
- package/dynamic-theme/dynamic-theme.service.d.ts +0 -89
- package/dynamic-theme/index.d.ts +0 -1
- package/dynamic-theme/public_api.d.ts +0 -3
- package/esm2022/dynamic-theme/branding.types.mjs +0 -93
- package/esm2022/dynamic-theme/dynamic-theme.module.mjs +0 -25
- package/esm2022/dynamic-theme/dynamic-theme.service.mjs +0 -193
- package/esm2022/dynamic-theme/index.mjs +0 -2
- package/esm2022/dynamic-theme/mis-crystal-design-system-dynamic-theme.mjs +0 -5
- package/esm2022/dynamic-theme/public_api.mjs +0 -4
- package/fesm2022/mis-crystal-design-system-dynamic-theme.mjs +0 -313
- package/fesm2022/mis-crystal-design-system-dynamic-theme.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { signal, output, input, Component, ViewChild, ViewChildren, effect, Directive, 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';
|
|
@@ -35,7 +35,7 @@ function TableComponent_mis_table_filter_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
35
35
|
i0.ɵɵelementEnd();
|
|
36
36
|
} if (rf & 2) {
|
|
37
37
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
38
|
-
i0.ɵɵproperty("containerStyles", ctx_r1.filterContainerStyles)("filtersData", ctx_r1.filterData);
|
|
38
|
+
i0.ɵɵproperty("containerStyles", ctx_r1.filterContainerStyles())("filtersData", ctx_r1.filterData());
|
|
39
39
|
} }
|
|
40
40
|
function TableComponent_div_5_p_2_Template(rf, ctx) { if (rf & 1) {
|
|
41
41
|
i0.ɵɵelementStart(0, "p", 19);
|
|
@@ -52,7 +52,7 @@ function TableComponent_div_5_span_3_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
52
52
|
function TableComponent_div_5_span_3_Template(rf, ctx) { if (rf & 1) {
|
|
53
53
|
const _r5 = i0.ɵɵgetCurrentView();
|
|
54
54
|
i0.ɵɵelementStart(0, "span", 20);
|
|
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
|
|
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.set(colHeader_r4.filters); ctx_r1.toggleFilter(colHeader_r4.data); return i0.ɵɵresetView($event.stopPropagation()); });
|
|
56
56
|
i0.ɵɵtemplate(1, TableComponent_div_5_span_3_span_1_Template, 1, 0, "span", 21);
|
|
57
57
|
i0.ɵɵnamespaceSVG();
|
|
58
58
|
i0.ɵɵelementStart(2, "svg", 22);
|
|
@@ -73,7 +73,7 @@ function TableComponent_div_5_span_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
73
73
|
} if (rf & 2) {
|
|
74
74
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
75
75
|
i0.ɵɵadvance();
|
|
76
|
-
i0.ɵɵproperty("checked", ctx_r1.selectAllCheckbox);
|
|
76
|
+
i0.ɵɵproperty("checked", ctx_r1.selectAllCheckbox());
|
|
77
77
|
} }
|
|
78
78
|
function TableComponent_div_5_span_5_Template(rf, ctx) { if (rf & 1) {
|
|
79
79
|
const _r7 = i0.ɵɵgetCurrentView();
|
|
@@ -83,7 +83,7 @@ function TableComponent_div_5_span_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
83
83
|
} if (rf & 2) {
|
|
84
84
|
const colHeader_r4 = i0.ɵɵnextContext().$implicit;
|
|
85
85
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
86
|
-
i0.ɵɵproperty("column", colHeader_r4)("activeSort", ctx_r1.currentSort)("activeSorts", ctx_r1.multiColumnSort)("multiColumnSort", ctx_r1.
|
|
86
|
+
i0.ɵɵproperty("column", colHeader_r4)("activeSort", ctx_r1.currentSort())("activeSorts", ctx_r1.multiColumnSort())("multiColumnSort", ctx_r1.tableConfig().multiColumnSort);
|
|
87
87
|
} }
|
|
88
88
|
function TableComponent_div_5_6_ng_template_0_Template(rf, ctx) { }
|
|
89
89
|
function TableComponent_div_5_6_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -135,13 +135,15 @@ function TableComponent_div_7_div_2_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
135
135
|
i0.ɵɵtemplate(1, TableComponent_div_7_div_2_div_2_ng_container_1_Template, 2, 1, "ng-container", 38)(2, TableComponent_div_7_div_2_div_2_ng_template_2_Template, 2, 1, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor);
|
|
136
136
|
i0.ɵɵelementEnd();
|
|
137
137
|
} if (rf & 2) {
|
|
138
|
+
let tmp_10_0;
|
|
139
|
+
let tmp_12_0;
|
|
138
140
|
const plainText_r14 = i0.ɵɵreference(3);
|
|
139
141
|
const i_r13 = i0.ɵɵnextContext().index;
|
|
140
142
|
const rowIndex_r15 = i0.ɵɵnextContext().index;
|
|
141
143
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
142
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction2(4, _c11, (ctx_r1.
|
|
144
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction2(4, _c11, ((tmp_10_0 = ctx_r1.tableConfig()) == null ? null : tmp_10_0.colConfig[i_r13] == null ? null : tmp_10_0.colConfig[i_r13].style == null ? null : tmp_10_0.colConfig[i_r13].style.color) || "", ctx_r1.previewLines || 3))("ngClass", i0.ɵɵpureFunction1(7, _c12, ctx_r1.collapseColIndex == i_r13 && ctx_r1.expandedMap[rowIndex_r15]));
|
|
143
145
|
i0.ɵɵadvance();
|
|
144
|
-
i0.ɵɵproperty("ngIf", (ctx_r1.
|
|
146
|
+
i0.ɵɵproperty("ngIf", ((tmp_12_0 = ctx_r1.tableConfig().colConfig[i_r13]) == null ? null : tmp_12_0.type) === "html")("ngIfElse", plainText_r14);
|
|
145
147
|
} }
|
|
146
148
|
function TableComponent_div_7_div_2_3_ng_template_0_Template(rf, ctx) { }
|
|
147
149
|
function TableComponent_div_7_div_2_3_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -151,7 +153,7 @@ function TableComponent_div_7_div_2_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
151
153
|
const col_r12 = ctx_r15.$implicit;
|
|
152
154
|
const i_r13 = ctx_r15.index;
|
|
153
155
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
154
|
-
i0.ɵɵproperty("customComponent", ctx_r1.
|
|
156
|
+
i0.ɵɵproperty("customComponent", ctx_r1.tableConfig().colConfig[i_r13].componentRef)("data", col_r12);
|
|
155
157
|
} }
|
|
156
158
|
function TableComponent_div_7_div_2_mis_actions_cell_4_Template(rf, ctx) { if (rf & 1) {
|
|
157
159
|
const _r17 = i0.ɵɵgetCurrentView();
|
|
@@ -159,33 +161,40 @@ function TableComponent_div_7_div_2_mis_actions_cell_4_Template(rf, ctx) { if (r
|
|
|
159
161
|
i0.ɵɵlistener("actionClick", function TableComponent_div_7_div_2_mis_actions_cell_4_Template_mis_actions_cell_actionClick_0_listener($event) { i0.ɵɵrestoreView(_r17); const rowIndex_r15 = i0.ɵɵnextContext(2).index; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onActionClick($event, rowIndex_r15)); });
|
|
160
162
|
i0.ɵɵelementEnd();
|
|
161
163
|
} if (rf & 2) {
|
|
164
|
+
let tmp_11_0;
|
|
162
165
|
const ctx_r15 = i0.ɵɵnextContext();
|
|
163
166
|
const col_r12 = ctx_r15.$implicit;
|
|
164
167
|
const i_r13 = ctx_r15.index;
|
|
165
168
|
const row_r18 = i0.ɵɵnextContext().$implicit;
|
|
166
169
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
167
|
-
i0.ɵɵproperty("cellData", col_r12)("config", ctx_r1.
|
|
170
|
+
i0.ɵɵproperty("cellData", col_r12)("config", ctx_r1.tableConfig().colConfig[i_r13])("ngClass", i0.ɵɵpureFunction1(3, _c13, (((tmp_11_0 = ctx_r1.tableConfig().colConfig[i_r13]) == null ? null : tmp_11_0.actionType) === "checkbox" || ((tmp_11_0 = ctx_r1.tableConfig().colConfig[i_r13]) == null ? null : tmp_11_0.actionType) === "row-collapse") && ctx_r1.isRowDisabled(row_r18)));
|
|
168
171
|
} }
|
|
169
172
|
function TableComponent_div_7_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
170
173
|
const _r10 = i0.ɵɵgetCurrentView();
|
|
171
174
|
i0.ɵɵelementStart(0, "div", 33);
|
|
172
|
-
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.
|
|
175
|
+
i0.ɵɵlistener("click", function TableComponent_div_7_div_2_Template_div_click_0_listener() { let tmp_9_0; 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(((tmp_9_0 = ctx_r1.tableConfig()) == null ? null : tmp_9_0.colConfig[i_r13] == null ? null : tmp_9_0.colConfig[i_r13].action) && ((tmp_9_0 = ctx_r1.tableConfig()) == null ? null : tmp_9_0.colConfig[i_r13] == null ? null : tmp_9_0.colConfig[i_r13].actionType) !== "checkbox" ? (tmp_9_0 = ctx_r1.tableConfig()) == null ? null : tmp_9_0.colConfig[i_r13] == null ? null : tmp_9_0.colConfig[i_r13].action(col_r12) : null); });
|
|
173
176
|
i0.ɵɵelementStart(1, "div", 34);
|
|
174
177
|
i0.ɵɵtemplate(2, TableComponent_div_7_div_2_div_2_Template, 4, 9, "div", 35)(3, TableComponent_div_7_div_2_3_Template, 1, 2, null, 18)(4, TableComponent_div_7_div_2_mis_actions_cell_4_Template, 1, 5, "mis-actions-cell", 36);
|
|
175
178
|
i0.ɵɵelementEnd()();
|
|
176
179
|
} if (rf & 2) {
|
|
180
|
+
let tmp_8_0;
|
|
181
|
+
let tmp_10_0;
|
|
182
|
+
let tmp_11_0;
|
|
183
|
+
let tmp_12_0;
|
|
184
|
+
let tmp_13_0;
|
|
185
|
+
let tmp_14_0;
|
|
177
186
|
const i_r13 = ctx.index;
|
|
178
187
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
179
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(8, _c8, (ctx_r1.
|
|
188
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(8, _c8, ((tmp_8_0 = ctx_r1.tableConfig()) == null ? null : tmp_8_0.colConfig[i_r13] == null ? null : tmp_8_0.colConfig[i_r13].style == null ? null : tmp_8_0.colConfig[i_r13].style.width) || ((tmp_8_0 = ctx_r1.tableConfig()) == null ? null : tmp_8_0.colHeaderConfig[i_r13] == null ? null : tmp_8_0.colHeaderConfig[i_r13].style == null ? null : tmp_8_0.colHeaderConfig[i_r13].style.width) || ""))("ngClass", i0.ɵɵpureFunction1(10, _c9, ctx_r1.tableConfig().cellHover));
|
|
180
189
|
i0.ɵɵadvance();
|
|
181
|
-
i0.ɵɵstyleMap(ctx_r1.
|
|
182
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction2(12, _c10, (ctx_r1.
|
|
190
|
+
i0.ɵɵstyleMap((tmp_10_0 = ctx_r1.tableConfig().colConfig[i_r13]) == null ? null : tmp_10_0.style);
|
|
191
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction2(12, _c10, ((tmp_11_0 = ctx_r1.tableConfig().colConfig[i_r13]) == null ? null : tmp_11_0.action) ? "pointer" : "default", ((tmp_11_0 = ctx_r1.tableConfig().colConfig[i_r13]) == null ? null : tmp_11_0.style == null ? null : tmp_11_0.style.justifyContent) ? (tmp_11_0 = ctx_r1.tableConfig().colConfig[i_r13]) == null ? null : tmp_11_0.style == null ? null : tmp_11_0.style.justifyContent : ((tmp_11_0 = ctx_r1.tableConfig().colConfig[i_r13]) == null ? null : tmp_11_0.type) === "number" ? "flex-end" : "space-between"));
|
|
183
192
|
i0.ɵɵadvance();
|
|
184
|
-
i0.ɵɵproperty("ngIf", (ctx_r1.
|
|
193
|
+
i0.ɵɵproperty("ngIf", ((tmp_12_0 = ctx_r1.tableConfig().colConfig[i_r13]) == null ? null : tmp_12_0.type) !== "custom" && ((tmp_12_0 = ctx_r1.tableConfig().colConfig[i_r13]) == null ? null : tmp_12_0.type) !== "actions");
|
|
185
194
|
i0.ɵɵadvance();
|
|
186
|
-
i0.ɵɵproperty("ngIf", (ctx_r1.
|
|
195
|
+
i0.ɵɵproperty("ngIf", ((tmp_13_0 = ctx_r1.tableConfig().colConfig[i_r13]) == null ? null : tmp_13_0.type) === "custom");
|
|
187
196
|
i0.ɵɵadvance();
|
|
188
|
-
i0.ɵɵproperty("ngIf", (ctx_r1.
|
|
197
|
+
i0.ɵɵproperty("ngIf", ((tmp_14_0 = ctx_r1.tableConfig().colConfig[i_r13]) == null ? null : tmp_14_0.type) === "actions");
|
|
189
198
|
} }
|
|
190
199
|
function TableComponent_div_7_div_3_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
191
200
|
i0.ɵɵelementContainerStart(0);
|
|
@@ -238,16 +247,18 @@ function TableComponent_div_7_Template(rf, ctx) { if (rf & 1) {
|
|
|
238
247
|
i0.ɵɵtemplate(3, TableComponent_div_7_div_3_Template, 4, 3, "div", 32);
|
|
239
248
|
i0.ɵɵelementEnd();
|
|
240
249
|
} if (rf & 2) {
|
|
250
|
+
let tmp_7_0;
|
|
251
|
+
let tmp_9_0;
|
|
241
252
|
const row_r18 = ctx.$implicit;
|
|
242
253
|
const i_r9 = ctx.index;
|
|
243
254
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
244
255
|
i0.ɵɵadvance();
|
|
245
256
|
i0.ɵɵclassProp("disabled-row", ctx_r1.isRowDisabled(row_r18));
|
|
246
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(6, _c6$1, ctx_r1.
|
|
257
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(6, _c6$1, ctx_r1.tableConfig().cellHover, ctx_r1.activeRowIndex().includes(i_r9)))("ngStyle", i0.ɵɵpureFunction1(9, _c7$1, ((tmp_7_0 = ctx_r1.tableConfig()) == null ? null : tmp_7_0.rowConfig == null ? null : tmp_7_0.rowConfig.height) ? ctx_r1.tableConfig().rowConfig.height : "44px"));
|
|
247
258
|
i0.ɵɵadvance();
|
|
248
259
|
i0.ɵɵproperty("ngForOf", row_r18);
|
|
249
260
|
i0.ɵɵadvance();
|
|
250
|
-
i0.ɵɵproperty("ngIf", (ctx_r1.
|
|
261
|
+
i0.ɵɵproperty("ngIf", ((tmp_9_0 = ctx_r1.tableConfig()) == null ? null : tmp_9_0.canExpand) && ctx_r1.expandedIndex === i_r9);
|
|
251
262
|
} }
|
|
252
263
|
function TableComponent_div_8_ng_container_7_div_1_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
253
264
|
const _r20 = i0.ɵɵgetCurrentView();
|
|
@@ -256,9 +267,10 @@ function TableComponent_div_8_ng_container_7_div_1_span_1_Template(rf, ctx) { if
|
|
|
256
267
|
i0.ɵɵtext(1);
|
|
257
268
|
i0.ɵɵelementEnd();
|
|
258
269
|
} if (rf & 2) {
|
|
270
|
+
let tmp_6_0;
|
|
259
271
|
const pageNumber_r21 = i0.ɵɵnextContext().$implicit;
|
|
260
272
|
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
261
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c15, pageNumber_r21 == (ctx_r1.
|
|
273
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c15, pageNumber_r21 == ((tmp_6_0 = ctx_r1.tableConfig().paginationConfig) == null ? null : tmp_6_0.selectedPage)));
|
|
262
274
|
i0.ɵɵadvance();
|
|
263
275
|
i0.ɵɵtextInterpolate(pageNumber_r21);
|
|
264
276
|
} }
|
|
@@ -292,7 +304,7 @@ function TableComponent_div_8_ng_container_7_Template(rf, ctx) { if (rf & 1) {
|
|
|
292
304
|
} if (rf & 2) {
|
|
293
305
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
294
306
|
i0.ɵɵadvance();
|
|
295
|
-
i0.ɵɵproperty("ngForOf", ctx_r1.pages);
|
|
307
|
+
i0.ɵɵproperty("ngForOf", ctx_r1.pages());
|
|
296
308
|
} }
|
|
297
309
|
function TableComponent_div_8_Template(rf, ctx) { if (rf & 1) {
|
|
298
310
|
const _r19 = i0.ɵɵgetCurrentView();
|
|
@@ -300,7 +312,7 @@ function TableComponent_div_8_Template(rf, ctx) { if (rf & 1) {
|
|
|
300
312
|
i0.ɵɵtext(2);
|
|
301
313
|
i0.ɵɵelementEnd();
|
|
302
314
|
i0.ɵɵelementStart(3, "div", 46)(4, "span", 47);
|
|
303
|
-
i0.ɵɵlistener("click", function TableComponent_div_8_Template_span_click_4_listener() { i0.ɵɵrestoreView(_r19); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r1.
|
|
315
|
+
i0.ɵɵlistener("click", function TableComponent_div_8_Template_span_click_4_listener() { let tmp_3_0; i0.ɵɵrestoreView(_r19); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(((tmp_3_0 = ctx_r1.tableConfig().paginationConfig) == null ? null : tmp_3_0.selectedPage) > 1 && ctx_r1.updateSelectedPage(((tmp_3_0 = ctx_r1.tableConfig().paginationConfig) == null ? null : tmp_3_0.selectedPage) - 1)); });
|
|
304
316
|
i0.ɵɵnamespaceSVG();
|
|
305
317
|
i0.ɵɵelementStart(5, "svg", 48);
|
|
306
318
|
i0.ɵɵelement(6, "path", 49);
|
|
@@ -308,67 +320,79 @@ function TableComponent_div_8_Template(rf, ctx) { if (rf & 1) {
|
|
|
308
320
|
i0.ɵɵtemplate(7, TableComponent_div_8_ng_container_7_Template, 2, 1, "ng-container", 18);
|
|
309
321
|
i0.ɵɵnamespaceHTML();
|
|
310
322
|
i0.ɵɵelementStart(8, "span", 47);
|
|
311
|
-
i0.ɵɵlistener("click", function TableComponent_div_8_Template_span_click_8_listener() { i0.ɵɵrestoreView(_r19); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r1.
|
|
323
|
+
i0.ɵɵlistener("click", function TableComponent_div_8_Template_span_click_8_listener() { let tmp_3_0; i0.ɵɵrestoreView(_r19); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(((tmp_3_0 = ctx_r1.tableConfig().paginationConfig) == null ? null : tmp_3_0.selectedPage) < ((tmp_3_0 = ctx_r1.tableConfig().paginationConfig) == null ? null : tmp_3_0.noOfPages) && ctx_r1.updateSelectedPage(((tmp_3_0 = ctx_r1.tableConfig().paginationConfig) == null ? null : tmp_3_0.selectedPage) + 1)); });
|
|
312
324
|
i0.ɵɵnamespaceSVG();
|
|
313
325
|
i0.ɵɵelementStart(9, "svg", 48);
|
|
314
326
|
i0.ɵɵelement(10, "path", 50);
|
|
315
327
|
i0.ɵɵelementEnd()()()();
|
|
316
328
|
} if (rf & 2) {
|
|
329
|
+
let tmp_2_0;
|
|
330
|
+
let tmp_3_0;
|
|
331
|
+
let tmp_4_0;
|
|
332
|
+
let tmp_5_0;
|
|
317
333
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
318
334
|
i0.ɵɵadvance(2);
|
|
319
|
-
i0.ɵɵtextInterpolate3(" Showing ", ((ctx_r1.
|
|
335
|
+
i0.ɵɵtextInterpolate3(" Showing ", (((tmp_2_0 = ctx_r1.tableConfig().paginationConfig) == null ? null : tmp_2_0.selectedPage) - 1) * ctx_r1.tableConfig().paginationConfig.rowsPerPage + 1, "-", (((tmp_2_0 = ctx_r1.tableConfig().paginationConfig) == null ? null : tmp_2_0.selectedPage) - 1) * ctx_r1.tableConfig().paginationConfig.rowsPerPage + ctx_r1.tableLength(), " of ", ctx_r1.tableConfig().paginationConfig.totalNoOfRows, " items ");
|
|
320
336
|
i0.ɵɵadvance(2);
|
|
321
|
-
i0.ɵɵclassProp("page-nav-inactive", (ctx_r1.
|
|
337
|
+
i0.ɵɵclassProp("page-nav-inactive", ((tmp_3_0 = ctx_r1.tableConfig().paginationConfig) == null ? null : tmp_3_0.selectedPage) === 1);
|
|
322
338
|
i0.ɵɵadvance(3);
|
|
323
|
-
i0.ɵɵproperty("ngIf", !(ctx_r1.
|
|
339
|
+
i0.ɵɵproperty("ngIf", !((tmp_4_0 = ctx_r1.tableConfig().paginationConfig) == null ? null : tmp_4_0.disablePageJumping));
|
|
324
340
|
i0.ɵɵadvance();
|
|
325
|
-
i0.ɵɵclassProp("page-nav-inactive", (ctx_r1.
|
|
341
|
+
i0.ɵɵclassProp("page-nav-inactive", ((tmp_5_0 = ctx_r1.tableConfig().paginationConfig) == null ? null : tmp_5_0.selectedPage) === ((tmp_5_0 = ctx_r1.tableConfig().paginationConfig) == null ? null : tmp_5_0.noOfPages));
|
|
326
342
|
} }
|
|
327
343
|
class TableComponent {
|
|
328
344
|
constructor(renderer) {
|
|
329
345
|
this.renderer = renderer;
|
|
330
346
|
// Initialize with -1 to indicate no row is colored at the beginning
|
|
331
|
-
this.activeRowIndex = [];
|
|
332
|
-
this.hasCheckboxActions = false;
|
|
333
|
-
this.selectAllCheckbox = false;
|
|
347
|
+
this.activeRowIndex = signal([]);
|
|
348
|
+
this.hasCheckboxActions = signal(false);
|
|
349
|
+
this.selectAllCheckbox = signal(false);
|
|
334
350
|
// Filter related variables
|
|
335
|
-
this.showFilter = false;
|
|
336
|
-
this.filterName = "";
|
|
337
|
-
this.filterData = [];
|
|
338
|
-
this.filterContainerStyles = {};
|
|
339
|
-
this.appliedFilters = {};
|
|
340
|
-
|
|
351
|
+
this.showFilter = signal(false);
|
|
352
|
+
this.filterName = signal("");
|
|
353
|
+
this.filterData = signal([]);
|
|
354
|
+
this.filterContainerStyles = signal({});
|
|
355
|
+
this.appliedFilters = signal({});
|
|
356
|
+
// Convert outputs to signal-based outputs
|
|
357
|
+
this.filtersUpdated = output();
|
|
341
358
|
// Pagination related variables
|
|
342
|
-
this.pages = [];
|
|
343
|
-
this.
|
|
344
|
-
this.
|
|
345
|
-
|
|
346
|
-
this.
|
|
347
|
-
this.
|
|
348
|
-
this.
|
|
349
|
-
this.
|
|
359
|
+
this.pages = signal([]);
|
|
360
|
+
this.tableLength = signal(0);
|
|
361
|
+
this.pageSelected = output();
|
|
362
|
+
// Convert inputs to signal-based inputs
|
|
363
|
+
this.tableConfig = input();
|
|
364
|
+
this.subTableconfig = input();
|
|
365
|
+
this.tableDataLoading = input();
|
|
366
|
+
this.expandedIndex = input();
|
|
367
|
+
this.tableData = input([]);
|
|
368
|
+
this.subTableData = input([]);
|
|
369
|
+
this.subTableDataLoading = input();
|
|
370
|
+
this.currentSort = input();
|
|
371
|
+
this.collapseColIndex = signal(-1);
|
|
372
|
+
this.previewLines = signal(0);
|
|
373
|
+
this.rowCollapseConfigIndex = signal(-1);
|
|
374
|
+
this.expandedMap = signal({});
|
|
350
375
|
// Sorting related properties
|
|
351
|
-
this.
|
|
352
|
-
this.
|
|
353
|
-
this.
|
|
354
|
-
this.headerAction = new EventEmitter();
|
|
376
|
+
this.multiColumnSort = signal([]);
|
|
377
|
+
this.sortChange = output();
|
|
378
|
+
this.headerAction = output();
|
|
355
379
|
}
|
|
356
380
|
// Function to handle row click
|
|
357
381
|
selectRow(index) {
|
|
358
|
-
if (this.hasCheckboxActions)
|
|
382
|
+
if (this.hasCheckboxActions())
|
|
359
383
|
return;
|
|
360
|
-
this.activeRowIndex
|
|
361
|
-
!!this.
|
|
384
|
+
this.activeRowIndex.set([index]); // Set the selected index to the clicked row's index
|
|
385
|
+
!!this.tableConfig().rowConfig.action && this.tableConfig().rowConfig.action(index);
|
|
362
386
|
}
|
|
363
387
|
ngOnInit() {
|
|
364
|
-
this.hasCheckboxActions
|
|
365
|
-
this.tableLength
|
|
388
|
+
this.hasCheckboxActions.set(this.tableConfig().colConfig?.some(col => col.type === "actions" && col.actionType === "checkbox"));
|
|
389
|
+
this.tableLength.set(!!this.tableData() ? this.tableData().length : 0);
|
|
366
390
|
this.initializeFilters();
|
|
367
|
-
if (this.
|
|
391
|
+
if (this.tableConfig().paginationConfig) {
|
|
368
392
|
this.initializePagination();
|
|
369
393
|
}
|
|
370
|
-
if (this.
|
|
371
|
-
this
|
|
394
|
+
if (this.tableConfig().canScrollHorizontally === undefined) {
|
|
395
|
+
// Note: We can't directly modify input signals, this should be handled by parent component
|
|
372
396
|
}
|
|
373
397
|
document.addEventListener("click", event => {
|
|
374
398
|
if (this.filter) {
|
|
@@ -376,45 +400,48 @@ class TableComponent {
|
|
|
376
400
|
let targetElement = event.target;
|
|
377
401
|
if (targetElement.className === "checkmark") {
|
|
378
402
|
isCheckBoxClicked = true;
|
|
379
|
-
this.showFilter
|
|
403
|
+
this.showFilter.set(true);
|
|
380
404
|
}
|
|
381
405
|
let isClickInsideElement = this.filter.container.nativeElement.contains(event.target);
|
|
382
406
|
if (!isClickInsideElement && !isCheckBoxClicked) {
|
|
383
|
-
this.toggleFilter(this.filterName);
|
|
407
|
+
this.toggleFilter(this.filterName());
|
|
384
408
|
}
|
|
385
409
|
}
|
|
386
410
|
});
|
|
387
411
|
// fetch collapseColIndex and previewLines if present
|
|
388
|
-
this.rowCollapseConfigIndex
|
|
389
|
-
if (this.rowCollapseConfigIndex !== -1) {
|
|
390
|
-
this.collapseColIndex
|
|
391
|
-
this.
|
|
392
|
-
this.previewLines = this.config.colConfig[this.rowCollapseConfigIndex].previewLines ?? null;
|
|
412
|
+
this.rowCollapseConfigIndex.set(this.tableConfig()?.colConfig?.findIndex(col => col.type === 'actions' && col.actionType === 'row-collapse'));
|
|
413
|
+
if (this.rowCollapseConfigIndex() !== -1) {
|
|
414
|
+
this.collapseColIndex.set(this.tableConfig().colConfig[this.rowCollapseConfigIndex()].collapseColumnIndex ?? null);
|
|
415
|
+
this.previewLines.set(this.tableConfig().colConfig[this.rowCollapseConfigIndex()].previewLines ?? null);
|
|
393
416
|
this.buildExpandedMap();
|
|
394
417
|
}
|
|
395
418
|
}
|
|
396
419
|
buildExpandedMap() {
|
|
397
|
-
|
|
398
|
-
this.tableData.forEach((row, rowIndex) => {
|
|
399
|
-
|
|
400
|
-
row[this.rowCollapseConfigIndex];
|
|
420
|
+
const newExpandedMap = {};
|
|
421
|
+
this.tableData().forEach((row, rowIndex) => {
|
|
422
|
+
newExpandedMap[`${rowIndex}`] =
|
|
423
|
+
row[this.rowCollapseConfigIndex()];
|
|
401
424
|
});
|
|
425
|
+
this.expandedMap.set(newExpandedMap);
|
|
402
426
|
}
|
|
403
427
|
ngAfterViewInit() {
|
|
404
|
-
if (this.
|
|
405
|
-
let height = this.
|
|
428
|
+
if (this.tableConfig().paginationConfig) {
|
|
429
|
+
let height = parseInt(this.tableConfig().height.toString().replace('px', '')) || 0;
|
|
406
430
|
this.renderer.setStyle(this.table.nativeElement, "height", height - 56 + "px");
|
|
407
431
|
}
|
|
408
432
|
}
|
|
409
433
|
ngOnChanges() {
|
|
410
|
-
this.tableLength
|
|
411
|
-
if (this.
|
|
412
|
-
|
|
434
|
+
this.tableLength.set(this.tableData()?.length ?? 0);
|
|
435
|
+
if (this.tableConfig().activeRowIndex !== null && this.tableConfig().activeRowIndex !== undefined) {
|
|
436
|
+
const activeRowIndex = this.tableConfig().activeRowIndex;
|
|
437
|
+
this.activeRowIndex.set(Array.isArray(activeRowIndex) ? activeRowIndex : [activeRowIndex]);
|
|
413
438
|
}
|
|
414
439
|
}
|
|
415
440
|
// Filter related functions
|
|
416
441
|
initializeFilters() {
|
|
417
|
-
|
|
442
|
+
const newAppliedFilters = {};
|
|
443
|
+
const allFilters = [];
|
|
444
|
+
for (let colHeader of this.tableConfig()?.colHeaderConfig) {
|
|
418
445
|
if (colHeader.filters) {
|
|
419
446
|
let filters = [];
|
|
420
447
|
for (let filter of colHeader.filters) {
|
|
@@ -424,16 +451,20 @@ class TableComponent {
|
|
|
424
451
|
value: filter.value
|
|
425
452
|
});
|
|
426
453
|
}
|
|
454
|
+
// Add all filters to the filterData array
|
|
455
|
+
allFilters.push(filter);
|
|
427
456
|
}
|
|
428
457
|
if (filters.length > 0)
|
|
429
|
-
|
|
458
|
+
newAppliedFilters[colHeader.data] = filters;
|
|
430
459
|
}
|
|
431
460
|
}
|
|
461
|
+
this.appliedFilters.set(newAppliedFilters);
|
|
462
|
+
this.filterData.set(allFilters);
|
|
432
463
|
}
|
|
433
464
|
toggleFilter(filterName) {
|
|
434
|
-
if (!this.showFilter) {
|
|
435
|
-
this.filterName
|
|
436
|
-
this.showFilter
|
|
465
|
+
if (!this.showFilter()) {
|
|
466
|
+
this.filterName.set(filterName);
|
|
467
|
+
this.showFilter.set(true);
|
|
437
468
|
let offSet = 0;
|
|
438
469
|
let colHeadersReversed = this.colHeaders.toArray().reverse();
|
|
439
470
|
for (let header of colHeadersReversed) {
|
|
@@ -441,81 +472,82 @@ class TableComponent {
|
|
|
441
472
|
break;
|
|
442
473
|
offSet += header.nativeElement.offsetWidth;
|
|
443
474
|
}
|
|
444
|
-
this.filterContainerStyles
|
|
475
|
+
this.filterContainerStyles.set({
|
|
445
476
|
top: "44px",
|
|
446
477
|
right: offSet > 0 ? offSet - 116 + "px" : "12px"
|
|
447
|
-
};
|
|
478
|
+
});
|
|
448
479
|
}
|
|
449
480
|
else {
|
|
450
|
-
this.filterName
|
|
451
|
-
this.filterData
|
|
452
|
-
this.showFilter
|
|
481
|
+
this.filterName.set("");
|
|
482
|
+
this.filterData.set([]);
|
|
483
|
+
this.showFilter.set(false);
|
|
453
484
|
}
|
|
454
485
|
}
|
|
455
486
|
updateAppliedFilters(appliedFilters) {
|
|
487
|
+
const currentFilters = this.appliedFilters();
|
|
456
488
|
if (appliedFilters.length == 0) {
|
|
457
|
-
delete
|
|
489
|
+
delete currentFilters[this.filterName()];
|
|
458
490
|
}
|
|
459
491
|
else {
|
|
460
|
-
|
|
492
|
+
currentFilters[this.filterName()] = appliedFilters;
|
|
461
493
|
}
|
|
462
|
-
this.
|
|
463
|
-
this.
|
|
494
|
+
this.appliedFilters.set({ ...currentFilters });
|
|
495
|
+
this.filtersUpdated.emit({ ...this.appliedFilters() });
|
|
496
|
+
this.toggleFilter(this.filterName());
|
|
464
497
|
}
|
|
465
498
|
// Pagination related functions
|
|
466
499
|
initializePagination() {
|
|
467
|
-
if (this.
|
|
468
|
-
let len = this.
|
|
500
|
+
if (this.tableConfig().paginationConfig) {
|
|
501
|
+
let len = this.tableConfig().paginationConfig.noOfPages;
|
|
469
502
|
if (len <= 7) {
|
|
503
|
+
const newPages = [];
|
|
470
504
|
for (let i = 1; i <= len; i++) {
|
|
471
|
-
|
|
505
|
+
newPages.push(i);
|
|
472
506
|
}
|
|
507
|
+
this.pages.set(newPages);
|
|
473
508
|
}
|
|
474
509
|
else {
|
|
475
|
-
this.pages
|
|
510
|
+
this.pages.set([1, 2, 3, 4, 0, len]);
|
|
476
511
|
}
|
|
477
512
|
}
|
|
478
513
|
}
|
|
479
514
|
updateSelectedPage(pageNumber) {
|
|
480
515
|
// Guard clause to prevent out-of-range updates
|
|
481
|
-
if (pageNumber < 1 || pageNumber > this.
|
|
516
|
+
if (pageNumber < 1 || pageNumber > this.tableConfig().paginationConfig.noOfPages)
|
|
482
517
|
return;
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
return;
|
|
488
|
-
this.config.paginationConfig.selectedPage = pageNumber;
|
|
489
|
-
let len = this.config.paginationConfig.noOfPages;
|
|
518
|
+
// Reset header checkbox when navigating to a different page
|
|
519
|
+
this.selectAllCheckbox.set(false);
|
|
520
|
+
// Note: We can't directly modify input signals, this should be handled by parent component
|
|
521
|
+
let len = this.tableConfig().paginationConfig.noOfPages;
|
|
490
522
|
if (len > 7) {
|
|
491
523
|
if (pageNumber - 2 <= 1) {
|
|
492
|
-
this.pages
|
|
524
|
+
this.pages.set([1, 2, 3, 4, 0, len]);
|
|
493
525
|
}
|
|
494
526
|
else if (pageNumber - 2 > 1 && pageNumber + 2 < len) {
|
|
495
|
-
this.pages
|
|
527
|
+
this.pages.set([1, 0, pageNumber - 1, pageNumber, pageNumber + 1, 0, len]);
|
|
496
528
|
}
|
|
497
529
|
else if (pageNumber + 2 >= len) {
|
|
498
|
-
this.pages
|
|
530
|
+
this.pages.set([1, 0, len - 3, len - 2, len - 1, len]);
|
|
499
531
|
}
|
|
500
532
|
}
|
|
501
|
-
this.pageSelected.emit(
|
|
533
|
+
this.pageSelected.emit(pageNumber);
|
|
502
534
|
}
|
|
503
535
|
// Main container related functions
|
|
504
536
|
getContainerHeight() {
|
|
505
|
-
if (this.
|
|
506
|
-
return this.
|
|
537
|
+
if (this.tableConfig()?.height)
|
|
538
|
+
return this.tableConfig().height;
|
|
507
539
|
else
|
|
508
540
|
return "";
|
|
509
541
|
}
|
|
510
542
|
getContainerWidth() {
|
|
511
|
-
if (this.
|
|
512
|
-
return this.
|
|
543
|
+
if (this.tableConfig()?.width)
|
|
544
|
+
return this.tableConfig().width;
|
|
513
545
|
else
|
|
514
546
|
return "";
|
|
515
547
|
}
|
|
516
548
|
// Column Headers related functions
|
|
517
549
|
getColHeadersRowStyles() {
|
|
518
|
-
const { colHeadersRowConfig } = this.
|
|
550
|
+
const { colHeadersRowConfig } = this.tableConfig();
|
|
519
551
|
const minHeight = colHeadersRowConfig?.height || "44px";
|
|
520
552
|
const borderTop = colHeadersRowConfig?.style?.borderTop || "";
|
|
521
553
|
const borderBottom = colHeadersRowConfig?.style?.borderBottom || "1px solid #E0E0E0";
|
|
@@ -530,22 +562,28 @@ class TableComponent {
|
|
|
530
562
|
};
|
|
531
563
|
}
|
|
532
564
|
onSortChange(sortState) {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
565
|
+
// Emit the sort change to the parent component
|
|
566
|
+
this.sortChange.emit(sortState);
|
|
567
|
+
// Handle multi-column sort if enabled
|
|
568
|
+
if (this.tableConfig().multiColumnSort) {
|
|
569
|
+
const currentMultiSort = this.multiColumnSort();
|
|
570
|
+
const index = currentMultiSort.findIndex(sort => sort.column === sortState.column);
|
|
536
571
|
if (index !== -1) {
|
|
537
572
|
if (sortState.direction === null) {
|
|
538
|
-
|
|
573
|
+
const newMultiSort = [...currentMultiSort];
|
|
574
|
+
newMultiSort.splice(index, 1);
|
|
575
|
+
this.multiColumnSort.set(newMultiSort);
|
|
539
576
|
}
|
|
540
577
|
else {
|
|
541
|
-
|
|
578
|
+
const newMultiSort = [...currentMultiSort];
|
|
579
|
+
newMultiSort[index] = sortState;
|
|
580
|
+
this.multiColumnSort.set(newMultiSort);
|
|
542
581
|
}
|
|
543
582
|
}
|
|
544
583
|
else if (sortState.direction !== null) {
|
|
545
|
-
this.multiColumnSort.
|
|
584
|
+
this.multiColumnSort.set([...currentMultiSort, sortState]);
|
|
546
585
|
}
|
|
547
586
|
}
|
|
548
|
-
this.sortChange.emit(sortState);
|
|
549
587
|
}
|
|
550
588
|
getActionsCellStyle(style) {
|
|
551
589
|
if (!style)
|
|
@@ -555,32 +593,33 @@ class TableComponent {
|
|
|
555
593
|
}
|
|
556
594
|
onActionClick(event, rowIndex) {
|
|
557
595
|
if (event.actionType === 'checkbox') {
|
|
596
|
+
const currentActiveRows = this.activeRowIndex();
|
|
558
597
|
if (event.value) {
|
|
559
|
-
this.activeRowIndex.
|
|
598
|
+
this.activeRowIndex.set([...currentActiveRows, rowIndex]);
|
|
560
599
|
}
|
|
561
600
|
else {
|
|
562
|
-
this.activeRowIndex
|
|
601
|
+
this.activeRowIndex.set(currentActiveRows.filter(index => index !== rowIndex));
|
|
563
602
|
}
|
|
564
603
|
const actionInfo = this.findActionConfig('checkbox');
|
|
565
|
-
if (actionInfo && this.tableData[rowIndex]) {
|
|
604
|
+
if (actionInfo && this.tableData()[rowIndex]) {
|
|
566
605
|
const { index, config } = actionInfo;
|
|
567
|
-
this
|
|
568
|
-
const checkedItems = this.tableData.filter(row => row[index] === true);
|
|
606
|
+
// Note: We can't directly modify input signals, this should be handled by parent component
|
|
607
|
+
const checkedItems = this.tableData().filter(row => row[index] === true);
|
|
569
608
|
config.action?.(checkedItems);
|
|
570
609
|
}
|
|
571
610
|
}
|
|
572
611
|
else if (event.actionType === 'row-collapse') {
|
|
573
612
|
const rowCollapse = this.findActionConfig('row-collapse');
|
|
574
|
-
if (rowCollapse && this.tableData[rowIndex]) {
|
|
575
|
-
this
|
|
576
|
-
rowCollapse.config.action?.(this.tableData);
|
|
613
|
+
if (rowCollapse && this.tableData()[rowIndex]) {
|
|
614
|
+
// Note: We can't directly modify input signals, this should be handled by parent component
|
|
615
|
+
rowCollapse.config.action?.(this.tableData());
|
|
577
616
|
this.buildExpandedMap();
|
|
578
617
|
}
|
|
579
618
|
}
|
|
580
619
|
}
|
|
581
620
|
findActionConfig(actionType) {
|
|
582
|
-
for (let i = 0; i < this.
|
|
583
|
-
const col = this.
|
|
621
|
+
for (let i = 0; i < this.tableConfig().colConfig.length; i++) {
|
|
622
|
+
const col = this.tableConfig().colConfig[i];
|
|
584
623
|
if (col.type === 'actions' && col.actionType === actionType) {
|
|
585
624
|
return { index: i, config: col };
|
|
586
625
|
}
|
|
@@ -588,27 +627,25 @@ class TableComponent {
|
|
|
588
627
|
return null;
|
|
589
628
|
}
|
|
590
629
|
isRowDisabled(row) {
|
|
591
|
-
return typeof this.
|
|
630
|
+
return typeof this.tableConfig().rowConfig.disableRow === "function" ? this.tableConfig().rowConfig.disableRow(row) : false;
|
|
592
631
|
}
|
|
593
632
|
toggleCheckbox() {
|
|
594
|
-
this.selectAllCheckbox
|
|
595
|
-
const checkboxColIndex = this.
|
|
633
|
+
this.selectAllCheckbox.set(!this.selectAllCheckbox());
|
|
634
|
+
const checkboxColIndex = this.tableConfig().colConfig.findIndex(col => col.type === 'actions' && col.actionType === 'checkbox');
|
|
596
635
|
if (checkboxColIndex !== -1) {
|
|
597
|
-
|
|
636
|
+
// Note: We can't directly modify input signals, this should be handled by parent component
|
|
637
|
+
const updatedTableData = this.tableData().map((row) => {
|
|
598
638
|
const updatedRow = [...row];
|
|
599
639
|
const currentCheckbox = updatedRow[checkboxColIndex];
|
|
600
640
|
const isDisabled = this.isRowDisabled(row);
|
|
601
641
|
if (!isDisabled) {
|
|
602
|
-
updatedRow[checkboxColIndex] =
|
|
603
|
-
...currentCheckbox,
|
|
604
|
-
value: this.selectAllCheckbox
|
|
605
|
-
};
|
|
642
|
+
updatedRow[checkboxColIndex] = this.selectAllCheckbox();
|
|
606
643
|
}
|
|
607
644
|
return updatedRow;
|
|
608
645
|
});
|
|
609
646
|
this.headerAction?.emit({
|
|
610
647
|
type: "checkboxToggle",
|
|
611
|
-
payload:
|
|
648
|
+
payload: updatedTableData
|
|
612
649
|
});
|
|
613
650
|
}
|
|
614
651
|
}
|
|
@@ -622,7 +659,7 @@ class TableComponent {
|
|
|
622
659
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.filter = _t.first);
|
|
623
660
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.table = _t.first);
|
|
624
661
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.colHeaders = _t);
|
|
625
|
-
} }, inputs: {
|
|
662
|
+
} }, inputs: { tableConfig: [1, "tableConfig"], subTableconfig: [1, "subTableconfig"], tableDataLoading: [1, "tableDataLoading"], expandedIndex: [1, "expandedIndex"], tableData: [1, "tableData"], subTableData: [1, "subTableData"], subTableDataLoading: [1, "subTableDataLoading"], currentSort: [1, "currentSort"] }, outputs: { filtersUpdated: "filtersUpdated", pageSelected: "pageSelected", sortChange: "sortChange", headerAction: "headerAction" }, features: [i0.ɵɵNgOnChangesFeature], decls: 9, vars: 15, consts: [["table", ""], ["filter", ""], ["colHeaderRef", ""], ["plainText", ""], ["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"], [4, "ngIf", "ngIfElse"], [3, "innerHTML"], [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) {
|
|
626
663
|
i0.ɵɵelementStart(0, "div", 4);
|
|
627
664
|
i0.ɵɵtemplate(1, TableComponent_mis_table_filter_1_Template, 2, 2, "mis-table-filter", 5);
|
|
628
665
|
i0.ɵɵelementStart(2, "div", 6, 0)(4, "div", 7);
|
|
@@ -634,73 +671,60 @@ class TableComponent {
|
|
|
634
671
|
i0.ɵɵtemplate(8, TableComponent_div_8_Template, 11, 8, "div", 11);
|
|
635
672
|
i0.ɵɵelementEnd();
|
|
636
673
|
} if (rf & 2) {
|
|
637
|
-
|
|
674
|
+
let tmp_5_0;
|
|
675
|
+
let tmp_7_0;
|
|
676
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction3(7, _c3$1, ctx.getContainerHeight(), ctx.getContainerWidth(), ctx.tableConfig().canScrollHorizontally ? "auto" : "unset"));
|
|
638
677
|
i0.ɵɵadvance();
|
|
639
|
-
i0.ɵɵproperty("ngIf", ctx.showFilter);
|
|
678
|
+
i0.ɵɵproperty("ngIf", ctx.showFilter());
|
|
640
679
|
i0.ɵɵadvance();
|
|
641
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction3(11, _c4$1, ctx.expandedIndex < 0, !(ctx.expandedIndex < 0), ctx.
|
|
680
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction3(11, _c4$1, ctx.expandedIndex() < 0, !(ctx.expandedIndex() < 0), ctx.tableConfig().canScrollHorizontally));
|
|
642
681
|
i0.ɵɵadvance(2);
|
|
643
682
|
i0.ɵɵproperty("ngStyle", ctx.getColHeadersRowStyles());
|
|
644
683
|
i0.ɵɵadvance();
|
|
645
|
-
i0.ɵɵproperty("ngForOf", ctx.
|
|
684
|
+
i0.ɵɵproperty("ngForOf", (tmp_5_0 = ctx.tableConfig()) == null ? null : tmp_5_0.colHeaderConfig);
|
|
646
685
|
i0.ɵɵadvance(2);
|
|
647
|
-
i0.ɵɵproperty("ngForOf", ctx.tableData);
|
|
686
|
+
i0.ɵɵproperty("ngForOf", ctx.tableData());
|
|
648
687
|
i0.ɵɵadvance();
|
|
649
|
-
i0.ɵɵproperty("ngIf", (ctx.
|
|
650
|
-
} }, 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
|
|
688
|
+
i0.ɵɵproperty("ngIf", ((tmp_7_0 = ctx.tableConfig()) == null ? null : tmp_7_0.paginationConfig) && (ctx.tableLength() >= ctx.tableConfig().paginationConfig.rowsPerPage || ((tmp_7_0 = ctx.tableConfig().paginationConfig) == null ? null : tmp_7_0.selectedPage) !== 1));
|
|
689
|
+
} }, 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;overflow-wrap:anywhere;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}.text-ellipsis[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}#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){.collapsed-cell[_ngcontent-%COMP%]{display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:var(--collapsed-lines, 2);white-space:normal!important}}"] }); }
|
|
651
690
|
}
|
|
652
691
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableComponent, [{
|
|
653
692
|
type: Component,
|
|
654
|
-
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 <div\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 <!-- Render as HTML -->\n <ng-container *ngIf=\"config.colConfig[i]?.type === 'html'; else plainText\">\n <span [innerHTML]=\"col\"></span>\n </ng-container>\n \n <!-- Render as plain text -->\n <ng-template #plainText>\n <span>{{ col }}</span>\n </ng-template>\n </div>\n \n\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:var(--text-tertiary, #929DAB);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:var(--bg-primary, #FFFFFF);width:100%;z-index:1;min-height:44px;border-bottom:1px solid var(--border-primary, #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:var(--brand-accent, #10ADAE);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:var(--brand-primary, #0937B2)}.t-row{display:flex;min-height:44px;background-color:var(--bg-primary, #FFFFFF);width:100%;border-bottom:1px solid var(--border-primary, #E0E0E0)}.t-row:hover{background-color:var(--brand-primary-hover, #F0F3FA)}.active-row{background-color:var(--brand-primary-active, #DAE1F3)}.t-col-container{padding:0 16px;overflow-wrap:anywhere;min-width:0}.t-row-hover:hover{background-color:#0000}.t-col-container-hover:hover{background-color:var(--brand-primary-active, #DAE1F3)}.t-col-container-hover:first-child{border-left:1px solid var(--border-primary, #E0E0E0)}.t-col-container-hover{border-right:1px solid var(--border-primary, #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}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}#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:var(--text-secondary, #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:var(--text-secondary, #6A737D);margin-right:8px;cursor:pointer}.page.page-jumping-enabled{border:1px solid var(--text-secondary, #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:var(--text-secondary, #6A737D)}.page-active{color:var(--brand-primary, #0937B2);border:1px solid var(--brand-primary, #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:var(--brand-primary-active, #DAE1F3)}.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){.collapsed-cell{display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:var(--collapsed-lines, 2);white-space:normal!important}}\n"] }]
|
|
655
|
-
}], () => [{ type: i0.Renderer2 }], {
|
|
656
|
-
type: Output
|
|
657
|
-
}], filter: [{
|
|
693
|
+
args: [{ selector: "mis-table", template: "<div\n [ngStyle]=\"{\n height: getContainerHeight(),\n width: getContainerWidth(),\n 'overflow-x': tableConfig().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': tableConfig().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 tableConfig()?.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.set(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]=\"tableConfig().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': tableConfig().cellHover, 'active-row': activeRowIndex().includes(i) }\"\n [ngStyle]=\"{ 'min-height': tableConfig()?.rowConfig?.height ? tableConfig().rowConfig.height : '44px' }\"\n (click)=\"selectRow(i)\"\n [class.disabled-row]=\"isRowDisabled(row)\"\n >\n <div\n (click)=\"tableConfig()?.colConfig[i]?.action && tableConfig()?.colConfig[i]?.actionType !== 'checkbox' ? tableConfig()?.colConfig[i]?.action(col) : null\"\n *ngFor=\"let col of row; let i = index\"\n [ngStyle]=\"{\n width: tableConfig()?.colConfig[i]?.style?.width || tableConfig()?.colHeaderConfig[i]?.style?.width || ''\n }\"\n class=\"t-col-container\"\n [ngClass]=\"{ 't-col-container-hover': tableConfig().cellHover }\"\n >\n <div\n class=\"t-col\"\n [style]=\"tableConfig().colConfig[i]?.style\"\n [ngStyle]=\"{\n width: '100%',\n cursor: tableConfig().colConfig[i]?.action ? 'pointer' : 'default',\n 'justify-content': tableConfig().colConfig[i]?.style?.justifyContent\n ? tableConfig().colConfig[i]?.style?.justifyContent\n : tableConfig().colConfig[i]?.type === 'number'\n ? 'flex-end'\n : 'space-between'\n }\"\n >\n <div\n *ngIf=\"tableConfig().colConfig[i]?.type !== 'custom' && tableConfig().colConfig[i]?.type !== 'actions'\"\n [ngStyle]=\"{\n color: tableConfig()?.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 <!-- Render as HTML -->\n <ng-container *ngIf=\"tableConfig().colConfig[i]?.type === 'html'; else plainText\">\n <span [innerHTML]=\"col\"></span>\n </ng-container>\n \n <!-- Render as plain text -->\n <ng-template #plainText>\n <span>{{ col }}</span>\n </ng-template>\n </div>\n \n\n \n <ng-template\n *ngIf=\"tableConfig().colConfig[i]?.type === 'custom'\"\n [customComponent]=\"tableConfig().colConfig[i].componentRef\"\n [data]=\"col\"\n customTableCell\n ></ng-template>\n <mis-actions-cell\n *ngIf=\"tableConfig().colConfig[i]?.type === 'actions'\"\n [cellData]=\"col\"\n [config]=\"tableConfig().colConfig[i]\"\n (actionClick)=\"onActionClick($event, rowIndex)\"\n [ngClass]=\"{\n 'disable-actions': (tableConfig().colConfig[i]?.actionType === 'checkbox' || tableConfig().colConfig[i]?.actionType === 'row-collapse') && isRowDisabled(row)\n }\"\n ></mis-actions-cell>\n\n </div>\n </div>\n </div>\n <div *ngIf=\"tableConfig()?.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=\"tableConfig()?.paginationConfig && (tableLength() >= tableConfig().paginationConfig.rowsPerPage || tableConfig().paginationConfig?.selectedPage !== 1)\"\n id=\"pagination-container\"\n >\n <p id=\"pagination-text\">\n Showing\n {{ (tableConfig().paginationConfig?.selectedPage - 1) * tableConfig().paginationConfig.rowsPerPage + 1 }}-{{\n (tableConfig().paginationConfig?.selectedPage - 1) * tableConfig().paginationConfig.rowsPerPage + tableLength()\n }}\n of {{ tableConfig().paginationConfig.totalNoOfRows }} items\n </p>\n <div id=\"pages-container\">\n <span (click)=\"tableConfig().paginationConfig?.selectedPage > 1 && updateSelectedPage(tableConfig().paginationConfig?.selectedPage - 1)\" class=\"page\" [class.page-nav-inactive]=\"tableConfig().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=\"!tableConfig().paginationConfig?.disablePageJumping\">\n <div *ngFor=\"let pageNumber of pages()\">\n <span\n (click)=\"updateSelectedPage(pageNumber)\"\n *ngIf=\"pageNumber != 0\"\n [ngClass]=\"{ 'page-active': pageNumber == tableConfig().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]=\"tableConfig().paginationConfig?.selectedPage === tableConfig().paginationConfig?.noOfPages\"\n (click)=\"tableConfig().paginationConfig?.selectedPage < tableConfig().paginationConfig?.noOfPages && updateSelectedPage(tableConfig().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;overflow-wrap:anywhere;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}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}#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){.collapsed-cell{display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:var(--collapsed-lines, 2);white-space:normal!important}}\n"] }]
|
|
694
|
+
}], () => [{ type: i0.Renderer2 }], { filter: [{
|
|
658
695
|
type: ViewChild,
|
|
659
696
|
args: ["filter"]
|
|
660
697
|
}], colHeaders: [{
|
|
661
698
|
type: ViewChildren,
|
|
662
699
|
args: ["colHeaderRef"]
|
|
663
|
-
}], pageSelected: [{
|
|
664
|
-
type: Output
|
|
665
|
-
}], config: [{
|
|
666
|
-
type: Input,
|
|
667
|
-
args: ["tableConfig"]
|
|
668
|
-
}], subTableconfig: [{
|
|
669
|
-
type: Input
|
|
670
|
-
}], tableDataLoading: [{
|
|
671
|
-
type: Input
|
|
672
|
-
}], expandedIndex: [{
|
|
673
|
-
type: Input
|
|
674
|
-
}], tableData: [{
|
|
675
|
-
type: Input
|
|
676
|
-
}], subTableData: [{
|
|
677
|
-
type: Input
|
|
678
|
-
}], subTableDataLoading: [{
|
|
679
|
-
type: Input
|
|
680
700
|
}], table: [{
|
|
681
701
|
type: ViewChild,
|
|
682
702
|
args: ["table"]
|
|
683
|
-
}], sortChange: [{
|
|
684
|
-
type: Output
|
|
685
|
-
}], headerAction: [{
|
|
686
|
-
type: Output
|
|
687
703
|
}] }); })();
|
|
688
704
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TableComponent, { className: "TableComponent" }); })();
|
|
689
705
|
|
|
690
706
|
class CustomTableCellDirective {
|
|
691
|
-
set customComponent(value) {
|
|
692
|
-
this.component = value;
|
|
693
|
-
this.createComponent();
|
|
694
|
-
}
|
|
695
|
-
set data(value) {
|
|
696
|
-
this.cellData = value;
|
|
697
|
-
if (this.ref) {
|
|
698
|
-
this.ref.instance.data = this.cellData;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
707
|
constructor(viewContainerRef, componentFactoryResolver) {
|
|
702
708
|
this.viewContainerRef = viewContainerRef;
|
|
703
709
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
710
|
+
this.customComponent = input();
|
|
711
|
+
this.data = input();
|
|
712
|
+
effect(() => {
|
|
713
|
+
const component = this.customComponent();
|
|
714
|
+
if (component) {
|
|
715
|
+
this.component = component;
|
|
716
|
+
this.createComponent();
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
effect(() => {
|
|
720
|
+
const data = this.data();
|
|
721
|
+
if (data !== undefined) {
|
|
722
|
+
this.cellData = data;
|
|
723
|
+
if (this.ref) {
|
|
724
|
+
this.ref.instance.data = this.cellData;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
});
|
|
704
728
|
}
|
|
705
729
|
createComponent() {
|
|
706
730
|
if (this.component) {
|
|
@@ -714,18 +738,14 @@ class CustomTableCellDirective {
|
|
|
714
738
|
this.ref.instance.data = this.cellData;
|
|
715
739
|
}
|
|
716
740
|
static { this.ɵfac = function CustomTableCellDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CustomTableCellDirective)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); }; }
|
|
717
|
-
static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: CustomTableCellDirective, selectors: [["", "customTableCell", ""]], inputs: { customComponent: "customComponent", data: "data" } }); }
|
|
741
|
+
static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: CustomTableCellDirective, selectors: [["", "customTableCell", ""]], inputs: { customComponent: [1, "customComponent"], data: [1, "data"] } }); }
|
|
718
742
|
}
|
|
719
743
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CustomTableCellDirective, [{
|
|
720
744
|
type: Directive,
|
|
721
745
|
args: [{
|
|
722
746
|
selector: "[customTableCell]"
|
|
723
747
|
}]
|
|
724
|
-
}], () => [{ type: i0.ViewContainerRef }, { type: i0.ComponentFactoryResolver }],
|
|
725
|
-
type: Input
|
|
726
|
-
}], data: [{
|
|
727
|
-
type: Input
|
|
728
|
-
}] }); })();
|
|
748
|
+
}], () => [{ type: i0.ViewContainerRef }, { type: i0.ComponentFactoryResolver }], null); })();
|
|
729
749
|
|
|
730
750
|
const _c0$2 = ["table"];
|
|
731
751
|
const _c1$2 = (a0, a1) => ({ height: a0, width: a1 });
|
|
@@ -771,21 +791,23 @@ function SubTableComponent_div_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
771
791
|
i0.ɵɵtemplate(1, SubTableComponent_div_3_div_1_Template, 3, 9, "div", 7);
|
|
772
792
|
i0.ɵɵelementEnd();
|
|
773
793
|
} if (rf & 2) {
|
|
794
|
+
let tmp_3_0;
|
|
774
795
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
775
796
|
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction3(2, _c2$2, ctx_r2.getColHeadersRowHeight(), ctx_r2.getColHeadersRowBorderTop(), ctx_r2.getColHeadersRowBorderBottom()));
|
|
776
797
|
i0.ɵɵadvance();
|
|
777
|
-
i0.ɵɵproperty("ngForOf", ctx_r2.config == null ? null :
|
|
798
|
+
i0.ɵɵproperty("ngForOf", (tmp_3_0 = ctx_r2.config()) == null ? null : tmp_3_0.colHeaderConfig);
|
|
778
799
|
} }
|
|
779
800
|
function SubTableComponent_div_6_div_2_p_2_Template(rf, ctx) { if (rf & 1) {
|
|
780
801
|
i0.ɵɵelementStart(0, "p", 19);
|
|
781
802
|
i0.ɵɵtext(1);
|
|
782
803
|
i0.ɵɵelementEnd();
|
|
783
804
|
} if (rf & 2) {
|
|
805
|
+
let tmp_8_0;
|
|
784
806
|
const ctx_r7 = i0.ɵɵnextContext();
|
|
785
807
|
const col_r6 = ctx_r7.$implicit;
|
|
786
808
|
const i_r7 = ctx_r7.index;
|
|
787
809
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
788
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(2, _c7, (ctx_r2.config == null ? null :
|
|
810
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(2, _c7, ((tmp_8_0 = ctx_r2.config()) == null ? null : tmp_8_0.colConfig[i_r7] == null ? null : tmp_8_0.colConfig[i_r7].style == null ? null : tmp_8_0.colConfig[i_r7].style.color) ? (tmp_8_0 = ctx_r2.config()) == null ? null : tmp_8_0.colConfig[i_r7] == null ? null : tmp_8_0.colConfig[i_r7].style == null ? null : tmp_8_0.colConfig[i_r7].style.color : ""));
|
|
789
811
|
i0.ɵɵadvance();
|
|
790
812
|
i0.ɵɵtextInterpolate1(" ", col_r6, " ");
|
|
791
813
|
} }
|
|
@@ -797,26 +819,29 @@ function SubTableComponent_div_6_div_2_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
797
819
|
const col_r6 = ctx_r7.$implicit;
|
|
798
820
|
const i_r7 = ctx_r7.index;
|
|
799
821
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
800
|
-
i0.ɵɵproperty("customComponent", ctx_r2.config.colConfig[i_r7].componentRef)("data", col_r6);
|
|
822
|
+
i0.ɵɵproperty("customComponent", ctx_r2.config().colConfig[i_r7].componentRef)("data", col_r6);
|
|
801
823
|
} }
|
|
802
824
|
function SubTableComponent_div_6_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
803
825
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
804
826
|
i0.ɵɵelementStart(0, "div", 16);
|
|
805
|
-
i0.ɵɵlistener("click", function SubTableComponent_div_6_div_2_Template_div_click_0_listener() { const ctx_r4 = i0.ɵɵrestoreView(_r4); const col_r6 = ctx_r4.$implicit; const i_r7 = ctx_r4.index; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView((ctx_r2.config == null ? null :
|
|
827
|
+
i0.ɵɵlistener("click", function SubTableComponent_div_6_div_2_Template_div_click_0_listener() { let tmp_8_0; const ctx_r4 = i0.ɵɵrestoreView(_r4); const col_r6 = ctx_r4.$implicit; const i_r7 = ctx_r4.index; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(((tmp_8_0 = ctx_r2.config()) == null ? null : tmp_8_0.colConfig[i_r7] == null ? null : tmp_8_0.colConfig[i_r7].action) ? (tmp_8_0 = ctx_r2.config()) == null ? null : tmp_8_0.colConfig[i_r7] == null ? null : tmp_8_0.colConfig[i_r7].action(col_r6) : null); });
|
|
806
828
|
i0.ɵɵelementStart(1, "div", 17);
|
|
807
829
|
i0.ɵɵtemplate(2, SubTableComponent_div_6_div_2_p_2_Template, 2, 4, "p", 18)(3, SubTableComponent_div_6_div_2_3_Template, 1, 2, null, 10);
|
|
808
830
|
i0.ɵɵelementEnd()();
|
|
809
831
|
} if (rf & 2) {
|
|
832
|
+
let tmp_7_0;
|
|
833
|
+
let tmp_8_0;
|
|
834
|
+
let tmp_9_0;
|
|
810
835
|
const i_r7 = ctx.index;
|
|
811
836
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
812
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(6, _c5, (ctx_r2.config == null ? null :
|
|
837
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(6, _c5, ((tmp_7_0 = ctx_r2.config()) == null ? null : tmp_7_0.colConfig[i_r7] == null ? null : tmp_7_0.colConfig[i_r7].style == null ? null : tmp_7_0.colConfig[i_r7].style.width) || ((tmp_7_0 = ctx_r2.config()) == null ? null : tmp_7_0.colHeaderConfig[i_r7] == null ? null : tmp_7_0.colHeaderConfig[i_r7].style == null ? null : tmp_7_0.colHeaderConfig[i_r7].style.width) || ""));
|
|
813
838
|
i0.ɵɵadvance();
|
|
814
|
-
i0.ɵɵstyleMap(ctx_r2.config.colConfig[i_r7] == null ? null :
|
|
815
|
-
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction2(8, _c6, ctx_r2.config.colConfig[i_r7].action ? "pointer" : "default", (ctx_r2.config.colConfig[i_r7] == null ? null :
|
|
839
|
+
i0.ɵɵstyleMap((tmp_8_0 = ctx_r2.config().colConfig[i_r7]) == null ? null : tmp_8_0.style);
|
|
840
|
+
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction2(8, _c6, ctx_r2.config().colConfig[i_r7].action ? "pointer" : "default", ((tmp_9_0 = ctx_r2.config().colConfig[i_r7]) == null ? null : tmp_9_0.style == null ? null : tmp_9_0.style.justifyContent) ? (tmp_9_0 = ctx_r2.config().colConfig[i_r7]) == null ? null : tmp_9_0.style == null ? null : tmp_9_0.style.justifyContent : ctx_r2.config().colConfig[i_r7].type === "number" ? "flex-end" : "space-between"));
|
|
816
841
|
i0.ɵɵadvance();
|
|
817
|
-
i0.ɵɵproperty("ngIf", ctx_r2.config.colConfig[i_r7].type !== "custom");
|
|
842
|
+
i0.ɵɵproperty("ngIf", ctx_r2.config().colConfig[i_r7].type !== "custom");
|
|
818
843
|
i0.ɵɵadvance();
|
|
819
|
-
i0.ɵɵproperty("ngIf", ctx_r2.config.colConfig[i_r7].type === "custom");
|
|
844
|
+
i0.ɵɵproperty("ngIf", ctx_r2.config().colConfig[i_r7].type === "custom");
|
|
820
845
|
} }
|
|
821
846
|
function SubTableComponent_div_6_Template(rf, ctx) { if (rf & 1) {
|
|
822
847
|
i0.ɵɵelementStart(0, "div", 13)(1, "div", 14);
|
|
@@ -832,51 +857,47 @@ function SubTableComponent_div_6_Template(rf, ctx) { if (rf & 1) {
|
|
|
832
857
|
class SubTableComponent {
|
|
833
858
|
constructor(renderer) {
|
|
834
859
|
this.renderer = renderer;
|
|
835
|
-
this.selectedPage = 1;
|
|
836
|
-
this.pages = [];
|
|
837
|
-
this.
|
|
860
|
+
this.selectedPage = signal(1);
|
|
861
|
+
this.pages = signal([]);
|
|
862
|
+
this.config = input();
|
|
863
|
+
this.tableData = input([]);
|
|
838
864
|
}
|
|
839
865
|
ngOnInit() { }
|
|
840
866
|
ngAfterViewInit() {
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
this.renderer.setStyle(this.table.nativeElement, "height", height - 56 + "px");
|
|
844
|
-
}
|
|
867
|
+
let height = this.table.nativeElement.offsetHeight;
|
|
868
|
+
this.renderer.setStyle(this.table.nativeElement, "height", height - 56 + "px");
|
|
845
869
|
}
|
|
846
870
|
// Main container related functions
|
|
847
871
|
getContainerHeight() {
|
|
848
|
-
if (this.config.height)
|
|
849
|
-
return this.config.height;
|
|
872
|
+
if (this.config().height)
|
|
873
|
+
return this.config().height;
|
|
850
874
|
else
|
|
851
875
|
return "";
|
|
852
876
|
}
|
|
853
877
|
getContainerWidth() {
|
|
854
|
-
if (this.config.width)
|
|
855
|
-
return this.config.width;
|
|
878
|
+
if (this.config().width)
|
|
879
|
+
return this.config().width;
|
|
856
880
|
else
|
|
857
881
|
return "";
|
|
858
882
|
}
|
|
859
883
|
// Column Headers related functions
|
|
860
884
|
getColHeadersRowHeight() {
|
|
861
|
-
if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.height) {
|
|
862
|
-
return this.config.colHeadersRowConfig.height;
|
|
885
|
+
if (this.config().colHeadersRowConfig && this.config().colHeadersRowConfig.height) {
|
|
886
|
+
return this.config().colHeadersRowConfig.height;
|
|
863
887
|
}
|
|
864
|
-
|
|
865
|
-
return "44px";
|
|
888
|
+
return "44px";
|
|
866
889
|
}
|
|
867
890
|
getColHeadersRowBorderTop() {
|
|
868
|
-
if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderTop) {
|
|
869
|
-
return this.config.colHeadersRowConfig.style?.borderTop;
|
|
891
|
+
if (this.config().colHeadersRowConfig && this.config().colHeadersRowConfig.style?.borderTop) {
|
|
892
|
+
return this.config().colHeadersRowConfig.style?.borderTop;
|
|
870
893
|
}
|
|
871
|
-
|
|
872
|
-
return "";
|
|
894
|
+
return "";
|
|
873
895
|
}
|
|
874
896
|
getColHeadersRowBorderBottom() {
|
|
875
|
-
if (this.config.colHeadersRowConfig && this.config.colHeadersRowConfig.style?.borderBottom) {
|
|
876
|
-
return this.config.colHeadersRowConfig.style?.borderBottom;
|
|
897
|
+
if (this.config().colHeadersRowConfig && this.config().colHeadersRowConfig.style?.borderBottom) {
|
|
898
|
+
return this.config().colHeadersRowConfig.style?.borderBottom;
|
|
877
899
|
}
|
|
878
|
-
|
|
879
|
-
return "1px solid #E0E0E0";
|
|
900
|
+
return "1px solid #E0E0E0";
|
|
880
901
|
}
|
|
881
902
|
static { this.ɵfac = function SubTableComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubTableComponent)(i0.ɵɵdirectiveInject(i0.Renderer2)); }; }
|
|
882
903
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SubTableComponent, selectors: [["sub-table"]], viewQuery: function SubTableComponent_Query(rf, ctx) { if (rf & 1) {
|
|
@@ -884,7 +905,7 @@ class SubTableComponent {
|
|
|
884
905
|
} if (rf & 2) {
|
|
885
906
|
let _t;
|
|
886
907
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.table = _t.first);
|
|
887
|
-
} }, inputs: { config: "config", tableData: "tableData" }, decls: 7, vars: 12, consts: [["table", ""], ["id", "main-container", 3, "ngStyle"], ["id", "table-container"], ["id", "col-headers-container", 3, "ngStyle", 4, "ngIf"], ["itemSize", "50", "id", "data-container", 3, "minBufferPx", "maxBufferPx"], ["class", "row-wrapper", 3, "ngStyle", 4, "cdkVirtualFor", "cdkVirtualForOf"], ["id", "col-headers-container", 3, "ngStyle"], ["class", "col-header", 3, "style", "ngStyle", "click", 4, "ngFor", "ngForOf"], [1, "col-header", 3, "click", "ngStyle"], ["class", "col-header-text", 4, "ngIf"], [4, "ngIf"], [1, "col-header-text"], ["customTableCell", "", 3, "customComponent", "data"], [1, "row-wrapper", 3, "ngStyle"], [1, "t-row"], ["class", "t-col-container", 3, "ngStyle", "click", 4, "ngFor", "ngForOf"], [1, "t-col-container", 3, "click", "ngStyle"], [1, "t-col", 3, "ngStyle"], ["class", "t-col-text", 3, "ngStyle", 4, "ngIf"], [1, "t-col-text", 3, "ngStyle"]], template: function SubTableComponent_Template(rf, ctx) { if (rf & 1) {
|
|
908
|
+
} }, inputs: { config: [1, "config"], tableData: [1, "tableData"] }, decls: 7, vars: 12, consts: [["table", ""], ["id", "main-container", 3, "ngStyle"], ["id", "table-container"], ["id", "col-headers-container", 3, "ngStyle", 4, "ngIf"], ["itemSize", "50", "id", "data-container", 3, "minBufferPx", "maxBufferPx"], ["class", "row-wrapper", 3, "ngStyle", 4, "cdkVirtualFor", "cdkVirtualForOf"], ["id", "col-headers-container", 3, "ngStyle"], ["class", "col-header", 3, "style", "ngStyle", "click", 4, "ngFor", "ngForOf"], [1, "col-header", 3, "click", "ngStyle"], ["class", "col-header-text", 4, "ngIf"], [4, "ngIf"], [1, "col-header-text"], ["customTableCell", "", 3, "customComponent", "data"], [1, "row-wrapper", 3, "ngStyle"], [1, "t-row"], ["class", "t-col-container", 3, "ngStyle", "click", 4, "ngFor", "ngForOf"], [1, "t-col-container", 3, "click", "ngStyle"], [1, "t-col", 3, "ngStyle"], ["class", "t-col-text", 3, "ngStyle", 4, "ngIf"], [1, "t-col-text", 3, "ngStyle"]], template: function SubTableComponent_Template(rf, ctx) { if (rf & 1) {
|
|
888
909
|
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2, 0);
|
|
889
910
|
i0.ɵɵtemplate(3, SubTableComponent_div_3_Template, 2, 6, "div", 3);
|
|
890
911
|
i0.ɵɵelementStart(4, "div")(5, "cdk-virtual-scroll-viewport", 4);
|
|
@@ -893,22 +914,18 @@ class SubTableComponent {
|
|
|
893
914
|
} if (rf & 2) {
|
|
894
915
|
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction2(9, _c1$2, ctx.getContainerHeight(), ctx.getContainerWidth()));
|
|
895
916
|
i0.ɵɵadvance(3);
|
|
896
|
-
i0.ɵɵproperty("ngIf", !!ctx.config.showHeader);
|
|
917
|
+
i0.ɵɵproperty("ngIf", !!ctx.config().showHeader);
|
|
897
918
|
i0.ɵɵadvance(2);
|
|
898
|
-
i0.ɵɵstyleProp("overflow", "overlay")("height", ctx.config.dataContainerMaxHeight || "400px");
|
|
899
|
-
i0.ɵɵproperty("minBufferPx", ctx.config.dataContainerMaxHeight || "400")("maxBufferPx", ctx.config.dataContainerMaxHeight + 200 || "600");
|
|
919
|
+
i0.ɵɵstyleProp("overflow", "overlay")("height", ctx.config().dataContainerMaxHeight || "400px");
|
|
920
|
+
i0.ɵɵproperty("minBufferPx", ctx.config().dataContainerMaxHeight || "400")("maxBufferPx", ctx.config().dataContainerMaxHeight + 200 || "600");
|
|
900
921
|
i0.ɵɵadvance();
|
|
901
922
|
i0.ɵɵproperty("cdkVirtualForOf", ctx.tableData);
|
|
902
|
-
} }, dependencies: [i1.NgForOf, i1.NgIf, i1.NgStyle, i2.CdkFixedSizeVirtualScroll, i2.CdkVirtualForOf, i2.CdkVirtualScrollViewport, CustomTableCellDirective], styles: ["#main-container[_ngcontent-%COMP%]{font-family:Lato,sans-serif}#table-container[_ngcontent-%COMP%]{height:inherit}#col-headers-container[_ngcontent-%COMP%]{display:flex;background-color
|
|
923
|
+
} }, dependencies: [i1.NgForOf, i1.NgIf, i1.NgStyle, i2.CdkFixedSizeVirtualScroll, i2.CdkVirtualForOf, i2.CdkVirtualScrollViewport, CustomTableCellDirective], styles: ["#main-container[_ngcontent-%COMP%]{font-family:Lato,sans-serif}#table-container[_ngcontent-%COMP%]{height:inherit}#col-headers-container[_ngcontent-%COMP%]{display:flex;background-color:#fff;height:36px;border-bottom:1px solid #e0e0e0}#data-container[_ngcontent-%COMP%]{overflow:scroll;width:100%}#data-container[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}#data-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9aa7b4}.col-header[_ngcontent-%COMP%]{height:100%;width:160px;display:flex;align-items:center;padding:0 16px}.col-header-text[_ngcontent-%COMP%]{font-style:normal;font-weight:700;font-size:14px;line-height:20px;display:flex;align-items:center;letter-spacing:.25px;margin:0}.t-row[_ngcontent-%COMP%]{display:flex;align-items:center;height:36px;width:100%;border-bottom:1px solid #e0e0e0}.t-row[_ngcontent-%COMP%]:hover{background-color:#f1fdf8}.t-col-container[_ngcontent-%COMP%]{padding:0 16px;height:100%}.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;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:flex;align-items:center;letter-spacing:.2px;margin:0}"] }); }
|
|
903
924
|
}
|
|
904
925
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubTableComponent, [{
|
|
905
926
|
type: Component,
|
|
906
|
-
args: [{ selector: "sub-table", template: "<div\n id=\"main-container\"\n [ngStyle]=\"{\n height: getContainerHeight(),\n width: getContainerWidth()\n }\"\n>\n <div id=\"table-container\" #table>\n <div\n id=\"col-headers-container\"\n *ngIf=\"!!config.showHeader\"\n [ngStyle]=\"{\n height: getColHeadersRowHeight(),\n 'border-top': getColHeadersRowBorderTop(),\n 'border-bottom': getColHeadersRowBorderBottom()\n }\"\n >\n <div\n class=\"col-header\"\n (click)=\"colHeader?.action ? colHeader?.action(colHeader) : null\"\n *ngFor=\"let colHeader of config?.colHeaderConfig\"\n [style]=\"colHeader?.style\"\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 <ng-template\n *ngIf=\"colHeader?.type === 'custom'\"\n customTableCell\n [customComponent]=\"colHeader?.componentRef\"\n [data]=\"colHeader.data\"\n ></ng-template>\n </div>\n </div>\n <div>\n <cdk-virtual-scroll-viewport\n [minBufferPx]=\"config.dataContainerMaxHeight || '400'\"\n [maxBufferPx]=\"config.dataContainerMaxHeight + 200 || '600'\"\n [style.overflow]=\"'overlay'\"\n [style.height]=\"config.dataContainerMaxHeight || '400px'\"\n itemSize=\"50\"\n id=\"data-container\"\n >\n <div\n class=\"row-wrapper\"\n *cdkVirtualFor=\"let row of tableData; let i = index\"\n [ngStyle]=\"{\n backgroundColor: i % 2 === 0 ? '#FAFAFA' : null\n }\"\n >\n <div class=\"t-row\">\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 >\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>\n </cdk-virtual-scroll-viewport>\n </div>\n </div>\n</div>\n", styles: ["#main-container{font-family:Lato,sans-serif}#table-container{height:inherit}#col-headers-container{display:flex;background-color
|
|
907
|
-
}], () => [{ type: i0.Renderer2 }], {
|
|
908
|
-
type: Input
|
|
909
|
-
}], tableData: [{
|
|
910
|
-
type: Input
|
|
911
|
-
}], table: [{
|
|
927
|
+
args: [{ selector: "sub-table", template: "<div\n id=\"main-container\"\n [ngStyle]=\"{\n height: getContainerHeight(),\n width: getContainerWidth()\n }\"\n>\n <div id=\"table-container\" #table>\n <div\n id=\"col-headers-container\"\n *ngIf=\"!!config().showHeader\"\n [ngStyle]=\"{\n height: getColHeadersRowHeight(),\n 'border-top': getColHeadersRowBorderTop(),\n 'border-bottom': getColHeadersRowBorderBottom()\n }\"\n >\n <div\n class=\"col-header\"\n (click)=\"colHeader?.action ? colHeader?.action(colHeader) : null\"\n *ngFor=\"let colHeader of config()?.colHeaderConfig\"\n [style]=\"colHeader?.style\"\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 <ng-template\n *ngIf=\"colHeader?.type === 'custom'\"\n customTableCell\n [customComponent]=\"colHeader?.componentRef\"\n [data]=\"colHeader.data\"\n ></ng-template>\n </div>\n </div>\n <div>\n <cdk-virtual-scroll-viewport\n [minBufferPx]=\"config().dataContainerMaxHeight || '400'\"\n [maxBufferPx]=\"config().dataContainerMaxHeight + 200 || '600'\"\n [style.overflow]=\"'overlay'\"\n [style.height]=\"config().dataContainerMaxHeight || '400px'\"\n itemSize=\"50\"\n id=\"data-container\"\n >\n <div\n class=\"row-wrapper\"\n *cdkVirtualFor=\"let row of tableData; let i = index\"\n [ngStyle]=\"{\n backgroundColor: i % 2 === 0 ? '#FAFAFA' : null\n }\"\n >\n <div class=\"t-row\">\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 >\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>\n </cdk-virtual-scroll-viewport>\n </div>\n </div>\n</div>\n", styles: ["#main-container{font-family:Lato,sans-serif}#table-container{height:inherit}#col-headers-container{display:flex;background-color:#fff;height:36px;border-bottom:1px solid #e0e0e0}#data-container{overflow:scroll;width:100%}#data-container::-webkit-scrollbar{width:8px}#data-container::-webkit-scrollbar-thumb{background:#9aa7b4}.col-header{height:100%;width:160px;display:flex;align-items:center;padding:0 16px}.col-header-text{font-style:normal;font-weight:700;font-size:14px;line-height:20px;display:flex;align-items:center;letter-spacing:.25px;margin:0}.t-row{display:flex;align-items:center;height:36px;width:100%;border-bottom:1px solid #e0e0e0}.t-row:hover{background-color:#f1fdf8}.t-col-container{padding:0 16px;height:100%}.t-col{display:flex;align-items:center;height:100%}.t-col-text{font-style:normal;font-weight:400;font-size:14px;line-height:20px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:flex;align-items:center;letter-spacing:.2px;margin:0}\n"] }]
|
|
928
|
+
}], () => [{ type: i0.Renderer2 }], { table: [{
|
|
912
929
|
type: ViewChild,
|
|
913
930
|
args: ["table"]
|
|
914
931
|
}] }); })();
|
|
@@ -968,34 +985,48 @@ function TableFilterComponent_div_12_Template(rf, ctx) { if (rf & 1) {
|
|
|
968
985
|
} }
|
|
969
986
|
class TableFilterComponent {
|
|
970
987
|
constructor() {
|
|
971
|
-
this.filtersData = [];
|
|
972
|
-
this.containerStyles = {};
|
|
973
|
-
this.filtersApplied =
|
|
974
|
-
this.filtersMap = {};
|
|
975
|
-
this.searchValue = "";
|
|
988
|
+
this.filtersData = input([]);
|
|
989
|
+
this.containerStyles = input({});
|
|
990
|
+
this.filtersApplied = output();
|
|
991
|
+
this.filtersMap = signal({});
|
|
992
|
+
this.searchValue = signal("");
|
|
976
993
|
this.mySort = (a, b) => {
|
|
977
|
-
|
|
978
|
-
return -1;
|
|
979
|
-
else if (b.name < a.name)
|
|
980
|
-
return 1;
|
|
981
|
-
else
|
|
982
|
-
return 0;
|
|
994
|
+
return a.name.localeCompare(b.name);
|
|
983
995
|
};
|
|
984
996
|
}
|
|
985
997
|
ngOnInit() {
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
998
|
+
const newFiltersMap = {};
|
|
999
|
+
const filters = this.filtersData() || [];
|
|
1000
|
+
if (Array.isArray(filters) && filters.length > 0) {
|
|
1001
|
+
filters.forEach(filter => {
|
|
1002
|
+
if (filter && filter.value) {
|
|
1003
|
+
newFiltersMap[filter.value] = filter;
|
|
1004
|
+
}
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
this.filtersMap.set(newFiltersMap);
|
|
989
1008
|
}
|
|
990
1009
|
resetFilters() {
|
|
991
|
-
this.
|
|
992
|
-
|
|
993
|
-
|
|
1010
|
+
const currentFiltersMap = this.filtersMap();
|
|
1011
|
+
const filters = this.filtersData() || [];
|
|
1012
|
+
if (filters.length > 0) {
|
|
1013
|
+
filters.forEach(filter => {
|
|
1014
|
+
if (filter && filter.value && currentFiltersMap[filter.value]) {
|
|
1015
|
+
currentFiltersMap[filter.value].checked = false;
|
|
1016
|
+
}
|
|
1017
|
+
});
|
|
1018
|
+
this.filtersMap.set({ ...currentFiltersMap });
|
|
1019
|
+
}
|
|
994
1020
|
this.filtersApplied.emit([]);
|
|
995
1021
|
}
|
|
996
1022
|
applyFilters() {
|
|
997
|
-
|
|
998
|
-
|
|
1023
|
+
const filtersMap = this.filtersMap();
|
|
1024
|
+
if (!filtersMap || Object.keys(filtersMap).length === 0) {
|
|
1025
|
+
this.filtersApplied.emit([]);
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
let list = Object.values(filtersMap)
|
|
1029
|
+
.filter((filter) => filter && filter.checked)
|
|
999
1030
|
.map((filter) => {
|
|
1000
1031
|
return {
|
|
1001
1032
|
name: filter.name,
|
|
@@ -1004,24 +1035,34 @@ class TableFilterComponent {
|
|
|
1004
1035
|
});
|
|
1005
1036
|
this.filtersApplied.emit(list);
|
|
1006
1037
|
}
|
|
1007
|
-
updateSearchValue(event) {
|
|
1008
|
-
this.searchValue = event.target.value;
|
|
1009
|
-
}
|
|
1010
1038
|
updateFilter(data) {
|
|
1011
|
-
|
|
1012
|
-
|
|
1039
|
+
const currentFiltersMap = this.filtersMap();
|
|
1040
|
+
if (currentFiltersMap && data && data.name && currentFiltersMap[data.name]) {
|
|
1041
|
+
currentFiltersMap[data.name].checked = !currentFiltersMap[data.name].checked;
|
|
1042
|
+
this.filtersMap.set({ ...currentFiltersMap });
|
|
1013
1043
|
}
|
|
1014
1044
|
}
|
|
1045
|
+
updateSearchValue(event) {
|
|
1046
|
+
this.searchValue.set(event.target.value);
|
|
1047
|
+
}
|
|
1015
1048
|
getFiltersBasedOnSearchValue() {
|
|
1016
|
-
|
|
1049
|
+
const filtersMap = this.filtersMap();
|
|
1050
|
+
if (!filtersMap || Object.keys(filtersMap).length === 0) {
|
|
1051
|
+
return [];
|
|
1052
|
+
}
|
|
1053
|
+
let list = Object.values(filtersMap);
|
|
1017
1054
|
list = list.filter((filter) => {
|
|
1018
|
-
return filter.name.match(new RegExp(this.searchValue, "i"));
|
|
1055
|
+
return filter && filter.name && filter.name.match(new RegExp(this.searchValue(), "i"));
|
|
1019
1056
|
});
|
|
1020
1057
|
return list.sort(this.mySort);
|
|
1021
1058
|
}
|
|
1022
1059
|
getCheckedFilters() {
|
|
1023
|
-
|
|
1024
|
-
|
|
1060
|
+
const filtersMap = this.filtersMap();
|
|
1061
|
+
if (!filtersMap || Object.keys(filtersMap).length === 0) {
|
|
1062
|
+
return [];
|
|
1063
|
+
}
|
|
1064
|
+
let list = Object.values(filtersMap);
|
|
1065
|
+
list = list.filter((filter) => filter && filter.checked).sort(this.mySort);
|
|
1025
1066
|
return list;
|
|
1026
1067
|
}
|
|
1027
1068
|
static { this.ɵfac = function TableFilterComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TableFilterComponent)(); }; }
|
|
@@ -1030,7 +1071,7 @@ class TableFilterComponent {
|
|
|
1030
1071
|
} if (rf & 2) {
|
|
1031
1072
|
let _t;
|
|
1032
1073
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.container = _t.first);
|
|
1033
|
-
} }, inputs: { filtersData: "filtersData", containerStyles: "containerStyles" }, outputs: { filtersApplied: "filtersApplied" }, decls: 19, vars: 9, consts: [["mainContainer", ""], ["id", "main-container", 3, "ngStyle"], ["id", "search-bar-container"], ["type", "text", "placeholder", "Search", 3, "keyup"], ["id", "search-icon", "width", "18", "height", "18", "viewBox", "0 0 18 18", "fill", "none", "xmlns", "http://www.w3.org/2000/svg"], ["fill-rule", "evenodd", "clip-rule", "evenodd", "d", "M1.21496 8.14563C1.21496 4.3179 4.33709 1.21165 8.19249 1.21165C12.0479 1.21165 15.17 4.3179 15.17 8.14563C15.17 9.69308 14.6598 11.1226 13.797 12.2767L12.3684 13.7013C11.2043 14.5668 9.75891 15.0796 8.19249 15.0796C4.33709 15.0796 1.21496 11.9734 1.21496 8.14563ZM12.9419 14.7835C11.602 15.7329 9.96259 16.2913 8.19249 16.2913C3.66965 16.2913 -0.00012207 12.6461 -0.00012207 8.14563C-0.00012207 3.64512 3.66965 0 8.19249 0C12.7153 0 16.3851 3.64512 16.3851 8.14563C16.3851 9.93713 15.8036 11.5931 14.8183 12.9375L16.836 14.4048C17.6704 14.912 18.7553 15.6543 17.2453 17.215C15.7352 18.7756 15.0098 17.6663 14.499 16.8364L12.9419 14.7835Z", "fill", "#6A737D"], ["id", "filters-main-container"], [1, "filters-sub-container"], [4, "ngFor", "ngForOf"], ["class", "separator", 3, "ngStyle", 4, "ngIf"], ["id", "no-results-container", 4, "ngIf"], [1, "separator", 3, "ngStyle"], ["id", "buttons-container"], ["id", "reset-btn", 3, "click", "ngStyle"], ["id", "apply-btn", 3, "click"], [1, "filter"], [3, "valueChange", "checked", "name"], [1, "filter-text"], ["class", "filter", 4, "ngIf"], ["id", "no-results-container"]], template: function TableFilterComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1074
|
+
} }, inputs: { filtersData: [1, "filtersData"], containerStyles: [1, "containerStyles"] }, outputs: { filtersApplied: "filtersApplied" }, decls: 19, vars: 9, consts: [["mainContainer", ""], ["id", "main-container", 3, "ngStyle"], ["id", "search-bar-container"], ["type", "text", "placeholder", "Search", 3, "keyup"], ["id", "search-icon", "width", "18", "height", "18", "viewBox", "0 0 18 18", "fill", "none", "xmlns", "http://www.w3.org/2000/svg"], ["fill-rule", "evenodd", "clip-rule", "evenodd", "d", "M1.21496 8.14563C1.21496 4.3179 4.33709 1.21165 8.19249 1.21165C12.0479 1.21165 15.17 4.3179 15.17 8.14563C15.17 9.69308 14.6598 11.1226 13.797 12.2767L12.3684 13.7013C11.2043 14.5668 9.75891 15.0796 8.19249 15.0796C4.33709 15.0796 1.21496 11.9734 1.21496 8.14563ZM12.9419 14.7835C11.602 15.7329 9.96259 16.2913 8.19249 16.2913C3.66965 16.2913 -0.00012207 12.6461 -0.00012207 8.14563C-0.00012207 3.64512 3.66965 0 8.19249 0C12.7153 0 16.3851 3.64512 16.3851 8.14563C16.3851 9.93713 15.8036 11.5931 14.8183 12.9375L16.836 14.4048C17.6704 14.912 18.7553 15.6543 17.2453 17.215C15.7352 18.7756 15.0098 17.6663 14.499 16.8364L12.9419 14.7835Z", "fill", "#6A737D"], ["id", "filters-main-container"], [1, "filters-sub-container"], [4, "ngFor", "ngForOf"], ["class", "separator", 3, "ngStyle", 4, "ngIf"], ["id", "no-results-container", 4, "ngIf"], [1, "separator", 3, "ngStyle"], ["id", "buttons-container"], ["id", "reset-btn", 3, "click", "ngStyle"], ["id", "apply-btn", 3, "click"], [1, "filter"], [3, "valueChange", "checked", "name"], [1, "filter-text"], ["class", "filter", 4, "ngIf"], ["id", "no-results-container"]], template: function TableFilterComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1034
1075
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
1035
1076
|
i0.ɵɵelementStart(0, "div", 1, 0)(2, "div", 2)(3, "input", 3);
|
|
1036
1077
|
i0.ɵɵlistener("keyup", function TableFilterComponent_Template_input_keyup_3_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.updateSearchValue($event)); });
|
|
@@ -1057,11 +1098,11 @@ class TableFilterComponent {
|
|
|
1057
1098
|
i0.ɵɵtext(18, "Apply");
|
|
1058
1099
|
i0.ɵɵelementEnd()()()();
|
|
1059
1100
|
} if (rf & 2) {
|
|
1060
|
-
i0.ɵɵproperty("ngStyle", ctx.containerStyles);
|
|
1101
|
+
i0.ɵɵproperty("ngStyle", ctx.containerStyles());
|
|
1061
1102
|
i0.ɵɵadvance(8);
|
|
1062
1103
|
i0.ɵɵproperty("ngForOf", ctx.getCheckedFilters());
|
|
1063
1104
|
i0.ɵɵadvance();
|
|
1064
|
-
i0.ɵɵproperty("ngIf", ctx.getCheckedFilters().length && ctx.getCheckedFilters().length < ctx.filtersData.length);
|
|
1105
|
+
i0.ɵɵproperty("ngIf", ctx.getCheckedFilters().length && ctx.getCheckedFilters().length < ctx.filtersData().length);
|
|
1065
1106
|
i0.ɵɵadvance(2);
|
|
1066
1107
|
i0.ɵɵproperty("ngForOf", ctx.getFiltersBasedOnSearchValue());
|
|
1067
1108
|
i0.ɵɵadvance();
|
|
@@ -1070,18 +1111,12 @@ class TableFilterComponent {
|
|
|
1070
1111
|
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction0(7, _c1$1));
|
|
1071
1112
|
i0.ɵɵadvance(2);
|
|
1072
1113
|
i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction0(8, _c2$1));
|
|
1073
|
-
} }, dependencies: [i1.NgForOf, i1.NgIf, i1.NgStyle, i2$1.CheckboxComponent], styles: ["#main-container[_ngcontent-%COMP%]{position:absolute;background
|
|
1114
|
+
} }, dependencies: [i1.NgForOf, i1.NgIf, i1.NgStyle, i2$1.CheckboxComponent], styles: ["#main-container[_ngcontent-%COMP%]{position:absolute;background:#fff;z-index:2;right:calc(50% - 128px);width:256px;min-height:200px;max-height:400px;padding:16px;font-family:Lato,sans-serif;box-shadow:0 12px 24px #0000001f,0 4px 8px #0000001f;border-radius:8px;overflow:hidden;box-sizing:border-box}[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px;height:8px}[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#9aa7b4}#search-bar-container[_ngcontent-%COMP%]{width:100%;position:relative;margin-bottom:8px;box-sizing:border-box}input[_ngcontent-%COMP%]{width:100%;max-width:100%;padding:12px 12px 12px 42px;border:solid 1px black;border-radius:4px;height:48px;box-shadow:none;outline:none;font-style:normal;font-weight:400;font-size:15px;line-height:20px;letter-spacing:.1px;color:#181f33;box-sizing:border-box;overflow:hidden}input[_ngcontent-%COMP%]:focus{border:solid 1px #0937b2}#search-icon[_ngcontent-%COMP%]{position:absolute;top:15px;left:12px}.filters-sub-container[_ngcontent-%COMP%]{max-height:144px;overflow-y:auto}.filter[_ngcontent-%COMP%]{height:36px;display:flex;justify-content:flex-start;align-items:center}.filter-text[_ngcontent-%COMP%]{font-size:14px;line-height:20px;padding-left:8px;letter-spacing:.2px;color:#181f33;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#no-results-container[_ngcontent-%COMP%]{height:36px;display:flex;justify-content:center;align-items:center}.no-filters-container[_ngcontent-%COMP%]{height:60px;display:flex;justify-content:center;align-items:center;text-align:center;padding:16px}.separator[_ngcontent-%COMP%]{border:1px solid #e0e0e0}#buttons-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}button[_ngcontent-%COMP%]{width:calc(50% - 4px);border:none;box-shadow:none;outline:none;font-size:16px;line-height:24px;text-align:center;letter-spacing:.2px;padding:10px 30px;background:none;border-radius:8px}#apply-btn[_ngcontent-%COMP%]{background:#0937b2;color:#fff}#reset-btn[_ngcontent-%COMP%]{background:#fff;color:#0937b2}"] }); }
|
|
1074
1115
|
}
|
|
1075
1116
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableFilterComponent, [{
|
|
1076
1117
|
type: Component,
|
|
1077
|
-
args: [{ selector: "mis-table-filter", template: "<div id=\"main-container\" #mainContainer [ngStyle]=\"containerStyles\">\n <div id=\"search-bar-container\">\n <input (keyup)=\"updateSearchValue($event)\" type=\"text\" placeholder=\"Search\" />\n <svg id=\"search-icon\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M1.21496 8.14563C1.21496 4.3179 4.33709 1.21165 8.19249 1.21165C12.0479 1.21165 15.17 4.3179 15.17 8.14563C15.17 9.69308 14.6598 11.1226 13.797 12.2767L12.3684 13.7013C11.2043 14.5668 9.75891 15.0796 8.19249 15.0796C4.33709 15.0796 1.21496 11.9734 1.21496 8.14563ZM12.9419 14.7835C11.602 15.7329 9.96259 16.2913 8.19249 16.2913C3.66965 16.2913 -0.00012207 12.6461 -0.00012207 8.14563C-0.00012207 3.64512 3.66965 0 8.19249 0C12.7153 0 16.3851 3.64512 16.3851 8.14563C16.3851 9.93713 15.8036 11.5931 14.8183 12.9375L16.836 14.4048C17.6704 14.912 18.7553 15.6543 17.2453 17.215C15.7352 18.7756 15.0098 17.6663 14.499 16.8364L12.9419 14.7835Z\"\n fill=\"#6A737D\"\n />\n </svg>\n </div>\n <div id=\"filters-main-container\">\n
|
|
1078
|
-
}], () => [], {
|
|
1079
|
-
type: Input
|
|
1080
|
-
}], containerStyles: [{
|
|
1081
|
-
type: Input
|
|
1082
|
-
}], filtersApplied: [{
|
|
1083
|
-
type: Output
|
|
1084
|
-
}], container: [{
|
|
1118
|
+
args: [{ selector: "mis-table-filter", template: "<div id=\"main-container\" #mainContainer [ngStyle]=\"containerStyles()\">\n <div id=\"search-bar-container\">\n <input (keyup)=\"updateSearchValue($event)\" type=\"text\" placeholder=\"Search\" />\n <svg id=\"search-icon\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M1.21496 8.14563C1.21496 4.3179 4.33709 1.21165 8.19249 1.21165C12.0479 1.21165 15.17 4.3179 15.17 8.14563C15.17 9.69308 14.6598 11.1226 13.797 12.2767L12.3684 13.7013C11.2043 14.5668 9.75891 15.0796 8.19249 15.0796C4.33709 15.0796 1.21496 11.9734 1.21496 8.14563ZM12.9419 14.7835C11.602 15.7329 9.96259 16.2913 8.19249 16.2913C3.66965 16.2913 -0.00012207 12.6461 -0.00012207 8.14563C-0.00012207 3.64512 3.66965 0 8.19249 0C12.7153 0 16.3851 3.64512 16.3851 8.14563C16.3851 9.93713 15.8036 11.5931 14.8183 12.9375L16.836 14.4048C17.6704 14.912 18.7553 15.6543 17.2453 17.215C15.7352 18.7756 15.0098 17.6663 14.499 16.8364L12.9419 14.7835Z\"\n fill=\"#6A737D\"\n />\n </svg>\n </div>\n <div id=\"filters-main-container\">\n <div class=\"filters-sub-container\">\n <div *ngFor=\"let filter of getCheckedFilters()\">\n <div class=\"filter\">\n <mis-checkbox [checked]=\"true\" [name]=\"filter.value\" (valueChange)=\"updateFilter($event)\"></mis-checkbox>\n <span class=\"filter-text\">{{ filter.name }}</span>\n </div>\n </div>\n </div>\n <div class=\"separator\" [ngStyle]=\"{ 'margin': '16px 0px' }\" *ngIf=\"getCheckedFilters().length && getCheckedFilters().length < filtersData().length\"></div>\n <div class=\"filters-sub-container\">\n <div *ngFor=\"let filter of getFiltersBasedOnSearchValue()\">\n <div class=\"filter\" *ngIf=\"!filter.checked\">\n <mis-checkbox [checked]=\"false\" [name]=\"filter.value\" (valueChange)=\"updateFilter($event)\"></mis-checkbox>\n <span class=\"filter-text\">{{ filter.name }}</span>\n </div>\n </div>\n <div id=\"no-results-container\" *ngIf=\"getFiltersBasedOnSearchValue().length < 1\">\n <span class=\"filter-text\">No matches found</span>\n </div>\n </div>\n \n <div class=\"separator\" [ngStyle]=\"{ 'margin': '16px 0px' }\"></div>\n <div id=\"buttons-container\">\n <button id=\"reset-btn\" [ngStyle]=\"{ 'margin-right': '8px' }\" (click)=\"resetFilters()\">Reset</button>\n <button id=\"apply-btn\" (click)=\"applyFilters()\">Apply</button>\n </div>\n </div>\n</div>", styles: ["#main-container{position:absolute;background:#fff;z-index:2;right:calc(50% - 128px);width:256px;min-height:200px;max-height:400px;padding:16px;font-family:Lato,sans-serif;box-shadow:0 12px 24px #0000001f,0 4px 8px #0000001f;border-radius:8px;overflow:hidden;box-sizing:border-box}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:#9aa7b4}#search-bar-container{width:100%;position:relative;margin-bottom:8px;box-sizing:border-box}input{width:100%;max-width:100%;padding:12px 12px 12px 42px;border:solid 1px black;border-radius:4px;height:48px;box-shadow:none;outline:none;font-style:normal;font-weight:400;font-size:15px;line-height:20px;letter-spacing:.1px;color:#181f33;box-sizing:border-box;overflow:hidden}input:focus{border:solid 1px #0937b2}#search-icon{position:absolute;top:15px;left:12px}.filters-sub-container{max-height:144px;overflow-y:auto}.filter{height:36px;display:flex;justify-content:flex-start;align-items:center}.filter-text{font-size:14px;line-height:20px;padding-left:8px;letter-spacing:.2px;color:#181f33;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#no-results-container{height:36px;display:flex;justify-content:center;align-items:center}.no-filters-container{height:60px;display:flex;justify-content:center;align-items:center;text-align:center;padding:16px}.separator{border:1px solid #e0e0e0}#buttons-container{display:flex;justify-content:center;align-items:center}button{width:calc(50% - 4px);border:none;box-shadow:none;outline:none;font-size:16px;line-height:24px;text-align:center;letter-spacing:.2px;padding:10px 30px;background:none;border-radius:8px}#apply-btn{background:#0937b2;color:#fff}#reset-btn{background:#fff;color:#0937b2}\n"] }]
|
|
1119
|
+
}], () => [], { container: [{
|
|
1085
1120
|
type: ViewChild,
|
|
1086
1121
|
args: ["mainContainer"]
|
|
1087
1122
|
}] }); })();
|
|
@@ -1165,22 +1200,26 @@ class SortIconsDirective {
|
|
|
1165
1200
|
this.updateIconStyles();
|
|
1166
1201
|
}
|
|
1167
1202
|
handleMultiColumnSort(direction) {
|
|
1168
|
-
const
|
|
1203
|
+
const activeSorts = this.activeSorts();
|
|
1204
|
+
if (!Array.isArray(activeSorts)) {
|
|
1205
|
+
return;
|
|
1206
|
+
}
|
|
1207
|
+
const existingSortIndex = activeSorts.findIndex(sort => sort.column === this.column()?.data);
|
|
1169
1208
|
if (existingSortIndex !== -1) {
|
|
1170
|
-
if (
|
|
1171
|
-
|
|
1209
|
+
if (activeSorts[existingSortIndex].direction !== direction) {
|
|
1210
|
+
activeSorts[existingSortIndex].direction = direction;
|
|
1172
1211
|
}
|
|
1173
1212
|
else {
|
|
1174
1213
|
return;
|
|
1175
1214
|
}
|
|
1176
1215
|
}
|
|
1177
1216
|
else {
|
|
1178
|
-
|
|
1217
|
+
activeSorts.push({
|
|
1179
1218
|
column: this.column()?.data || '',
|
|
1180
1219
|
direction
|
|
1181
1220
|
});
|
|
1182
1221
|
}
|
|
1183
|
-
this.multiSortChange.emit([...
|
|
1222
|
+
this.multiSortChange.emit([...activeSorts]);
|
|
1184
1223
|
this.updateIconStyles();
|
|
1185
1224
|
}
|
|
1186
1225
|
updateIconStyles() {
|
|
@@ -1199,12 +1238,16 @@ class SortIconsDirective {
|
|
|
1199
1238
|
}, 0);
|
|
1200
1239
|
}
|
|
1201
1240
|
updateMultiColumnIconStyles() {
|
|
1202
|
-
const
|
|
1241
|
+
const activeSorts = this.activeSorts();
|
|
1242
|
+
if (!Array.isArray(activeSorts)) {
|
|
1243
|
+
return;
|
|
1244
|
+
}
|
|
1245
|
+
const columnSort = activeSorts.find(sort => sort.column === this.column()?.data);
|
|
1203
1246
|
setTimeout(() => {
|
|
1204
1247
|
this.renderer?.setStyle(this.upIcon, 'opacity', columnSort?.direction === 'ASC' ? '1' : '0.5');
|
|
1205
1248
|
this.renderer?.setStyle(this.downIcon, 'opacity', columnSort?.direction === 'DESC' ? '1' : '0.5');
|
|
1206
1249
|
if (this.sortOrderElement) {
|
|
1207
|
-
const sortIndex =
|
|
1250
|
+
const sortIndex = activeSorts.findIndex(sort => sort.column === this.column()?.data);
|
|
1208
1251
|
if (sortIndex !== -1) {
|
|
1209
1252
|
this.renderer?.setProperty(this.sortOrderElement, 'textContent', (sortIndex + 1).toString());
|
|
1210
1253
|
}
|
|
@@ -1247,7 +1290,7 @@ function ActionsCellComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
1247
1290
|
} if (rf & 2) {
|
|
1248
1291
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
1249
1292
|
i0.ɵɵadvance();
|
|
1250
|
-
i0.ɵɵproperty("ngForOf", ctx_r2.actionItems)("ngForTrackBy", ctx_r2.trackByAction);
|
|
1293
|
+
i0.ɵɵproperty("ngForOf", ctx_r2.actionItems())("ngForTrackBy", ctx_r2.trackByAction);
|
|
1251
1294
|
} }
|
|
1252
1295
|
function ActionsCellComponent_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
1253
1296
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
@@ -1266,7 +1309,7 @@ function ActionsCellComponent_div_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
1266
1309
|
} if (rf & 2) {
|
|
1267
1310
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
1268
1311
|
i0.ɵɵadvance();
|
|
1269
|
-
i0.ɵɵproperty("checked", ctx_r2.currentState)("disabled", ctx_r2.disable ? ctx_r2.disable(ctx_r2.
|
|
1312
|
+
i0.ɵɵproperty("checked", ctx_r2.currentState())("disabled", ctx_r2.disable() ? ctx_r2.disable()(ctx_r2.data()) : false);
|
|
1270
1313
|
} }
|
|
1271
1314
|
function ActionsCellComponent_div_4__svg_svg_2_Template(rf, ctx) { if (rf & 1) {
|
|
1272
1315
|
i0.ɵɵnamespaceSVG();
|
|
@@ -1289,11 +1332,11 @@ function ActionsCellComponent_div_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
1289
1332
|
} if (rf & 2) {
|
|
1290
1333
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
1291
1334
|
i0.ɵɵadvance();
|
|
1292
|
-
i0.ɵɵproperty("title", ctx_r2.currentState ? "Expand" : "Collapse");
|
|
1335
|
+
i0.ɵɵproperty("title", ctx_r2.currentState() ? "Expand" : "Collapse");
|
|
1293
1336
|
i0.ɵɵadvance();
|
|
1294
|
-
i0.ɵɵproperty("ngIf", ctx_r2.currentState);
|
|
1337
|
+
i0.ɵɵproperty("ngIf", ctx_r2.currentState());
|
|
1295
1338
|
i0.ɵɵadvance();
|
|
1296
|
-
i0.ɵɵproperty("ngIf", !ctx_r2.currentState);
|
|
1339
|
+
i0.ɵɵproperty("ngIf", !ctx_r2.currentState());
|
|
1297
1340
|
} }
|
|
1298
1341
|
function ActionsCellComponent_ng_template_5_div_1_ng_container_1_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
1299
1342
|
i0.ɵɵelementStart(0, "span", 36);
|
|
@@ -1402,40 +1445,45 @@ function ActionsCellComponent_ng_template_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
1402
1445
|
} if (rf & 2) {
|
|
1403
1446
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
1404
1447
|
i0.ɵɵadvance();
|
|
1405
|
-
i0.ɵɵproperty("ngForOf", ctx_r2.actionItems);
|
|
1448
|
+
i0.ɵɵproperty("ngForOf", ctx_r2.actionItems());
|
|
1406
1449
|
} }
|
|
1407
1450
|
class ActionsCellComponent {
|
|
1408
1451
|
constructor(overlay, viewContainerRef) {
|
|
1409
1452
|
this.overlay = overlay;
|
|
1410
1453
|
this.viewContainerRef = viewContainerRef;
|
|
1411
|
-
this.
|
|
1412
|
-
this.
|
|
1413
|
-
this.
|
|
1414
|
-
this.
|
|
1415
|
-
this.
|
|
1416
|
-
this.
|
|
1417
|
-
this.
|
|
1454
|
+
this.cellData = input();
|
|
1455
|
+
this.config = input();
|
|
1456
|
+
this.actionClick = output();
|
|
1457
|
+
this.isDropdownOpen = signal(false);
|
|
1458
|
+
this.actionItems = signal([]);
|
|
1459
|
+
this.actionType = signal("inline");
|
|
1460
|
+
this.action = signal(undefined);
|
|
1461
|
+
this.data = signal(undefined);
|
|
1462
|
+
this.disable = signal(undefined);
|
|
1463
|
+
this.currentState = signal(false);
|
|
1464
|
+
this._style = signal({});
|
|
1465
|
+
this.containerStyle = signal({});
|
|
1418
1466
|
this.overlayRef = null;
|
|
1419
1467
|
}
|
|
1420
1468
|
ngOnInit() {
|
|
1421
|
-
if (this.config) {
|
|
1422
|
-
this.actionItems
|
|
1423
|
-
this.actionType
|
|
1424
|
-
this._style
|
|
1425
|
-
this.action
|
|
1426
|
-
this.disable
|
|
1469
|
+
if (this.config()) {
|
|
1470
|
+
this.actionItems.set(this.config().actionItems);
|
|
1471
|
+
this.actionType.set(this.config().actionType);
|
|
1472
|
+
this._style.set(this.config().style);
|
|
1473
|
+
this.action.set(this.config().action);
|
|
1474
|
+
this.disable.set(this.config().disable);
|
|
1427
1475
|
this.processStyle();
|
|
1428
1476
|
}
|
|
1429
|
-
if (this.cellData !== null) {
|
|
1477
|
+
if (this.cellData() !== null) {
|
|
1430
1478
|
const defaultStates = {
|
|
1431
1479
|
'checkbox': false,
|
|
1432
1480
|
'row-collapse': true,
|
|
1433
1481
|
};
|
|
1434
|
-
if (this.actionType in defaultStates) {
|
|
1435
|
-
this.currentState
|
|
1482
|
+
if (this.actionType() in defaultStates) {
|
|
1483
|
+
this.currentState.set(typeof this.cellData() === 'boolean' ? this.cellData() : defaultStates[this.actionType()]);
|
|
1436
1484
|
}
|
|
1437
1485
|
else {
|
|
1438
|
-
this.data
|
|
1486
|
+
this.data.set(this.cellData());
|
|
1439
1487
|
}
|
|
1440
1488
|
}
|
|
1441
1489
|
}
|
|
@@ -1444,8 +1492,8 @@ class ActionsCellComponent {
|
|
|
1444
1492
|
}
|
|
1445
1493
|
processStyle() {
|
|
1446
1494
|
// Remove width from style to avoid conflicts with table column width
|
|
1447
|
-
const { width, ...restStyle } = this._style;
|
|
1448
|
-
this.containerStyle
|
|
1495
|
+
const { width, ...restStyle } = this._style();
|
|
1496
|
+
this.containerStyle.set(restStyle);
|
|
1449
1497
|
}
|
|
1450
1498
|
onActionClick(item, event) {
|
|
1451
1499
|
event.stopPropagation();
|
|
@@ -1454,7 +1502,7 @@ class ActionsCellComponent {
|
|
|
1454
1502
|
return;
|
|
1455
1503
|
// Execute action only if permitted
|
|
1456
1504
|
if (item.action) {
|
|
1457
|
-
item.action(this.data);
|
|
1505
|
+
item.action(this.data());
|
|
1458
1506
|
}
|
|
1459
1507
|
this.actionClick.emit({ item });
|
|
1460
1508
|
}
|
|
@@ -1467,13 +1515,13 @@ class ActionsCellComponent {
|
|
|
1467
1515
|
return iconPath.toLowerCase().includes(".svg") || iconPath.toLowerCase().includes("assets/icons/");
|
|
1468
1516
|
}
|
|
1469
1517
|
onDocumentClick() {
|
|
1470
|
-
if (this.isDropdownOpen) {
|
|
1518
|
+
if (this.isDropdownOpen()) {
|
|
1471
1519
|
this.closeDropdown();
|
|
1472
1520
|
}
|
|
1473
1521
|
}
|
|
1474
1522
|
toggleDropdown(event) {
|
|
1475
1523
|
event.stopPropagation();
|
|
1476
|
-
if (this.isDropdownOpen) {
|
|
1524
|
+
if (this.isDropdownOpen()) {
|
|
1477
1525
|
this.closeDropdown();
|
|
1478
1526
|
}
|
|
1479
1527
|
else {
|
|
@@ -1484,7 +1532,7 @@ class ActionsCellComponent {
|
|
|
1484
1532
|
if (!this.dropdownTrigger || !this.dropdownMenu)
|
|
1485
1533
|
return;
|
|
1486
1534
|
// Close all submenus when opening main menu
|
|
1487
|
-
this.actionItems.forEach((item) => (item.showSubmenu = false));
|
|
1535
|
+
this.actionItems().forEach((item) => (item.showSubmenu = false));
|
|
1488
1536
|
const positions = this.getDropdownPositions();
|
|
1489
1537
|
const overlayConfig = new OverlayConfig({
|
|
1490
1538
|
hasBackdrop: true,
|
|
@@ -1502,14 +1550,14 @@ class ActionsCellComponent {
|
|
|
1502
1550
|
this.overlayRef.backdropClick().subscribe(() => {
|
|
1503
1551
|
this.closeDropdown();
|
|
1504
1552
|
});
|
|
1505
|
-
this.isDropdownOpen
|
|
1553
|
+
this.isDropdownOpen.set(true);
|
|
1506
1554
|
}
|
|
1507
1555
|
closeDropdown() {
|
|
1508
1556
|
if (this.overlayRef) {
|
|
1509
1557
|
this.overlayRef.dispose();
|
|
1510
1558
|
this.overlayRef = null;
|
|
1511
1559
|
}
|
|
1512
|
-
this.isDropdownOpen
|
|
1560
|
+
this.isDropdownOpen.set(false);
|
|
1513
1561
|
}
|
|
1514
1562
|
getDropdownPositions() {
|
|
1515
1563
|
// Use CDK Overlay's flexible positioning - it will automatically choose the best position
|
|
@@ -1532,7 +1580,7 @@ class ActionsCellComponent {
|
|
|
1532
1580
|
// Toggle submenu
|
|
1533
1581
|
item.showSubmenu = !item.showSubmenu;
|
|
1534
1582
|
// Optionally close other submenus
|
|
1535
|
-
this.actionItems.forEach((i) => {
|
|
1583
|
+
this.actionItems().forEach((i) => {
|
|
1536
1584
|
if (i !== item)
|
|
1537
1585
|
i.showSubmenu = false;
|
|
1538
1586
|
});
|
|
@@ -1540,21 +1588,23 @@ class ActionsCellComponent {
|
|
|
1540
1588
|
else {
|
|
1541
1589
|
// Handle action
|
|
1542
1590
|
if (item.action)
|
|
1543
|
-
item.action(this.data);
|
|
1544
|
-
this.actionClick.emit({ item, data: this.data });
|
|
1591
|
+
item.action(this.data());
|
|
1592
|
+
this.actionClick.emit({ item, data: this.data() });
|
|
1545
1593
|
this.closeDropdown(); // Only close if action was executed
|
|
1546
1594
|
}
|
|
1547
1595
|
}
|
|
1548
1596
|
onClick(event) {
|
|
1549
|
-
|
|
1597
|
+
// Handle checkbox value - event might be {value: true} or just true
|
|
1598
|
+
const newValue = event && typeof event === 'object' ? event.value : event;
|
|
1599
|
+
this.currentState.set(newValue);
|
|
1550
1600
|
this.actionClick.emit({
|
|
1551
|
-
actionType: this.actionType,
|
|
1552
|
-
value:
|
|
1601
|
+
actionType: this.actionType(),
|
|
1602
|
+
value: newValue
|
|
1553
1603
|
});
|
|
1554
1604
|
}
|
|
1555
1605
|
isDisabled(item) {
|
|
1556
1606
|
if (typeof item.disable === "function") {
|
|
1557
|
-
return item.disable(this.data);
|
|
1607
|
+
return item.disable(this.data());
|
|
1558
1608
|
}
|
|
1559
1609
|
return false;
|
|
1560
1610
|
}
|
|
@@ -1568,33 +1618,27 @@ class ActionsCellComponent {
|
|
|
1568
1618
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.dropdownTrigger = _t.first);
|
|
1569
1619
|
} }, hostBindings: function ActionsCellComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
|
1570
1620
|
i0.ɵɵlistener("click", function ActionsCellComponent_click_HostBindingHandler() { return ctx.onDocumentClick(); }, false, i0.ɵɵresolveDocument);
|
|
1571
|
-
} }, 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) {
|
|
1621
|
+
} }, inputs: { cellData: [1, "cellData"], config: [1, "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) {
|
|
1572
1622
|
i0.ɵɵelementStart(0, "div", 3);
|
|
1573
1623
|
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);
|
|
1574
1624
|
i0.ɵɵelementEnd();
|
|
1575
1625
|
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);
|
|
1576
1626
|
} if (rf & 2) {
|
|
1577
|
-
i0.ɵɵproperty("ngStyle", ctx.containerStyle);
|
|
1627
|
+
i0.ɵɵproperty("ngStyle", ctx.containerStyle());
|
|
1578
1628
|
i0.ɵɵadvance();
|
|
1579
|
-
i0.ɵɵproperty("ngIf", ctx.actionType === "inline");
|
|
1629
|
+
i0.ɵɵproperty("ngIf", ctx.actionType() === "inline");
|
|
1580
1630
|
i0.ɵɵadvance();
|
|
1581
|
-
i0.ɵɵproperty("ngIf", ctx.actionType === "dropdown");
|
|
1631
|
+
i0.ɵɵproperty("ngIf", ctx.actionType() === "dropdown");
|
|
1582
1632
|
i0.ɵɵadvance();
|
|
1583
|
-
i0.ɵɵproperty("ngIf", ctx.actionType === "checkbox");
|
|
1633
|
+
i0.ɵɵproperty("ngIf", ctx.actionType() === "checkbox");
|
|
1584
1634
|
i0.ɵɵadvance();
|
|
1585
|
-
i0.ɵɵproperty("ngIf", ctx.actionType === "row-collapse");
|
|
1586
|
-
} }, 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
|
|
1635
|
+
i0.ɵɵproperty("ngIf", ctx.actionType() === "row-collapse");
|
|
1636
|
+
} }, 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%}.collapse-icon[_ngcontent-%COMP%]{cursor:pointer}"] }); }
|
|
1587
1637
|
}
|
|
1588
1638
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActionsCellComponent, [{
|
|
1589
1639
|
type: Component,
|
|
1590
|
-
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(
|
|
1591
|
-
}], () => [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }], {
|
|
1592
|
-
type: Input
|
|
1593
|
-
}], config: [{
|
|
1594
|
-
type: Input
|
|
1595
|
-
}], actionClick: [{
|
|
1596
|
-
type: Output
|
|
1597
|
-
}], dropdownMenu: [{
|
|
1640
|
+
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()(data()) : 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%}.collapse-icon{cursor:pointer}\n"] }]
|
|
1641
|
+
}], () => [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }], { dropdownMenu: [{
|
|
1598
1642
|
type: ViewChild,
|
|
1599
1643
|
args: ['dropdownMenu', { static: false }]
|
|
1600
1644
|
}], dropdownTrigger: [{
|