ngx-t-forms 3.1.5 → 3.1.7
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/fesm2022/{ngx-t-forms-api-endpoint-config.component-DLg5vzNJ.mjs → ngx-t-forms-api-endpoint-config.component-CCwUtGOH.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-api-endpoint-config.component-DLg5vzNJ.mjs.map → ngx-t-forms-api-endpoint-config.component-CCwUtGOH.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-CQ9gB964.mjs → ngx-t-forms-auto-complete-input-element.component-BUCFidjW.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-CQ9gB964.mjs.map → ngx-t-forms-auto-complete-input-element.component-BUCFidjW.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-B-J4qO_Z.mjs → ngx-t-forms-basic-input-input-element.component-C92Y7CW_.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-B-J4qO_Z.mjs.map → ngx-t-forms-basic-input-input-element.component-C92Y7CW_.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-KHUBx8wM.mjs → ngx-t-forms-calculated-field-rules.component-33ZARq4R.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-calculated-field-rules.component-KHUBx8wM.mjs.map → ngx-t-forms-calculated-field-rules.component-33ZARq4R.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-DAZVCoUZ.mjs → ngx-t-forms-chip-options-creator-editor.component-CWJMjBoK.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-DAZVCoUZ.mjs.map → ngx-t-forms-chip-options-creator-editor.component-CWJMjBoK.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-conditional-display-config.component-p3dEGx1z.mjs → ngx-t-forms-conditional-display-config.component-zauBVptA.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-conditional-display-config.component-p3dEGx1z.mjs.map → ngx-t-forms-conditional-display-config.component-zauBVptA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CAk0k2YC.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-C096Ib2V.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CAk0k2YC.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-C096Ib2V.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-data-source-picker.component-CUVjocuE.mjs → ngx-t-forms-data-source-picker.component-WkSQqjd-.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-data-source-picker.component-CUVjocuE.mjs.map → ngx-t-forms-data-source-picker.component-WkSQqjd-.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-lQfvlGfA.mjs → ngx-t-forms-date-picker-input-element.component-Dtzq25sw.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-lQfvlGfA.mjs.map → ngx-t-forms-date-picker-input-element.component-Dtzq25sw.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-7t9Ib-35.mjs → ngx-t-forms-date-range-picker-input-element.component-W8KV-zoC.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-7t9Ib-35.mjs.map → ngx-t-forms-date-range-picker-input-element.component-W8KV-zoC.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-time-picker-input-element.component-Co0nzt6l.mjs → ngx-t-forms-date-time-picker-input-element.component-CQXZDwAo.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-date-time-picker-input-element.component-Co0nzt6l.mjs.map → ngx-t-forms-date-time-picker-input-element.component-CQXZDwAo.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-xQuX0E3x.mjs → ngx-t-forms-document-list-label-config-editor.component-3LcpNBQI.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-xQuX0E3x.mjs.map → ngx-t-forms-document-list-label-config-editor.component-3LcpNBQI.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-document-picker.component-umv9Z3rU.mjs → ngx-t-forms-document-picker.component-CvATcveO.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-document-picker.component-umv9Z3rU.mjs.map → ngx-t-forms-document-picker.component-CvATcveO.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-editor-input-element.component-BHq-LOhI.mjs → ngx-t-forms-editor-input-element.component-BqofP5-4.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-editor-input-element.component-BHq-LOhI.mjs.map → ngx-t-forms-editor-input-element.component-BqofP5-4.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-DjVntIfw.mjs → ngx-t-forms-file-upload-input-element.component-BAQx2BLX.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-DjVntIfw.mjs.map → ngx-t-forms-file-upload-input-element.component-BAQx2BLX.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-input-selector.component-DX85MMcQ.mjs → ngx-t-forms-form-input-selector.component-M6O7-j2Q.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-input-selector.component-DX85MMcQ.mjs.map → ngx-t-forms-form-input-selector.component-M6O7-j2Q.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-f6QyPY6E.mjs → ngx-t-forms-form-json-view.component-Dd-EMosV.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-f6QyPY6E.mjs.map → ngx-t-forms-form-json-view.component-Dd-EMosV.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-ChaSUCrg.mjs → ngx-t-forms-form-section-stepper.component-B1dYMlCC.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-ChaSUCrg.mjs.map → ngx-t-forms-form-section-stepper.component-B1dYMlCC.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-Qkw23Bzy.mjs → ngx-t-forms-forms-builder-menu.component-S2qfSAT-.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-Qkw23Bzy.mjs.map → ngx-t-forms-forms-builder-menu.component-S2qfSAT-.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-geo-location.component-DqYEmeLs.mjs → ngx-t-forms-geo-location.component-whY7YIMk.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-geo-location.component-DqYEmeLs.mjs.map → ngx-t-forms-geo-location.component-whY7YIMk.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-header-template-editor.component-CIft152I.mjs → ngx-t-forms-header-template-editor.component-BLn_-jPM.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-header-template-editor.component-CIft152I.mjs.map → ngx-t-forms-header-template-editor.component-BLn_-jPM.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-BmVXoC_z.mjs → ngx-t-forms-image-capture-input-element.component-D05NKiWm.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-BmVXoC_z.mjs.map → ngx-t-forms-image-capture-input-element.component-D05NKiWm.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-index-BnK4nGDh.mjs +2 -0
- package/fesm2022/ngx-t-forms-index-BnK4nGDh.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-custom.component-CTye_tsv.mjs → ngx-t-forms-input-custom.component-CGz6j56m.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-input-custom.component-CTye_tsv.mjs.map → ngx-t-forms-input-custom.component-CGz6j56m.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-input-editor.component-DbhnFkYQ.mjs → ngx-t-forms-input-editor.component-DxrkUbed.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-input-editor.component-DbhnFkYQ.mjs.map → ngx-t-forms-input-editor.component-DxrkUbed.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-B49fcbzx.mjs → ngx-t-forms-map-mat-options-keys-Cu_L5CRA.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-B49fcbzx.mjs.map → ngx-t-forms-map-mat-options-keys-Cu_L5CRA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-C0iLh1ON.mjs → ngx-t-forms-mat-chip-list-editor.component-B98Hv4M1.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-C0iLh1ON.mjs.map → ngx-t-forms-mat-chip-list-editor.component-B98Hv4M1.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-BsX7Ezy-.mjs → ngx-t-forms-missing-form-configs.component-CSnHK6ZR.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-BsX7Ezy-.mjs.map → ngx-t-forms-missing-form-configs.component-CSnHK6ZR.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-D8GL9Aht.mjs → ngx-t-forms-mscoa-chart-toolbar.component-BUj7wGyx.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-D8GL9Aht.mjs.map → ngx-t-forms-mscoa-chart-toolbar.component-BUj7wGyx.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-config.component-Sz8VZ-vc.mjs → ngx-t-forms-mscoa-config.component-CBqzX9H7.mjs} +15 -10
- package/fesm2022/ngx-t-forms-mscoa-config.component-CBqzX9H7.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-Cr1HXTjG.mjs +520 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-Cr1HXTjG.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-CfZLcuuu.mjs +2336 -0
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-CfZLcuuu.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-ngx-t-forms-B3WhBGlD.mjs → ngx-t-forms-ngx-t-forms-Dt4iPwb-.mjs} +1444 -146
- package/fesm2022/ngx-t-forms-ngx-t-forms-Dt4iPwb-.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-paginated-selection-table-CILBCL4K.mjs → ngx-t-forms-paginated-selection-table-lMTD1N6B.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-paginated-selection-table-CILBCL4K.mjs.map → ngx-t-forms-paginated-selection-table-lMTD1N6B.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-payload-template-editor.component-C8OasgK7.mjs → ngx-t-forms-payload-template-editor.component-Dx0pI0A1.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-payload-template-editor.component-C8OasgK7.mjs.map → ngx-t-forms-payload-template-editor.component-Dx0pI0A1.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-_yowsgF6.mjs → ngx-t-forms-pipeline-generator.component-VySkMHQI.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-_yowsgF6.mjs.map → ngx-t-forms-pipeline-generator.component-VySkMHQI.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-quill-input.component-BWq5cLY-.mjs → ngx-t-forms-quill-input.component-BLaPFcJE.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-quill-input.component-BWq5cLY-.mjs.map → ngx-t-forms-quill-input.component-BLaPFcJE.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-record-list-manager.component-C-lAzlO-.mjs → ngx-t-forms-record-list-manager.component-qlizX9F4.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-record-list-manager.component-C-lAzlO-.mjs.map → ngx-t-forms-record-list-manager.component-qlizX9F4.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-required-inputs.component-8cQr2QWm.mjs → ngx-t-forms-required-inputs.component-DY37Qrnj.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-required-inputs.component-8cQr2QWm.mjs.map → ngx-t-forms-required-inputs.component-DY37Qrnj.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-Bhj9jcQk.mjs → ngx-t-forms-rest-api-call-setup.component-CLYe2Lf_.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-Bhj9jcQk.mjs.map → ngx-t-forms-rest-api-call-setup.component-CLYe2Lf_.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-section-report.component-CWCqrc7k.mjs → ngx-t-forms-section-report.component-foLHlD-I.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-section-report.component-CWCqrc7k.mjs.map → ngx-t-forms-section-report.component-foLHlD-I.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-select-input-element.component-BGD67Dnh.mjs → ngx-t-forms-select-input-element.component-CvrNfvXa.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-select-input-element.component-BGD67Dnh.mjs.map → ngx-t-forms-select-input-element.component-CvrNfvXa.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-ClXaOeXt.mjs → ngx-t-forms-selection-options-editor.component-D4luMX5c.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-ClXaOeXt.mjs.map → ngx-t-forms-selection-options-editor.component-D4luMX5c.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-Z-wkFzgQ.mjs → ngx-t-forms-textarea-input-element.component-BWyxWDvp.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-Z-wkFzgQ.mjs.map → ngx-t-forms-textarea-input-element.component-BWyxWDvp.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-CvR3-IjP.mjs → ngx-t-forms-toggle-input-element.component-CpYC2ivQ.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-CvR3-IjP.mjs.map → ngx-t-forms-toggle-input-element.component-CpYC2ivQ.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-token-text-input.component-vnOkP_CV.mjs → ngx-t-forms-token-text-input.component-BAjGepTM.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-token-text-input.component-vnOkP_CV.mjs.map → ngx-t-forms-token-text-input.component-BAjGepTM.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-validators-config.component-DhuB7c63.mjs → ngx-t-forms-validators-config.component-DVB88bgW.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-validators-config.component-DhuB7c63.mjs.map → ngx-t-forms-validators-config.component-DVB88bgW.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-Dc4r01D7.mjs → ngx-t-forms-workflow-adjudication.component-LoF_fpHu.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-Dc4r01D7.mjs.map → ngx-t-forms-workflow-adjudication.component-LoF_fpHu.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/package.json +2 -2
- package/types/ngx-t-forms.d.ts +484 -13
- package/fesm2022/ngx-t-forms-index-yasuBvXP.mjs +0 -2
- package/fesm2022/ngx-t-forms-index-yasuBvXP.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-config.component-Sz8VZ-vc.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-COepe5G2.mjs +0 -447
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-COepe5G2.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-DlgTjJpj.mjs +0 -909
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-DlgTjJpj.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-B3WhBGlD.mjs.map +0 -1
|
@@ -1,909 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, inject, DestroyRef, ElementRef } from '@angular/core';
|
|
3
|
-
import * as i1$2 from '@angular/forms';
|
|
4
|
-
import { NgControl, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import * as i2$2 from '@angular/material/form-field';
|
|
6
|
-
import { MatFormFieldControl, MatFormFieldModule } from '@angular/material/form-field';
|
|
7
|
-
import * as i3 from '@angular/material/icon';
|
|
8
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
9
|
-
import * as i2 from '@angular/material/button';
|
|
10
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
11
|
-
import * as i5$1 from '@angular/material/tooltip';
|
|
12
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
13
|
-
import { c as TDynamicDataViewComponent, Y as TFormInputComponent, a5 as calculateListOveralFunctions, B as BaseCustomInput, _ as _isEqual, a2 as getInputErrorMessage, a3 as TFormInputStatusComponent } from './ngx-t-forms-ngx-t-forms-B3WhBGlD.mjs';
|
|
14
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
15
|
-
import * as i5 from '@angular/material/table';
|
|
16
|
-
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
17
|
-
import { DocumentLitsLabelConfigInterfaceValueType, InputDataTypes, MultipleInputAvailableOperations, CalculationFunctions } from 'ngx-t-forms-types';
|
|
18
|
-
import * as i4 from '@angular/material/chips';
|
|
19
|
-
import { MatChipsModule } from '@angular/material/chips';
|
|
20
|
-
import * as i6 from '@angular/material/menu';
|
|
21
|
-
import { MatMenuModule } from '@angular/material/menu';
|
|
22
|
-
import * as i1 from '@angular/material/progress-bar';
|
|
23
|
-
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
24
|
-
import * as i4$1 from '@angular/material/progress-spinner';
|
|
25
|
-
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
26
|
-
import * as i2$1 from '@angular/material/sort';
|
|
27
|
-
import { MatSortModule } from '@angular/material/sort';
|
|
28
|
-
import * as i3$1 from '@angular/common';
|
|
29
|
-
import { CommonModule } from '@angular/common';
|
|
30
|
-
import * as i3$2 from '@angular/material/card';
|
|
31
|
-
import { MatCardModule } from '@angular/material/card';
|
|
32
|
-
import { MatDividerModule } from '@angular/material/divider';
|
|
33
|
-
import * as i1$1 from '@angular/cdk/drag-drop';
|
|
34
|
-
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
35
|
-
import { Subject, timer, tap, takeUntil } from 'rxjs';
|
|
36
|
-
import { v4 } from 'uuid';
|
|
37
|
-
import * as i6$1 from '@angular/material/list';
|
|
38
|
-
|
|
39
|
-
class ColorScale {
|
|
40
|
-
constructor(min, max, colorStops, alpha = 1) {
|
|
41
|
-
validateMinMaxValues(min, max);
|
|
42
|
-
validateColorStops(colorStops);
|
|
43
|
-
validateAlphaValue(alpha);
|
|
44
|
-
this.min = min;
|
|
45
|
-
this.max = max;
|
|
46
|
-
this.alpha = alpha;
|
|
47
|
-
this.colorStops = colorStops.map((colorStop) => hexToColor(colorStop, alpha));
|
|
48
|
-
}
|
|
49
|
-
getColor(value) {
|
|
50
|
-
const numOfColorStops = this.colorStops.length;
|
|
51
|
-
if (value < this.min)
|
|
52
|
-
return this.colorStops[0];
|
|
53
|
-
if (value > this.max)
|
|
54
|
-
return this.colorStops[numOfColorStops - 1];
|
|
55
|
-
const range = this.max - this.min;
|
|
56
|
-
let weight = (value - this.min) / range;
|
|
57
|
-
const colorStopIndex = Math.max(Math.ceil(weight * (numOfColorStops - 1)), 1);
|
|
58
|
-
const minColor = this.colorStops[colorStopIndex - 1];
|
|
59
|
-
const maxColor = this.colorStops[colorStopIndex];
|
|
60
|
-
if (maxColor === undefined)
|
|
61
|
-
return minColor;
|
|
62
|
-
if (minColor === undefined)
|
|
63
|
-
return maxColor;
|
|
64
|
-
weight = weight * (numOfColorStops - 1) - (colorStopIndex - 1);
|
|
65
|
-
const r = Math.floor(weight * maxColor.r + (1 - weight) * minColor.r);
|
|
66
|
-
const g = Math.floor(weight * maxColor.g + (1 - weight) * minColor.g);
|
|
67
|
-
const b = Math.floor(weight * maxColor.b + (1 - weight) * minColor.b);
|
|
68
|
-
return new Color(r, g, b, this.alpha);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function validateMinMaxValues(min, max) {
|
|
72
|
-
if (min > max) {
|
|
73
|
-
throw new Error('The minimum value must be less than the maximum value.');
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function validateColorStops(colorStops) {
|
|
77
|
-
if (colorStops.length < 2) {
|
|
78
|
-
throw new Error('At least two colors must be provided.');
|
|
79
|
-
}
|
|
80
|
-
colorStops.forEach((str) => {
|
|
81
|
-
if (!isValidHexColor(str)) {
|
|
82
|
-
throw new Error(`${str} is not a valid hex color.`);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
function validateAlphaValue(alpha) {
|
|
87
|
-
if (alpha < 0 || alpha > 1) {
|
|
88
|
-
throw new Error('The alpha value must be between 0 and 1.');
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function hexToColor(hex, alpha) {
|
|
92
|
-
if (isValid3DigitHexColor(hex)) {
|
|
93
|
-
hex = convertTo6DigitHexColor(hex);
|
|
94
|
-
}
|
|
95
|
-
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
96
|
-
if (!!result?.[1] && !!result?.[2] && !!result?.[3]) {
|
|
97
|
-
return new Color(parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16), alpha);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
throw new Error(`${hex} is not a valid hex color.`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
function isValidHexColor(colorString) {
|
|
104
|
-
return (isValid3DigitHexColor(colorString) || isValid6DigitHexColor(colorString));
|
|
105
|
-
}
|
|
106
|
-
function isValid3DigitHexColor(colorString) {
|
|
107
|
-
const hexColorRegex = /^#(?:[0-9a-fA-F]{3})$/;
|
|
108
|
-
return colorString.match(hexColorRegex);
|
|
109
|
-
}
|
|
110
|
-
function isValid6DigitHexColor(colorString) {
|
|
111
|
-
const hexColorRegex = /^#(?:[0-9a-fA-F]{6})$/;
|
|
112
|
-
return colorString.match(hexColorRegex);
|
|
113
|
-
}
|
|
114
|
-
function convertTo6DigitHexColor(threeDigitHex) {
|
|
115
|
-
return threeDigitHex
|
|
116
|
-
.substring(1)
|
|
117
|
-
.split('')
|
|
118
|
-
.map((char) => {
|
|
119
|
-
return char + char;
|
|
120
|
-
})
|
|
121
|
-
.join('');
|
|
122
|
-
}
|
|
123
|
-
function componentToHex(c) {
|
|
124
|
-
const hex = c.toString(16);
|
|
125
|
-
return hex.length === 1 ? '0' + hex : hex;
|
|
126
|
-
}
|
|
127
|
-
function rgbaToHex(color) {
|
|
128
|
-
const r = Math.floor(color.r * color.a);
|
|
129
|
-
const g = Math.floor(color.g * color.a);
|
|
130
|
-
const b = Math.floor(color.b * color.a);
|
|
131
|
-
return `#${componentToHex(r)}${componentToHex(g)}${componentToHex(b)}`;
|
|
132
|
-
}
|
|
133
|
-
class Color {
|
|
134
|
-
constructor(r, g, b, a = 1) {
|
|
135
|
-
validateAlphaValue(a);
|
|
136
|
-
this.r = r;
|
|
137
|
-
this.g = g;
|
|
138
|
-
this.b = b;
|
|
139
|
-
this.a = a;
|
|
140
|
-
}
|
|
141
|
-
toRGBString() {
|
|
142
|
-
return `rgb(${Math.floor(this.r * this.a)},${Math.floor(this.g * this.a)},${Math.floor(this.b * this.a)})`;
|
|
143
|
-
}
|
|
144
|
-
toRGBAString() {
|
|
145
|
-
return `rgba(${this.r},${this.g},${this.b},${this.a})`;
|
|
146
|
-
}
|
|
147
|
-
toHexString() {
|
|
148
|
-
return rgbaToHex(this);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
153
|
-
function configureCols(inputConfig, tempLabels) {
|
|
154
|
-
try {
|
|
155
|
-
const labelInputs = (inputConfig?.formInputs || []).filter(input => input.showAsLabel || tempLabels.includes(input.formControlName));
|
|
156
|
-
const cols = [];
|
|
157
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
158
|
-
const colConfigs = {};
|
|
159
|
-
for (let index = 0; index < (labelInputs).length; index++) {
|
|
160
|
-
const c = labelInputs[index];
|
|
161
|
-
const col = { ...c };
|
|
162
|
-
cols.push(`${inputConfig.id}.${col.id}`);
|
|
163
|
-
if (!col.id) {
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
colConfigs[`${inputConfig.id}.${col.id}`] = {
|
|
167
|
-
property: `${inputConfig.id}.${col.id}`,
|
|
168
|
-
formControlName: col.formControlName,
|
|
169
|
-
label: col.label,
|
|
170
|
-
dataType: getDataType(col)
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
//add remove section config
|
|
174
|
-
cols.push('itemRemovalButton');
|
|
175
|
-
colConfigs['itemRemovalButton'] = {
|
|
176
|
-
property: 'itemRemovalButton',
|
|
177
|
-
label: '',
|
|
178
|
-
type: 'removal',
|
|
179
|
-
};
|
|
180
|
-
// end
|
|
181
|
-
return {
|
|
182
|
-
displayedColumnsInOrder: cols.filter((c) => !!c),
|
|
183
|
-
columnsConfig: colConfigs
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
catch (error) {
|
|
187
|
-
const message = error instanceof Error ? error.message : 'Failed to configure columns';
|
|
188
|
-
throw new Error(message);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
function getDataType(input) {
|
|
192
|
-
try {
|
|
193
|
-
if (input.pipe?.pipeType) {
|
|
194
|
-
return input.pipe.pipeType;
|
|
195
|
-
}
|
|
196
|
-
const inputDataType = input.dataType;
|
|
197
|
-
switch (inputDataType) {
|
|
198
|
-
case InputDataTypes.Number:
|
|
199
|
-
return DocumentLitsLabelConfigInterfaceValueType.number;
|
|
200
|
-
case InputDataTypes.Date:
|
|
201
|
-
return DocumentLitsLabelConfigInterfaceValueType.date;
|
|
202
|
-
case InputDataTypes.Array:
|
|
203
|
-
return InputDataTypes.Array;
|
|
204
|
-
case InputDataTypes.Boolean:
|
|
205
|
-
return InputDataTypes.Boolean;
|
|
206
|
-
case InputDataTypes.Object:
|
|
207
|
-
return InputDataTypes.Object;
|
|
208
|
-
default:
|
|
209
|
-
return DocumentLitsLabelConfigInterfaceValueType.string;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
catch (error) {
|
|
213
|
-
const msg = error instanceof Error ? error.message : 'Failed to get data type';
|
|
214
|
-
throw new Error(msg);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
class MultipleInputTableViewComponent {
|
|
219
|
-
constructor() {
|
|
220
|
-
this.inputConfig = input(undefined, ...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
|
|
221
|
-
this.dataSource = input(new MatTableDataSource(), ...(ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []));
|
|
222
|
-
this.applyOptionsTo = input(undefined, ...(ngDevMode ? [{ debugName: "applyOptionsTo" }] : /* istanbul ignore next */ []));
|
|
223
|
-
this.formGroup = input(null, ...(ngDevMode ? [{ debugName: "formGroup" }] : /* istanbul ignore next */ []));
|
|
224
|
-
this.onEditItem = output();
|
|
225
|
-
this.onDeleteItem = output();
|
|
226
|
-
this.onCopy = output();
|
|
227
|
-
this.onApplyOptionsTo = output();
|
|
228
|
-
this.showItemAsLabel = output();
|
|
229
|
-
this.colConfig = computed(() => {
|
|
230
|
-
const cfg = this.inputConfig();
|
|
231
|
-
if (!cfg) {
|
|
232
|
-
return {
|
|
233
|
-
columnsConfig: {},
|
|
234
|
-
displayedColumnsInOrder: [],
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
return configureCols(cfg, this.tempLabels);
|
|
238
|
-
}, ...(ngDevMode ? [{ debugName: "colConfig" }] : /* istanbul ignore next */ []));
|
|
239
|
-
this.displayedColumnsInOrderSig = computed(() => this.colConfig().displayedColumnsInOrder, ...(ngDevMode ? [{ debugName: "displayedColumnsInOrderSig" }] : /* istanbul ignore next */ []));
|
|
240
|
-
this.allPossibleLabels = computed(() => {
|
|
241
|
-
const cfg = this.inputConfig();
|
|
242
|
-
const displayed = this.displayedColumnsInOrderSig();
|
|
243
|
-
return (cfg?.formInputs?.map((inp) => ({
|
|
244
|
-
label: inp.label,
|
|
245
|
-
selected: displayed.includes(`${cfg?.id}.${inp.id}`),
|
|
246
|
-
formControlName: inp.formControlName,
|
|
247
|
-
})) || []);
|
|
248
|
-
}, ...(ngDevMode ? [{ debugName: "allPossibleLabels" }] : /* istanbul ignore next */ []));
|
|
249
|
-
this.userCanEdit = computed(() => {
|
|
250
|
-
const cfg = this.inputConfig();
|
|
251
|
-
if (!cfg)
|
|
252
|
-
return false;
|
|
253
|
-
if (!cfg.multipleInputAvailableOperations)
|
|
254
|
-
return true;
|
|
255
|
-
return cfg.multipleInputAvailableOperations.includes(MultipleInputAvailableOperations.Update);
|
|
256
|
-
}, ...(ngDevMode ? [{ debugName: "userCanEdit" }] : /* istanbul ignore next */ []));
|
|
257
|
-
this.userCanRemove = computed(() => {
|
|
258
|
-
const cfg = this.inputConfig();
|
|
259
|
-
if (!cfg)
|
|
260
|
-
return false;
|
|
261
|
-
if (!cfg.multipleInputAvailableOperations)
|
|
262
|
-
return true;
|
|
263
|
-
return cfg.multipleInputAvailableOperations.includes(MultipleInputAvailableOperations.Remove);
|
|
264
|
-
}, ...(ngDevMode ? [{ debugName: "userCanRemove" }] : /* istanbul ignore next */ []));
|
|
265
|
-
this.userCanAdd = computed(() => {
|
|
266
|
-
const cfg = this.inputConfig();
|
|
267
|
-
if (!cfg)
|
|
268
|
-
return false;
|
|
269
|
-
if (!cfg.multipleInputAvailableOperations)
|
|
270
|
-
return true;
|
|
271
|
-
return cfg.multipleInputAvailableOperations.includes(MultipleInputAvailableOperations.Add);
|
|
272
|
-
}, ...(ngDevMode ? [{ debugName: "userCanAdd" }] : /* istanbul ignore next */ []));
|
|
273
|
-
this.userCanApplyOptionsTo = computed(() => {
|
|
274
|
-
return this.userCanEdit() || this.userCanRemove() || this.userCanAdd();
|
|
275
|
-
}, ...(ngDevMode ? [{ debugName: "userCanApplyOptionsTo" }] : /* istanbul ignore next */ []));
|
|
276
|
-
this.areYouSureYouWantToDeleteRow = {};
|
|
277
|
-
this.countDownDate = new Date();
|
|
278
|
-
this.deletionTimers = {};
|
|
279
|
-
this.tempLabels = [];
|
|
280
|
-
this.SYSTEM_KEY_IN_EDIT = null;
|
|
281
|
-
this.overlayOpen = false;
|
|
282
|
-
this.overlayData = null;
|
|
283
|
-
this.overlayPosition = { top: 0, left: 0 };
|
|
284
|
-
this.fullView = false;
|
|
285
|
-
}
|
|
286
|
-
applyOptionsToFn(item) {
|
|
287
|
-
this.onApplyOptionsTo.emit(item);
|
|
288
|
-
}
|
|
289
|
-
editItem(row) {
|
|
290
|
-
const rowId = row[`${this.inputConfig()?.id}.id`];
|
|
291
|
-
this.onEditItem.emit(rowId);
|
|
292
|
-
}
|
|
293
|
-
copy(row) {
|
|
294
|
-
const rowId = row[`${this.inputConfig()?.id}.id`];
|
|
295
|
-
this.onCopy.emit(rowId);
|
|
296
|
-
}
|
|
297
|
-
isAboutToDeleteRow(row) {
|
|
298
|
-
return !!this.areYouSureYouWantToDeleteRow[row[`${this.inputConfig()?.id}.id`]];
|
|
299
|
-
}
|
|
300
|
-
getCountdownSeconds() {
|
|
301
|
-
const now = new Date();
|
|
302
|
-
const timeElapsed = (now.getTime() - this.countDownDate.getTime()) / 1000;
|
|
303
|
-
const percentage = Math.min(Math.round((timeElapsed / 3) * 100), 100);
|
|
304
|
-
return percentage;
|
|
305
|
-
}
|
|
306
|
-
secondsCountDown() {
|
|
307
|
-
return (3 - ((this.getCountdownSeconds() / 100) * 3)).toFixed(1);
|
|
308
|
-
}
|
|
309
|
-
multipleInputRemoveItem(event, row) {
|
|
310
|
-
const rowId = row[`${this.inputConfig()?.id}.id`];
|
|
311
|
-
if (this.areYouSureYouWantToDeleteRow[rowId]) {
|
|
312
|
-
if (this.deletionTimers[rowId]) {
|
|
313
|
-
clearTimeout(this.deletionTimers[rowId]);
|
|
314
|
-
delete this.deletionTimers[rowId];
|
|
315
|
-
}
|
|
316
|
-
delete this.areYouSureYouWantToDeleteRow[rowId];
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
this.areYouSureYouWantToDeleteRow[rowId] = true;
|
|
320
|
-
this.countDownDate = new Date();
|
|
321
|
-
this.deletionTimers[rowId] = setTimeout(() => {
|
|
322
|
-
if (this.areYouSureYouWantToDeleteRow[rowId]) {
|
|
323
|
-
this.onDeleteItem.emit(row);
|
|
324
|
-
delete this.areYouSureYouWantToDeleteRow[rowId];
|
|
325
|
-
delete this.deletionTimers[rowId];
|
|
326
|
-
}
|
|
327
|
-
}, 3000);
|
|
328
|
-
}
|
|
329
|
-
event.preventDefault();
|
|
330
|
-
event.stopPropagation();
|
|
331
|
-
}
|
|
332
|
-
returnBackground(row, columnsConfig) {
|
|
333
|
-
let background = '';
|
|
334
|
-
const ds = this.dataSource();
|
|
335
|
-
if (ds
|
|
336
|
-
? ds.data.length > 1
|
|
337
|
-
? columnsConfig?.['colorScale']
|
|
338
|
-
: false
|
|
339
|
-
: false) {
|
|
340
|
-
const inputCfg = this.inputConfig();
|
|
341
|
-
const colKey = columnsConfig?.['key'] ?? '';
|
|
342
|
-
const point = Number(row[colKey]);
|
|
343
|
-
const inputIsGrouped = inputCfg.groupBy;
|
|
344
|
-
const groupKey = inputCfg.groupBy?.[0] || '';
|
|
345
|
-
const dataSet = inputIsGrouped
|
|
346
|
-
? ds?.data.filter((s) => s[groupKey] === row[groupKey])
|
|
347
|
-
: new Array(ds?.data || []);
|
|
348
|
-
const arrayValues = dataSet?.map((vr) => Number(vr[colKey])) || [];
|
|
349
|
-
const max = Math.max(...arrayValues);
|
|
350
|
-
const min = Math.min(...arrayValues);
|
|
351
|
-
const hasNun = isNaN(max) || isNaN(min);
|
|
352
|
-
if (!hasNun && Number(max) !== Number(min)) {
|
|
353
|
-
const colorScale = new ColorScale(min, max, ['#2fdf75', '#FFA500', '#ff4961'], 0.8);
|
|
354
|
-
const color = colorScale.getColor(point)?.toRGBAString();
|
|
355
|
-
background = color ?? '';
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
return background;
|
|
359
|
-
}
|
|
360
|
-
hasTopBorder(row) {
|
|
361
|
-
const inputCfg = this.inputConfig();
|
|
362
|
-
const inputIsGrouped = inputCfg?.groupBy;
|
|
363
|
-
const ds = this.dataSource();
|
|
364
|
-
if (inputIsGrouped && ds) {
|
|
365
|
-
const indexOfRow = ds.data.indexOf(row);
|
|
366
|
-
const rowIsFirstInTable = indexOfRow === 0;
|
|
367
|
-
if (!inputCfg.groupBy) {
|
|
368
|
-
return false;
|
|
369
|
-
}
|
|
370
|
-
const groupKey = inputCfg.groupBy?.[0] ?? '';
|
|
371
|
-
const isFirstInGroup = rowIsFirstInTable
|
|
372
|
-
? true
|
|
373
|
-
: ds.data[indexOfRow - 1][groupKey] !==
|
|
374
|
-
row[groupKey];
|
|
375
|
-
return isFirstInGroup;
|
|
376
|
-
}
|
|
377
|
-
else {
|
|
378
|
-
return false;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
getCalculationFunction(row) {
|
|
382
|
-
const func = row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'];
|
|
383
|
-
switch (func) {
|
|
384
|
-
case CalculationFunctions.Sum:
|
|
385
|
-
return 'TOTAL';
|
|
386
|
-
case CalculationFunctions.Avg:
|
|
387
|
-
return 'AVERAGE';
|
|
388
|
-
case CalculationFunctions.Max:
|
|
389
|
-
return 'MAX';
|
|
390
|
-
case CalculationFunctions.Min:
|
|
391
|
-
return 'MIN';
|
|
392
|
-
default:
|
|
393
|
-
return func;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
toggleTepLabel(event, label) {
|
|
397
|
-
if (this.tempLabels.includes(label)) {
|
|
398
|
-
this.tempLabels = this.tempLabels.filter((l) => l !== label);
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
this.tempLabels.push(label);
|
|
402
|
-
}
|
|
403
|
-
event.stopPropagation();
|
|
404
|
-
event.preventDefault();
|
|
405
|
-
}
|
|
406
|
-
get getColConfig() {
|
|
407
|
-
return this.colConfig();
|
|
408
|
-
}
|
|
409
|
-
get displayedColumnsInOrder() {
|
|
410
|
-
return this.displayedColumnsInOrderSig();
|
|
411
|
-
}
|
|
412
|
-
rowIsInEdit(row) {
|
|
413
|
-
const cfg = this.inputConfig();
|
|
414
|
-
const fg = this.formGroup();
|
|
415
|
-
return (!!cfg?.formIsOpen &&
|
|
416
|
-
fg?.controls[`${cfg?.id}.id`]?.value === row[`${cfg?.id}.id`]);
|
|
417
|
-
}
|
|
418
|
-
openDataOverlay(event, data) {
|
|
419
|
-
event.stopPropagation();
|
|
420
|
-
const rect = event.currentTarget.getBoundingClientRect();
|
|
421
|
-
this.overlayData = data;
|
|
422
|
-
this.overlayPosition = { top: rect.bottom + 4, left: rect.left };
|
|
423
|
-
this.overlayOpen = true;
|
|
424
|
-
}
|
|
425
|
-
closeDataOverlay() {
|
|
426
|
-
this.overlayOpen = false;
|
|
427
|
-
this.overlayData = null;
|
|
428
|
-
}
|
|
429
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputTableViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
430
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MultipleInputTableViewComponent, isStandalone: true, selector: "lib-multiple-input-table-view", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: false, transformFunction: null }, dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, applyOptionsTo: { classPropertyName: "applyOptionsTo", publicName: "applyOptionsTo", isSignal: true, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onEditItem: "onEditItem", onDeleteItem: "onDeleteItem", onCopy: "onCopy", onApplyOptionsTo: "onApplyOptionsTo", showItemAsLabel: "showItemAsLabel" }, ngImport: i0, template: "@defer (on viewport) {\r\n\r\n @if (getColConfig.displayedColumnsInOrder.length === 0) {\r\n <div class=\"mit-state mit-state--inline\">No columns</div>\r\n }\r\n\r\n <div class=\"table-container\">\r\n\r\n <table mat-table [dataSource]=\"(dataSource() || [])\" class=\"mit-table\" matSort matSortActive=\"created\"\r\n matSortDisableClear matSortDirection=\"desc\">\r\n @for (col of (displayedColumnsInOrder || []); track col) {\r\n <ng-container [matColumnDef]=\"col\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <span class=\"mit-th-label\">\r\n {{ getColConfig.columnsConfig?.[col]?.[\"label\"] }}\r\n </span>\r\n @if ($last) {\r\n <button matTooltip=\"Show other values\" [matMenuTriggerFor]=\"colOptions\" [matMenuTriggerData]=\"{}\"\r\n class=\"mit-th-action\" mat-icon-button>\r\n <mat-icon>label</mat-icon>\r\n </button>\r\n }\r\n </th>\r\n <td [class.functionClass]=\"row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION']\"\r\n [style.background]=\"returnBackground(row, getColConfig.columnsConfig?.[col])\"\r\n mat-cell *matCellDef=\"let row\">\r\n @if (getColConfig.columnsConfig?.[col]?.['type'] === 'removal') {\r\n <div class=\"cellClass\">\r\n\r\n @if (!!row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'] && !row['id'] && !inputConfig()?.multipleInputInEditId ||\r\n !!row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'] && inputConfig()?.multipleInputInEditId &&\r\n inputConfig()?.multipleInputInEditId !== row['id']) {\r\n <div class=\"mit-fn-label\">\r\n <strong>{{ getCalculationFunction(row) }}</strong>\r\n </div>\r\n }\r\n @if (\r\n userCanApplyOptionsTo() &&\r\n !row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'] &&\r\n row[''] !== 'true' && !inputConfig()?.readonly && !inputConfig()?.disabled\r\n ) {\r\n <button mat-icon-button [color]=\"t.menuOpen ? 'primary' : 'basic'\" [matMenuTriggerFor]=\"rowOptions\" [matMenuTriggerData]=\"{row:row}\" #t=\"matMenuTrigger\"\r\n (click)=\"applyOptionsToFn(row)\"\r\n class=\"mit-row-trigger\">\r\n @if (rowIsInEdit(row)) {\r\n <mat-icon color=\"primary\">edit</mat-icon>\r\n } @else {\r\n <mat-icon>{{ t.menuOpen ? 'close' : 'more_horiz' }}</mat-icon>\r\n }\r\n </button>\r\n }\r\n\r\n @if (row['SYSTEM_KEY_IN_EDIT']) {\r\n <mat-chip>In {{ inputConfig()?.readonly ? 'View' : 'Edit' }}</mat-chip>\r\n }\r\n\r\n </div>\r\n }\r\n @if (getColConfig.columnsConfig && getColConfig.columnsConfig?.[col]?.type !== 'removal') {\r\n <div class=\"cellClass\">\r\n <span>\r\n @if (getColConfig.columnsConfig?.[col].dataType === 'array' || getColConfig.columnsConfig?.[col].dataType === 'object') {\r\n <button mat-icon-button class=\"mit-data-button\"\r\n matTooltip=\"View data\"\r\n (click)=\"openDataOverlay($event, row[col])\">\r\n <mat-icon class=\"mit-data-icon\">data_object</mat-icon>\r\n </button>\r\n } @else {\r\n {{ row[col] | formatData: getColConfig.columnsConfig?.[col].dataType }}\r\n }\r\n </span>\r\n </div>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"getColConfig.displayedColumnsInOrder\"></tr>\r\n <tr [class.mit-group-start]=\"hasTopBorder(row)\" mat-row\r\n *matRowDef=\"let row; columns: getColConfig.displayedColumnsInOrder\"></tr>\r\n </table>\r\n\r\n @if (!dataSource()?.data?.length) {\r\n <div class=\"mit-empty\">\r\n <mat-icon class=\"mit-empty-icon\">list</mat-icon>\r\n <strong class=\"mit-empty-title\">No items yet</strong>\r\n <p class=\"mit-empty-text\">\r\n <strong>Click the add button</strong> to create a new row. You'll fill in details using a form, and each\r\n saved entry appears as a row here.\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n} @placeholder {\r\n <div class=\"mit-placeholder\">\r\n <mat-spinner diameter=\"32\" />\r\n </div>\r\n}\r\n\r\n@if (overlayOpen) {\r\n <div class=\"data-overlay-backdrop\" (click)=\"closeDataOverlay()\"></div>\r\n <div class=\"data-overlay-panel\"\r\n [style.top.px]=\"overlayPosition.top\"\r\n [style.left.px]=\"overlayPosition.left\"\r\n (click)=\"$event.stopPropagation()\">\r\n <div class=\"data-overlay-header\">\r\n <span class=\"data-overlay-title\">\r\n <mat-icon class=\"data-overlay-title-icon\">data_object</mat-icon>\r\n Data\r\n </span>\r\n <button mat-icon-button class=\"mit-data-button\" (click)=\"closeDataOverlay()\">\r\n <mat-icon class=\"mit-data-icon\">close</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"data-overlay-body\">\r\n <lib-t-dynamic-data-view [data]=\"overlayData\" />\r\n </div>\r\n </div>\r\n}\r\n\r\n<mat-menu #colOptions=\"matMenu\">\r\n <ng-template matMenuContent>\r\n @for (label of allPossibleLabels(); track label.formControlName) {\r\n <button mat-menu-item (click)=\"toggleTepLabel($event, label.formControlName);\">\r\n <mat-icon>{{ label.selected ? 'check_circle' : 'radio_button_unchecked' }}</mat-icon>\r\n {{ label.label }}\r\n </button>\r\n }\r\n </ng-template>\r\n</mat-menu>\r\n\r\n<mat-menu #rowOptions=\"matMenu\">\r\n <ng-template matMenuContent let-row=\"row\">\r\n @if (!inputConfig()?.readonly && !inputConfig()?.disabled) {\r\n @if (userCanEdit()) {\r\n <button mat-menu-item (click)=\"editItem(row)\">\r\n <mat-icon>edit</mat-icon>\r\n <div class=\"option-text\">\r\n <div class=\"option-main-text\">Edit</div>\r\n <div class=\"option-sub-text\">\r\n {{ inputConfig()?.readonly ? 'View item properties' : 'Modify item properties' }}\r\n </div>\r\n </div>\r\n </button>\r\n }\r\n @if (userCanAdd()) {\r\n <button mat-menu-item (click)=\"copy(row)\">\r\n <mat-icon>content_copy</mat-icon>\r\n <div class=\"option-text\">\r\n <div class=\"option-main-text\">Duplicate</div>\r\n <div class=\"option-sub-text\">Create a copy with same values</div>\r\n </div>\r\n </button>\r\n }\r\n\r\n @if (userCanRemove()) {\r\n @if (isAboutToDeleteRow(row)) {\r\n <button mat-menu-item (click)=\"multipleInputRemoveItem($event,row)\">\r\n <mat-icon color=\"accent\">cancel</mat-icon>\r\n <div class=\"option-text\">\r\n <div class=\"option-main-text option-main-text--cancel\">Cancel Deletion</div>\r\n <div class=\"option-sub-text\">Auto-deleting in {{ secondsCountDown() }} seconds...</div>\r\n </div>\r\n </button>\r\n <div class=\"deletion-progress-container\">\r\n <mat-progress-bar color=\"warn\" mode=\"determinate\" [value]=\"getCountdownSeconds()\"></mat-progress-bar>\r\n @if (getCountdownSeconds() > 75) {\r\n <div class=\"deletion-message\">Deleting soon...</div>\r\n }\r\n </div>\r\n } @else {\r\n <button mat-menu-item (click)=\"multipleInputRemoveItem($event,row)\">\r\n <mat-icon color=\"warn\">delete_outline</mat-icon>\r\n <div class=\"option-text\">\r\n <div class=\"option-main-text\">Delete</div>\r\n <div class=\"option-sub-text\">Will delete after 3 seconds (click to cancel)</div>\r\n </div>\r\n </button>\r\n }\r\n }\r\n }\r\n </ng-template>\r\n</mat-menu>\r\n", styles: [".table-container{max-width:100%!important;overflow:auto!important;border-radius:8px}.mit-table{width:100%;background:transparent}.mit-table .mat-mdc-header-cell,.mit-table .mat-mdc-cell{padding:0 .625rem;font-size:.8125rem}.mit-table .mat-mdc-header-row{min-height:2.25rem}.mit-table .mat-mdc-row{min-height:2.5rem;transition:background .2s cubic-bezier(.16,1,.3,1)}.mit-table .mat-mdc-row:hover{background:color-mix(in srgb,var(--mat-sys-primary, #6750a4) 5%,transparent)}.mit-th-label{text-align:start;line-height:normal;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--mat-sys-on-surface-variant, #49454f)}.mit-th-action{width:1.75rem;height:1.75rem;line-height:1.75rem;opacity:.55;transition:opacity .2s cubic-bezier(.16,1,.3,1)}.mit-th-action:hover{opacity:1}.cellClass{display:flex;align-items:center;min-height:2.5rem}.mit-group-start .mat-mdc-cell{border-top:2px solid var(--mat-sys-outline-variant, #cac4d0)}.functionClass{background:var(--mat-sys-surface-container, #f3edf7);font-weight:500}.mit-fn-label{width:100%;text-align:right;color:var(--mat-sys-on-surface-variant, #49454f);font-size:.6875rem;letter-spacing:.06em;text-transform:uppercase}.mit-row-trigger{margin-left:auto;margin-right:0;display:block}.mit-data-button{width:1.75rem;height:1.75rem;line-height:1.75rem}.mit-data-icon{font-size:1.125rem;width:1.125rem;height:1.125rem;line-height:1.125rem}.mit-state{display:flex;justify-content:center;padding:1rem;font-size:.8125rem;color:var(--mat-sys-on-surface-variant, #49454f);opacity:.7}.mit-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.375rem;padding:1.5rem 1.25rem;color:var(--mat-sys-on-surface-variant, #49454f)}.mit-empty-icon{font-size:1.75rem;width:1.75rem;height:1.75rem;line-height:1.75rem;opacity:.5}.mit-empty-title{font-size:.875rem;color:var(--mat-sys-on-surface, #1c1b1f)}.mit-empty-text{margin:0;max-width:22rem;font-size:.75rem;line-height:1.45;opacity:.85}.mit-placeholder{display:flex;justify-content:center;align-items:center;padding:2rem}.option-text{display:flex;flex-direction:column;margin-left:.5rem}.option-main-text{font-size:.875rem;font-weight:500;margin-bottom:2px;line-height:normal}.option-main-text--cancel{color:var(--mat-sys-primary, #6750a4)}.option-sub-text{font-size:.75rem;color:var(--mat-sys-on-surface-variant, #49454f);font-weight:400;line-height:1.2}.deletion-progress-container{position:relative;padding:0 1rem .5rem}.deletion-message{position:absolute;right:1rem;top:2px;font-size:.6875rem;color:var(--mat-sys-error, #b3261e);font-weight:500;line-height:1.6;animation:pulse 1s infinite}button:has(+.deletion-progress-container){border-bottom:none!important;padding-bottom:4px!important}@keyframes pulse{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@media(max-width:600px){.option-sub-text{max-width:180px;white-space:normal}}.data-overlay-backdrop{position:fixed;inset:0;z-index:999;background:transparent}.data-overlay-panel{position:fixed;z-index:1000;background:var(--mat-sys-surface, #fef7ff);border:1px solid color-mix(in srgb,var(--mat-sys-outline, #79747e) 15%,transparent);border-radius:12px;box-shadow:0 16px 56px color-mix(in srgb,var(--mat-sys-shadow, #000) 14%,transparent);min-width:280px;max-width:min(380px,calc(100vw - 16px));max-height:60vh;display:flex;flex-direction:column;overflow:hidden}.data-overlay-header{display:flex;align-items:center;justify-content:space-between;padding:.25rem .25rem .25rem .75rem;border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline, #79747e) 12%,transparent);flex-shrink:0}.data-overlay-title{font-size:.8125rem;font-weight:500;display:flex;align-items:center;color:var(--mat-sys-on-surface, #1c1b1f)}.data-overlay-title-icon{font-size:1rem;width:1rem;height:1rem;line-height:1rem;vertical-align:middle;margin-right:.25rem}.data-overlay-body{overflow:auto;padding:.25rem .5rem .5rem;flex:1}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "ngmodule", type: MatTableModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "component", type: TDynamicDataViewComponent, selector: "lib-t-dynamic-data-view", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [i2.MatIconButton, i4.MatChip, i3.MatIcon, i6.MatMenuTrigger, i2$1.MatSort, i5.MatTable, i5.MatHeaderCellDef, i5.MatHeaderRowDef, i5.MatColumnDef, i5.MatCellDef, i5.MatRowDef, i5.MatHeaderCell, i5.MatCell, i5.MatHeaderRow, i5.MatRow, i5$1.MatTooltip, import('./ngx-t-forms-ngx-t-forms-B3WhBGlD.mjs').then(function (n) { return n.bg; }).then(m => m.FormatDataPipe)]] }); }
|
|
431
|
-
}
|
|
432
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputTableViewComponent, resolveDeferredDeps: () => [import('./ngx-t-forms-ngx-t-forms-B3WhBGlD.mjs').then(function (n) { return n.bg; }).then(m => m.FormatDataPipe)], resolveMetadata: FormatDataPipe => ({ decorators: [{
|
|
433
|
-
type: Component,
|
|
434
|
-
args: [{ selector: 'lib-multiple-input-table-view', imports: [
|
|
435
|
-
MatButtonModule,
|
|
436
|
-
MatChipsModule,
|
|
437
|
-
MatIconModule,
|
|
438
|
-
MatMenuModule,
|
|
439
|
-
MatProgressBarModule,
|
|
440
|
-
MatProgressSpinnerModule,
|
|
441
|
-
MatSortModule,
|
|
442
|
-
MatTableModule,
|
|
443
|
-
MatTooltipModule,
|
|
444
|
-
FormatDataPipe,
|
|
445
|
-
TDynamicDataViewComponent,
|
|
446
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "@defer (on viewport) {\r\n\r\n @if (getColConfig.displayedColumnsInOrder.length === 0) {\r\n <div class=\"mit-state mit-state--inline\">No columns</div>\r\n }\r\n\r\n <div class=\"table-container\">\r\n\r\n <table mat-table [dataSource]=\"(dataSource() || [])\" class=\"mit-table\" matSort matSortActive=\"created\"\r\n matSortDisableClear matSortDirection=\"desc\">\r\n @for (col of (displayedColumnsInOrder || []); track col) {\r\n <ng-container [matColumnDef]=\"col\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <span class=\"mit-th-label\">\r\n {{ getColConfig.columnsConfig?.[col]?.[\"label\"] }}\r\n </span>\r\n @if ($last) {\r\n <button matTooltip=\"Show other values\" [matMenuTriggerFor]=\"colOptions\" [matMenuTriggerData]=\"{}\"\r\n class=\"mit-th-action\" mat-icon-button>\r\n <mat-icon>label</mat-icon>\r\n </button>\r\n }\r\n </th>\r\n <td [class.functionClass]=\"row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION']\"\r\n [style.background]=\"returnBackground(row, getColConfig.columnsConfig?.[col])\"\r\n mat-cell *matCellDef=\"let row\">\r\n @if (getColConfig.columnsConfig?.[col]?.['type'] === 'removal') {\r\n <div class=\"cellClass\">\r\n\r\n @if (!!row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'] && !row['id'] && !inputConfig()?.multipleInputInEditId ||\r\n !!row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'] && inputConfig()?.multipleInputInEditId &&\r\n inputConfig()?.multipleInputInEditId !== row['id']) {\r\n <div class=\"mit-fn-label\">\r\n <strong>{{ getCalculationFunction(row) }}</strong>\r\n </div>\r\n }\r\n @if (\r\n userCanApplyOptionsTo() &&\r\n !row['SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION'] &&\r\n row[''] !== 'true' && !inputConfig()?.readonly && !inputConfig()?.disabled\r\n ) {\r\n <button mat-icon-button [color]=\"t.menuOpen ? 'primary' : 'basic'\" [matMenuTriggerFor]=\"rowOptions\" [matMenuTriggerData]=\"{row:row}\" #t=\"matMenuTrigger\"\r\n (click)=\"applyOptionsToFn(row)\"\r\n class=\"mit-row-trigger\">\r\n @if (rowIsInEdit(row)) {\r\n <mat-icon color=\"primary\">edit</mat-icon>\r\n } @else {\r\n <mat-icon>{{ t.menuOpen ? 'close' : 'more_horiz' }}</mat-icon>\r\n }\r\n </button>\r\n }\r\n\r\n @if (row['SYSTEM_KEY_IN_EDIT']) {\r\n <mat-chip>In {{ inputConfig()?.readonly ? 'View' : 'Edit' }}</mat-chip>\r\n }\r\n\r\n </div>\r\n }\r\n @if (getColConfig.columnsConfig && getColConfig.columnsConfig?.[col]?.type !== 'removal') {\r\n <div class=\"cellClass\">\r\n <span>\r\n @if (getColConfig.columnsConfig?.[col].dataType === 'array' || getColConfig.columnsConfig?.[col].dataType === 'object') {\r\n <button mat-icon-button class=\"mit-data-button\"\r\n matTooltip=\"View data\"\r\n (click)=\"openDataOverlay($event, row[col])\">\r\n <mat-icon class=\"mit-data-icon\">data_object</mat-icon>\r\n </button>\r\n } @else {\r\n {{ row[col] | formatData: getColConfig.columnsConfig?.[col].dataType }}\r\n }\r\n </span>\r\n </div>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"getColConfig.displayedColumnsInOrder\"></tr>\r\n <tr [class.mit-group-start]=\"hasTopBorder(row)\" mat-row\r\n *matRowDef=\"let row; columns: getColConfig.displayedColumnsInOrder\"></tr>\r\n </table>\r\n\r\n @if (!dataSource()?.data?.length) {\r\n <div class=\"mit-empty\">\r\n <mat-icon class=\"mit-empty-icon\">list</mat-icon>\r\n <strong class=\"mit-empty-title\">No items yet</strong>\r\n <p class=\"mit-empty-text\">\r\n <strong>Click the add button</strong> to create a new row. You'll fill in details using a form, and each\r\n saved entry appears as a row here.\r\n </p>\r\n </div>\r\n }\r\n </div>\r\n} @placeholder {\r\n <div class=\"mit-placeholder\">\r\n <mat-spinner diameter=\"32\" />\r\n </div>\r\n}\r\n\r\n@if (overlayOpen) {\r\n <div class=\"data-overlay-backdrop\" (click)=\"closeDataOverlay()\"></div>\r\n <div class=\"data-overlay-panel\"\r\n [style.top.px]=\"overlayPosition.top\"\r\n [style.left.px]=\"overlayPosition.left\"\r\n (click)=\"$event.stopPropagation()\">\r\n <div class=\"data-overlay-header\">\r\n <span class=\"data-overlay-title\">\r\n <mat-icon class=\"data-overlay-title-icon\">data_object</mat-icon>\r\n Data\r\n </span>\r\n <button mat-icon-button class=\"mit-data-button\" (click)=\"closeDataOverlay()\">\r\n <mat-icon class=\"mit-data-icon\">close</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"data-overlay-body\">\r\n <lib-t-dynamic-data-view [data]=\"overlayData\" />\r\n </div>\r\n </div>\r\n}\r\n\r\n<mat-menu #colOptions=\"matMenu\">\r\n <ng-template matMenuContent>\r\n @for (label of allPossibleLabels(); track label.formControlName) {\r\n <button mat-menu-item (click)=\"toggleTepLabel($event, label.formControlName);\">\r\n <mat-icon>{{ label.selected ? 'check_circle' : 'radio_button_unchecked' }}</mat-icon>\r\n {{ label.label }}\r\n </button>\r\n }\r\n </ng-template>\r\n</mat-menu>\r\n\r\n<mat-menu #rowOptions=\"matMenu\">\r\n <ng-template matMenuContent let-row=\"row\">\r\n @if (!inputConfig()?.readonly && !inputConfig()?.disabled) {\r\n @if (userCanEdit()) {\r\n <button mat-menu-item (click)=\"editItem(row)\">\r\n <mat-icon>edit</mat-icon>\r\n <div class=\"option-text\">\r\n <div class=\"option-main-text\">Edit</div>\r\n <div class=\"option-sub-text\">\r\n {{ inputConfig()?.readonly ? 'View item properties' : 'Modify item properties' }}\r\n </div>\r\n </div>\r\n </button>\r\n }\r\n @if (userCanAdd()) {\r\n <button mat-menu-item (click)=\"copy(row)\">\r\n <mat-icon>content_copy</mat-icon>\r\n <div class=\"option-text\">\r\n <div class=\"option-main-text\">Duplicate</div>\r\n <div class=\"option-sub-text\">Create a copy with same values</div>\r\n </div>\r\n </button>\r\n }\r\n\r\n @if (userCanRemove()) {\r\n @if (isAboutToDeleteRow(row)) {\r\n <button mat-menu-item (click)=\"multipleInputRemoveItem($event,row)\">\r\n <mat-icon color=\"accent\">cancel</mat-icon>\r\n <div class=\"option-text\">\r\n <div class=\"option-main-text option-main-text--cancel\">Cancel Deletion</div>\r\n <div class=\"option-sub-text\">Auto-deleting in {{ secondsCountDown() }} seconds...</div>\r\n </div>\r\n </button>\r\n <div class=\"deletion-progress-container\">\r\n <mat-progress-bar color=\"warn\" mode=\"determinate\" [value]=\"getCountdownSeconds()\"></mat-progress-bar>\r\n @if (getCountdownSeconds() > 75) {\r\n <div class=\"deletion-message\">Deleting soon...</div>\r\n }\r\n </div>\r\n } @else {\r\n <button mat-menu-item (click)=\"multipleInputRemoveItem($event,row)\">\r\n <mat-icon color=\"warn\">delete_outline</mat-icon>\r\n <div class=\"option-text\">\r\n <div class=\"option-main-text\">Delete</div>\r\n <div class=\"option-sub-text\">Will delete after 3 seconds (click to cancel)</div>\r\n </div>\r\n </button>\r\n }\r\n }\r\n }\r\n </ng-template>\r\n</mat-menu>\r\n", styles: [".table-container{max-width:100%!important;overflow:auto!important;border-radius:8px}.mit-table{width:100%;background:transparent}.mit-table .mat-mdc-header-cell,.mit-table .mat-mdc-cell{padding:0 .625rem;font-size:.8125rem}.mit-table .mat-mdc-header-row{min-height:2.25rem}.mit-table .mat-mdc-row{min-height:2.5rem;transition:background .2s cubic-bezier(.16,1,.3,1)}.mit-table .mat-mdc-row:hover{background:color-mix(in srgb,var(--mat-sys-primary, #6750a4) 5%,transparent)}.mit-th-label{text-align:start;line-height:normal;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--mat-sys-on-surface-variant, #49454f)}.mit-th-action{width:1.75rem;height:1.75rem;line-height:1.75rem;opacity:.55;transition:opacity .2s cubic-bezier(.16,1,.3,1)}.mit-th-action:hover{opacity:1}.cellClass{display:flex;align-items:center;min-height:2.5rem}.mit-group-start .mat-mdc-cell{border-top:2px solid var(--mat-sys-outline-variant, #cac4d0)}.functionClass{background:var(--mat-sys-surface-container, #f3edf7);font-weight:500}.mit-fn-label{width:100%;text-align:right;color:var(--mat-sys-on-surface-variant, #49454f);font-size:.6875rem;letter-spacing:.06em;text-transform:uppercase}.mit-row-trigger{margin-left:auto;margin-right:0;display:block}.mit-data-button{width:1.75rem;height:1.75rem;line-height:1.75rem}.mit-data-icon{font-size:1.125rem;width:1.125rem;height:1.125rem;line-height:1.125rem}.mit-state{display:flex;justify-content:center;padding:1rem;font-size:.8125rem;color:var(--mat-sys-on-surface-variant, #49454f);opacity:.7}.mit-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.375rem;padding:1.5rem 1.25rem;color:var(--mat-sys-on-surface-variant, #49454f)}.mit-empty-icon{font-size:1.75rem;width:1.75rem;height:1.75rem;line-height:1.75rem;opacity:.5}.mit-empty-title{font-size:.875rem;color:var(--mat-sys-on-surface, #1c1b1f)}.mit-empty-text{margin:0;max-width:22rem;font-size:.75rem;line-height:1.45;opacity:.85}.mit-placeholder{display:flex;justify-content:center;align-items:center;padding:2rem}.option-text{display:flex;flex-direction:column;margin-left:.5rem}.option-main-text{font-size:.875rem;font-weight:500;margin-bottom:2px;line-height:normal}.option-main-text--cancel{color:var(--mat-sys-primary, #6750a4)}.option-sub-text{font-size:.75rem;color:var(--mat-sys-on-surface-variant, #49454f);font-weight:400;line-height:1.2}.deletion-progress-container{position:relative;padding:0 1rem .5rem}.deletion-message{position:absolute;right:1rem;top:2px;font-size:.6875rem;color:var(--mat-sys-error, #b3261e);font-weight:500;line-height:1.6;animation:pulse 1s infinite}button:has(+.deletion-progress-container){border-bottom:none!important;padding-bottom:4px!important}@keyframes pulse{0%{opacity:.7}50%{opacity:1}to{opacity:.7}}@media(max-width:600px){.option-sub-text{max-width:180px;white-space:normal}}.data-overlay-backdrop{position:fixed;inset:0;z-index:999;background:transparent}.data-overlay-panel{position:fixed;z-index:1000;background:var(--mat-sys-surface, #fef7ff);border:1px solid color-mix(in srgb,var(--mat-sys-outline, #79747e) 15%,transparent);border-radius:12px;box-shadow:0 16px 56px color-mix(in srgb,var(--mat-sys-shadow, #000) 14%,transparent);min-width:280px;max-width:min(380px,calc(100vw - 16px));max-height:60vh;display:flex;flex-direction:column;overflow:hidden}.data-overlay-header{display:flex;align-items:center;justify-content:space-between;padding:.25rem .25rem .25rem .75rem;border-bottom:1px solid color-mix(in srgb,var(--mat-sys-outline, #79747e) 12%,transparent);flex-shrink:0}.data-overlay-title{font-size:.8125rem;font-weight:500;display:flex;align-items:center;color:var(--mat-sys-on-surface, #1c1b1f)}.data-overlay-title-icon{font-size:1rem;width:1rem;height:1rem;line-height:1rem;vertical-align:middle;margin-right:.25rem}.data-overlay-body{overflow:auto;padding:.25rem .5rem .5rem;flex:1}\n"] }]
|
|
447
|
-
}], ctorParameters: null, propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: false }] }], dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: false }] }], applyOptionsTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "applyOptionsTo", required: false }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: false }] }], onEditItem: [{ type: i0.Output, args: ["onEditItem"] }], onDeleteItem: [{ type: i0.Output, args: ["onDeleteItem"] }], onCopy: [{ type: i0.Output, args: ["onCopy"] }], onApplyOptionsTo: [{ type: i0.Output, args: ["onApplyOptionsTo"] }], showItemAsLabel: [{ type: i0.Output, args: ["showItemAsLabel"] }] } }) });
|
|
448
|
-
|
|
449
|
-
class MultipleInputTableEditComponent {
|
|
450
|
-
constructor() {
|
|
451
|
-
this.InputComponent = TFormInputComponent;
|
|
452
|
-
this.inputConfig = input.required(...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
|
|
453
|
-
this.editorMode = input(false, ...(ngDevMode ? [{ debugName: "editorMode" }] : /* istanbul ignore next */ []));
|
|
454
|
-
this.formGroup = input(null, ...(ngDevMode ? [{ debugName: "formGroup" }] : /* istanbul ignore next */ []));
|
|
455
|
-
this.formBuilderFunctions = input(undefined, ...(ngDevMode ? [{ debugName: "formBuilderFunctions" }] : /* istanbul ignore next */ []));
|
|
456
|
-
this.onSaveMultipleInputForm = output();
|
|
457
|
-
this.editMultipleInput = output();
|
|
458
|
-
this.deleteInput = output();
|
|
459
|
-
this.showItemAsLabel = output();
|
|
460
|
-
this.addFunction = output();
|
|
461
|
-
this.reorderItems = output();
|
|
462
|
-
this.calculationFunctions = Object.values(CalculationFunctions);
|
|
463
|
-
this.activeInput = '';
|
|
464
|
-
this.dragging = false;
|
|
465
|
-
this.overId = null;
|
|
466
|
-
this.areYouSure = false;
|
|
467
|
-
this.countdownSeconds = {};
|
|
468
|
-
this.innerInputs = computed(() => {
|
|
469
|
-
const cfg = this.inputConfig();
|
|
470
|
-
return (cfg?.formInputs?.map((input) => ({
|
|
471
|
-
...input,
|
|
472
|
-
originalId: input.id,
|
|
473
|
-
id: `${cfg?.id}.${input.id}`,
|
|
474
|
-
})) || []);
|
|
475
|
-
}, ...(ngDevMode ? [{ debugName: "innerInputs" }] : /* istanbul ignore next */ []));
|
|
476
|
-
this.rowInUpdate = computed(() => {
|
|
477
|
-
const cfg = this.inputConfig();
|
|
478
|
-
const fg = this.formGroup();
|
|
479
|
-
return !!cfg?.formIsOpen && !!fg?.controls[`${cfg?.id}.id`]?.value;
|
|
480
|
-
}, ...(ngDevMode ? [{ debugName: "rowInUpdate" }] : /* istanbul ignore next */ []));
|
|
481
|
-
this.formInvalid = computed(() => {
|
|
482
|
-
const cfg = this.inputConfig();
|
|
483
|
-
const fg = this.formGroup();
|
|
484
|
-
const allControls = [];
|
|
485
|
-
cfg?.formInputs?.forEach((input) => {
|
|
486
|
-
const control = fg?.controls[`${cfg?.id}.${input.id}`];
|
|
487
|
-
if (control) {
|
|
488
|
-
allControls.push(control);
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
return allControls.some((control) => control?.invalid || !control);
|
|
492
|
-
}, ...(ngDevMode ? [{ debugName: "formInvalid" }] : /* istanbul ignore next */ []));
|
|
493
|
-
this.#destroyRef = inject(DestroyRef);
|
|
494
|
-
}
|
|
495
|
-
#destroyRef;
|
|
496
|
-
ngOnDestroy() {
|
|
497
|
-
Object.values(this.countdownSeconds).forEach(({ stop$ }) => stop$.complete());
|
|
498
|
-
}
|
|
499
|
-
saveMultipleInputForm() {
|
|
500
|
-
this.onSaveMultipleInputForm.emit();
|
|
501
|
-
}
|
|
502
|
-
inputWillBeRemovedIn(id) {
|
|
503
|
-
return this.countdownSeconds[id]?.count;
|
|
504
|
-
}
|
|
505
|
-
removeInput(item) {
|
|
506
|
-
if (this.countdownSeconds[item.id]) {
|
|
507
|
-
this.stopDeletion(item.id);
|
|
508
|
-
return;
|
|
509
|
-
}
|
|
510
|
-
this.countdownSeconds[item.id] = {
|
|
511
|
-
count: 5,
|
|
512
|
-
stop$: new Subject(),
|
|
513
|
-
};
|
|
514
|
-
const countdown$ = timer(0, 1000).pipe(tap((secondsElapsed) => {
|
|
515
|
-
const data = this.countdownSeconds[item.id];
|
|
516
|
-
if (!data) {
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
const remainingTime = 5 - secondsElapsed;
|
|
520
|
-
if (remainingTime <= 0) {
|
|
521
|
-
this.formDeleteInput(item);
|
|
522
|
-
this.stopDeletion(item.id);
|
|
523
|
-
}
|
|
524
|
-
else {
|
|
525
|
-
data.count = remainingTime;
|
|
526
|
-
}
|
|
527
|
-
}), takeUntil(this.countdownSeconds[item.id].stop$), takeUntilDestroyed(this.#destroyRef));
|
|
528
|
-
countdown$.subscribe({
|
|
529
|
-
complete: () => { },
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
stopDeletion(id) {
|
|
533
|
-
if (this.countdownSeconds[id]) {
|
|
534
|
-
this.countdownSeconds[id]?.stop$.next();
|
|
535
|
-
delete this.countdownSeconds[id];
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
formDeleteInput(item) {
|
|
539
|
-
this.deleteInput.emit(item);
|
|
540
|
-
}
|
|
541
|
-
dropItems(event) {
|
|
542
|
-
this.reorderItems.emit(event);
|
|
543
|
-
}
|
|
544
|
-
editInput(input) {
|
|
545
|
-
this.editMultipleInput.emit(input);
|
|
546
|
-
}
|
|
547
|
-
toggleLabel(item) {
|
|
548
|
-
this.showItemAsLabel.emit(item);
|
|
549
|
-
}
|
|
550
|
-
toggleFunction(func, _inputId) {
|
|
551
|
-
const addFunction = {
|
|
552
|
-
id: v4(),
|
|
553
|
-
inputId: this.activeInput,
|
|
554
|
-
func,
|
|
555
|
-
};
|
|
556
|
-
this.addFunction.emit(addFunction);
|
|
557
|
-
}
|
|
558
|
-
selectedFunction(func) {
|
|
559
|
-
return this.inputConfig()?.calculateListFunctions?.find((f) => f.inputId === this.activeInput && f.func === func);
|
|
560
|
-
}
|
|
561
|
-
closeMultipleInput() {
|
|
562
|
-
if (this.areYouSure) {
|
|
563
|
-
this.formBuilderFunctions()?.multipleInputToggleForm(this.inputConfig().id, false);
|
|
564
|
-
this.areYouSure = false;
|
|
565
|
-
return;
|
|
566
|
-
}
|
|
567
|
-
this.areYouSure = true;
|
|
568
|
-
}
|
|
569
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputTableEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
570
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MultipleInputTableEditComponent, isStandalone: true, selector: "lib-multiple-input-table-edit", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, editorMode: { classPropertyName: "editorMode", publicName: "editorMode", isSignal: true, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: false, transformFunction: null }, formBuilderFunctions: { classPropertyName: "formBuilderFunctions", publicName: "formBuilderFunctions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSaveMultipleInputForm: "onSaveMultipleInputForm", editMultipleInput: "editMultipleInput", deleteInput: "deleteInput", showItemAsLabel: "showItemAsLabel", addFunction: "addFunction", reorderItems: "reorderItems" }, ngImport: i0, template: "<mat-card appearance=\"outlined\" class=\"edit-card mat-elevation-z4\">\r\n <mat-card-content>\r\n <div class=\"list row\" (cdkDropListDropped)=\"dropItems($event)\"\r\n [cdkDropListData]=\"innerInputs()\" cdkDropList #InputList=\"cdkDropList\">\r\n @for (innerInput of innerInputs(); track innerInput.id) {\r\n <ng-container>\r\n @if (editorMode()) {\r\n @if (!!formGroup()) {\r\n <mat-card (mouseover)=\"activeInput = innerInput.id\" cdkDrag\r\n (cdkDragStarted)=\"dragging = true\" (cdkDragReleased)=\"dragging = false\"\r\n [class.inputCardElevated]=\"activeInput === innerInput.id\"\r\n [class.inputCard]=\"activeInput !== innerInput.id\"\r\n [class]=\"'col-md-' + (dragging ? '12' : innerInput.colSize)\" class=\"box\">\r\n <ng-container *ngComponentOutlet=\"InputComponent;\r\n inputs: {\r\n inputConfig: innerInput,\r\n formGroup: formGroup(),\r\n formBuilderFunctions: formBuilderFunctions(),\r\n }\">\r\n </ng-container>\r\n @if (activeInput === innerInput.id) {\r\n <mat-card-actions class=\"input-actions\">\r\n <span class=\"spacer\"></span>\r\n <button [matTooltip]=\"'Edit Input: ' + innerInput.label\"\r\n (click)=\"editInput(innerInput)\" mat-icon-button>\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n @if (!!inputWillBeRemovedIn(innerInput.id)) {\r\n <button (mouseover)=\"overId = innerInput.id\" (mouseout)=\"overId = null\"\r\n (click)=\"removeInput(innerInput)\" color=\"warn\" mat-stroked-button>\r\n <div class=\"countdown-button\">\r\n <mat-progress-spinner class=\"cancelProgress\" color=\"primary\"\r\n [value]=\"((inputWillBeRemovedIn(innerInput.id) || 0) / 5) * 100\">\r\n </mat-progress-spinner>\r\n {{ overId === innerInput.id ? 'Click to cancel' : 'Deleting in' }}\r\n {{ inputWillBeRemovedIn(innerInput.id) }}\r\n </div>\r\n </button>\r\n } @else if (inputConfig().systemDefault !== true && innerInput.systemDefault !== true) {\r\n <button [matTooltip]=\"'Delete input ' + innerInput.label\"\r\n (click)=\"removeInput(innerInput)\" mat-icon-button>\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n <span class=\"action-divider\"></span>\r\n @if (!!innerInput.showAsLabel && innerInput.dataType === 'number' || !!innerInput.showAsLabel && innerInput.type === 'number') {\r\n <button\r\n [matMenuTriggerFor]=\"calculationMenu\"\r\n [matMenuTriggerData]=\"{inputId:innerInput.originalId || innerInput.id}\"\r\n [matTooltip]=\"'calculate sum,avg,min,max'\"\r\n mat-icon-button>\r\n <mat-icon>calculate</mat-icon>\r\n </button>\r\n }\r\n <button [color]=\"innerInput.showAsLabel ? 'primary' : ''\"\r\n (click)=\"toggleLabel(innerInput)\"\r\n [matTooltip]=\"innerInput.showAsLabel ? 'Hide as label' : 'Show as label'\"\r\n mat-icon-button>\r\n <mat-icon>label</mat-icon>\r\n </button>\r\n <span class=\"spacer\"></span>\r\n </mat-card-actions>\r\n }\r\n </mat-card>\r\n }\r\n } @else {\r\n <div [class]=\"'col-md-' + (dragging ? '12' : innerInput.colSize)\" class=\"box\">\r\n <ng-container *ngComponentOutlet=\"InputComponent;\r\n inputs: {\r\n inputConfig: innerInput,\r\n formGroup: formGroup(),\r\n formBuilderFunctions: formBuilderFunctions(),\r\n }\">\r\n </ng-container>\r\n </div>\r\n }\r\n </ng-container>\r\n }\r\n @if (!!editorMode() && innerInputs().length === 0) {\r\n <div class=\"tree-instructions\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>\r\n <strong>Add Form Input</strong>\r\n <br>\r\n Manage your list by adding, editing, or removing items. Each item is customizable through a form.\r\n </span>\r\n </div>\r\n }\r\n </div>\r\n </mat-card-content>\r\n @if (innerInputs().length !== 0) {\r\n <mat-divider></mat-divider>\r\n <mat-card-actions align=\"end\" class=\"edit-card-actions\">\r\n <button [color]=\"areYouSure ? 'warn' : ''\"\r\n [class.confirm-leave]=\"areYouSure\" mat-button\r\n (click)=\"closeMultipleInput()\">\r\n {{ areYouSure ? \"leave without saving\" : \"cancel\" }}\r\n </button>\r\n @if (!inputConfig().readonly) {\r\n <button [disabled]=\"!!formInvalid()\" class=\"save-button\" color=\"primary\"\r\n (click)=\"saveMultipleInputForm()\" mat-raised-button>\r\n {{ rowInUpdate() ? \"Update\" : \"Save\" }}\r\n </button>\r\n }\r\n </mat-card-actions>\r\n }\r\n</mat-card>\r\n\r\n\r\n<mat-menu #calculationMenu=\"matMenu\">\r\n <ng-template matMenuContent let-inputId=\"sectionId\">\r\n @for (func of calculationFunctions; track func) {\r\n <button (click)=\"toggleFunction(func, inputId)\" mat-menu-item>\r\n {{ func }}\r\n @if (selectedFunction(func)) {\r\n <mat-icon color=\"primary\">check_circle</mat-icon>\r\n }\r\n </button>\r\n }\r\n </ng-template>\r\n</mat-menu>\r\n", styles: [".edit-card{margin-top:.5rem;background:var(--mat-sys-surface-container, #f3edf7);border-radius:12px}.inputCardElevated{background:var(--mat-sys-surface, #fef7ff);box-shadow:var(--mdc-elevated-card-container-elevation);transition:box-shadow .3s cubic-bezier(.16,1,.3,1)}.inputCard{box-shadow:none;transition:box-shadow .3s cubic-bezier(.16,1,.3,1)}.list{min-height:60px}.box{padding:.25rem;cursor:move}.input-actions{display:flex;align-items:center;gap:.125rem}.action-divider{width:1px;align-self:stretch;margin:.25rem;background:color-mix(in srgb,var(--mat-sys-outline, #79747e) 25%,transparent)}.countdown-button{display:flex;align-items:center}.cdk-drag-preview{box-sizing:border-box;border:none;border-radius:8px;box-shadow:0 5px 5px -3px color-mix(in srgb,var(--mat-sys-shadow, #000) 20%,transparent),0 8px 10px 1px color-mix(in srgb,var(--mat-sys-shadow, #000) 14%,transparent),0 3px 14px 2px color-mix(in srgb,var(--mat-sys-shadow, #000) 12%,transparent)}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.box:last-child{border:none}.list.cdk-drop-list-dragging .box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.cancelProgress{height:24px!important;width:24px!important;margin-right:.3125rem}.edit-card-actions{gap:.5rem;padding:.5rem .75rem .75rem}.confirm-leave{text-decoration:underline}.save-button{min-width:10em}.tree-instructions{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:color-mix(in srgb,var(--mat-sys-primary, #6750a4) 6%,transparent);border:1px solid color-mix(in srgb,var(--mat-sys-primary, #6750a4) 14%,transparent);border-radius:8px;margin-bottom:1rem;font-size:.8125rem;color:var(--mat-sys-on-surface-variant, #49454f)}.info-icon{min-width:38px!important;display:block;margin-top:4px;margin-bottom:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i3$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$2.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i3$2.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i6$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
571
|
-
}
|
|
572
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputTableEditComponent, decorators: [{
|
|
573
|
-
type: Component,
|
|
574
|
-
args: [{ selector: 'lib-multiple-input-table-edit', imports: [
|
|
575
|
-
CommonModule,
|
|
576
|
-
DragDropModule,
|
|
577
|
-
MatButtonModule,
|
|
578
|
-
MatCardModule,
|
|
579
|
-
MatDividerModule,
|
|
580
|
-
MatIconModule,
|
|
581
|
-
MatMenuModule,
|
|
582
|
-
MatProgressSpinnerModule,
|
|
583
|
-
MatTooltipModule,
|
|
584
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<mat-card appearance=\"outlined\" class=\"edit-card mat-elevation-z4\">\r\n <mat-card-content>\r\n <div class=\"list row\" (cdkDropListDropped)=\"dropItems($event)\"\r\n [cdkDropListData]=\"innerInputs()\" cdkDropList #InputList=\"cdkDropList\">\r\n @for (innerInput of innerInputs(); track innerInput.id) {\r\n <ng-container>\r\n @if (editorMode()) {\r\n @if (!!formGroup()) {\r\n <mat-card (mouseover)=\"activeInput = innerInput.id\" cdkDrag\r\n (cdkDragStarted)=\"dragging = true\" (cdkDragReleased)=\"dragging = false\"\r\n [class.inputCardElevated]=\"activeInput === innerInput.id\"\r\n [class.inputCard]=\"activeInput !== innerInput.id\"\r\n [class]=\"'col-md-' + (dragging ? '12' : innerInput.colSize)\" class=\"box\">\r\n <ng-container *ngComponentOutlet=\"InputComponent;\r\n inputs: {\r\n inputConfig: innerInput,\r\n formGroup: formGroup(),\r\n formBuilderFunctions: formBuilderFunctions(),\r\n }\">\r\n </ng-container>\r\n @if (activeInput === innerInput.id) {\r\n <mat-card-actions class=\"input-actions\">\r\n <span class=\"spacer\"></span>\r\n <button [matTooltip]=\"'Edit Input: ' + innerInput.label\"\r\n (click)=\"editInput(innerInput)\" mat-icon-button>\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n @if (!!inputWillBeRemovedIn(innerInput.id)) {\r\n <button (mouseover)=\"overId = innerInput.id\" (mouseout)=\"overId = null\"\r\n (click)=\"removeInput(innerInput)\" color=\"warn\" mat-stroked-button>\r\n <div class=\"countdown-button\">\r\n <mat-progress-spinner class=\"cancelProgress\" color=\"primary\"\r\n [value]=\"((inputWillBeRemovedIn(innerInput.id) || 0) / 5) * 100\">\r\n </mat-progress-spinner>\r\n {{ overId === innerInput.id ? 'Click to cancel' : 'Deleting in' }}\r\n {{ inputWillBeRemovedIn(innerInput.id) }}\r\n </div>\r\n </button>\r\n } @else if (inputConfig().systemDefault !== true && innerInput.systemDefault !== true) {\r\n <button [matTooltip]=\"'Delete input ' + innerInput.label\"\r\n (click)=\"removeInput(innerInput)\" mat-icon-button>\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n <span class=\"action-divider\"></span>\r\n @if (!!innerInput.showAsLabel && innerInput.dataType === 'number' || !!innerInput.showAsLabel && innerInput.type === 'number') {\r\n <button\r\n [matMenuTriggerFor]=\"calculationMenu\"\r\n [matMenuTriggerData]=\"{inputId:innerInput.originalId || innerInput.id}\"\r\n [matTooltip]=\"'calculate sum,avg,min,max'\"\r\n mat-icon-button>\r\n <mat-icon>calculate</mat-icon>\r\n </button>\r\n }\r\n <button [color]=\"innerInput.showAsLabel ? 'primary' : ''\"\r\n (click)=\"toggleLabel(innerInput)\"\r\n [matTooltip]=\"innerInput.showAsLabel ? 'Hide as label' : 'Show as label'\"\r\n mat-icon-button>\r\n <mat-icon>label</mat-icon>\r\n </button>\r\n <span class=\"spacer\"></span>\r\n </mat-card-actions>\r\n }\r\n </mat-card>\r\n }\r\n } @else {\r\n <div [class]=\"'col-md-' + (dragging ? '12' : innerInput.colSize)\" class=\"box\">\r\n <ng-container *ngComponentOutlet=\"InputComponent;\r\n inputs: {\r\n inputConfig: innerInput,\r\n formGroup: formGroup(),\r\n formBuilderFunctions: formBuilderFunctions(),\r\n }\">\r\n </ng-container>\r\n </div>\r\n }\r\n </ng-container>\r\n }\r\n @if (!!editorMode() && innerInputs().length === 0) {\r\n <div class=\"tree-instructions\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>\r\n <strong>Add Form Input</strong>\r\n <br>\r\n Manage your list by adding, editing, or removing items. Each item is customizable through a form.\r\n </span>\r\n </div>\r\n }\r\n </div>\r\n </mat-card-content>\r\n @if (innerInputs().length !== 0) {\r\n <mat-divider></mat-divider>\r\n <mat-card-actions align=\"end\" class=\"edit-card-actions\">\r\n <button [color]=\"areYouSure ? 'warn' : ''\"\r\n [class.confirm-leave]=\"areYouSure\" mat-button\r\n (click)=\"closeMultipleInput()\">\r\n {{ areYouSure ? \"leave without saving\" : \"cancel\" }}\r\n </button>\r\n @if (!inputConfig().readonly) {\r\n <button [disabled]=\"!!formInvalid()\" class=\"save-button\" color=\"primary\"\r\n (click)=\"saveMultipleInputForm()\" mat-raised-button>\r\n {{ rowInUpdate() ? \"Update\" : \"Save\" }}\r\n </button>\r\n }\r\n </mat-card-actions>\r\n }\r\n</mat-card>\r\n\r\n\r\n<mat-menu #calculationMenu=\"matMenu\">\r\n <ng-template matMenuContent let-inputId=\"sectionId\">\r\n @for (func of calculationFunctions; track func) {\r\n <button (click)=\"toggleFunction(func, inputId)\" mat-menu-item>\r\n {{ func }}\r\n @if (selectedFunction(func)) {\r\n <mat-icon color=\"primary\">check_circle</mat-icon>\r\n }\r\n </button>\r\n }\r\n </ng-template>\r\n</mat-menu>\r\n", styles: [".edit-card{margin-top:.5rem;background:var(--mat-sys-surface-container, #f3edf7);border-radius:12px}.inputCardElevated{background:var(--mat-sys-surface, #fef7ff);box-shadow:var(--mdc-elevated-card-container-elevation);transition:box-shadow .3s cubic-bezier(.16,1,.3,1)}.inputCard{box-shadow:none;transition:box-shadow .3s cubic-bezier(.16,1,.3,1)}.list{min-height:60px}.box{padding:.25rem;cursor:move}.input-actions{display:flex;align-items:center;gap:.125rem}.action-divider{width:1px;align-self:stretch;margin:.25rem;background:color-mix(in srgb,var(--mat-sys-outline, #79747e) 25%,transparent)}.countdown-button{display:flex;align-items:center}.cdk-drag-preview{box-sizing:border-box;border:none;border-radius:8px;box-shadow:0 5px 5px -3px color-mix(in srgb,var(--mat-sys-shadow, #000) 20%,transparent),0 8px 10px 1px color-mix(in srgb,var(--mat-sys-shadow, #000) 14%,transparent),0 3px 14px 2px color-mix(in srgb,var(--mat-sys-shadow, #000) 12%,transparent)}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.box:last-child{border:none}.list.cdk-drop-list-dragging .box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.cancelProgress{height:24px!important;width:24px!important;margin-right:.3125rem}.edit-card-actions{gap:.5rem;padding:.5rem .75rem .75rem}.confirm-leave{text-decoration:underline}.save-button{min-width:10em}.tree-instructions{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:color-mix(in srgb,var(--mat-sys-primary, #6750a4) 6%,transparent);border:1px solid color-mix(in srgb,var(--mat-sys-primary, #6750a4) 14%,transparent);border-radius:8px;margin-bottom:1rem;font-size:.8125rem;color:var(--mat-sys-on-surface-variant, #49454f)}.info-icon{min-width:38px!important;display:block;margin-top:4px;margin-bottom:auto}\n"] }]
|
|
585
|
-
}], propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }], editorMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "editorMode", required: false }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: false }] }], formBuilderFunctions: [{ type: i0.Input, args: [{ isSignal: true, alias: "formBuilderFunctions", required: false }] }], onSaveMultipleInputForm: [{ type: i0.Output, args: ["onSaveMultipleInputForm"] }], editMultipleInput: [{ type: i0.Output, args: ["editMultipleInput"] }], deleteInput: [{ type: i0.Output, args: ["deleteInput"] }], showItemAsLabel: [{ type: i0.Output, args: ["showItemAsLabel"] }], addFunction: [{ type: i0.Output, args: ["addFunction"] }], reorderItems: [{ type: i0.Output, args: ["reorderItems"] }] } });
|
|
586
|
-
|
|
587
|
-
function getCaluculatedTableData(inputConfig, data) {
|
|
588
|
-
try {
|
|
589
|
-
if (!Array.isArray(data) || !inputConfig)
|
|
590
|
-
return data;
|
|
591
|
-
const input = inputConfig;
|
|
592
|
-
const funcs = (input?.calculateListFunctions || []);
|
|
593
|
-
const allUniqueFunctionNames = [
|
|
594
|
-
...new Set(funcs.map((f) => f.func)),
|
|
595
|
-
];
|
|
596
|
-
const calculatedData = allUniqueFunctionNames.map((func) => {
|
|
597
|
-
const newCalculatedData = {
|
|
598
|
-
SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION: func,
|
|
599
|
-
};
|
|
600
|
-
funcs.filter((f) => f.func === func).forEach((f) => {
|
|
601
|
-
const arrayValues = data.map((d) => Number(d[f.inputId]));
|
|
602
|
-
newCalculatedData[f.inputId] = calculateListOveralFunctions(func, arrayValues);
|
|
603
|
-
});
|
|
604
|
-
return newCalculatedData;
|
|
605
|
-
});
|
|
606
|
-
return [...data, ...calculatedData];
|
|
607
|
-
}
|
|
608
|
-
catch (error) {
|
|
609
|
-
return data;
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
const customInputConfig = {
|
|
614
|
-
controlType: 'app-multiple-input-table',
|
|
615
|
-
nextId: 0,
|
|
616
|
-
};
|
|
617
|
-
class MultipleInputTableComponent extends BaseCustomInput {
|
|
618
|
-
#destroyRef;
|
|
619
|
-
constructor() {
|
|
620
|
-
super(inject(NgControl, { self: true, optional: true }), inject(ElementRef), customInputConfig);
|
|
621
|
-
this.editorMode = input(false, ...(ngDevMode ? [{ debugName: "editorMode" }] : /* istanbul ignore next */ []));
|
|
622
|
-
this.formGroup = input.required(...(ngDevMode ? [{ debugName: "formGroup" }] : /* istanbul ignore next */ []));
|
|
623
|
-
this.inputConfig = input.required(...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
|
|
624
|
-
this.formBuilderFunctions = input(undefined, ...(ngDevMode ? [{ debugName: "formBuilderFunctions" }] : /* istanbul ignore next */ []));
|
|
625
|
-
this.#destroyRef = inject(DestroyRef);
|
|
626
|
-
this.rowInViewOnly = undefined;
|
|
627
|
-
this.listenToValueChanges();
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* Manages custom validation errors on the form control.
|
|
631
|
-
* Intended to be called from the ngDoCheck lifecycle hook.
|
|
632
|
-
* This function handles both the 'required' error and the new
|
|
633
|
-
* 'multipleInputListMissingSomeFields' custom error.
|
|
634
|
-
*/
|
|
635
|
-
checkValidationsAnErrors() {
|
|
636
|
-
const control = this.ngControl?.control;
|
|
637
|
-
// 1. Early exit if there's no form control to work with.
|
|
638
|
-
if (!control) {
|
|
639
|
-
return;
|
|
640
|
-
}
|
|
641
|
-
// --- DEFINE THE DESIRED ERROR STATE ---
|
|
642
|
-
// 2. Determine if the custom "multiple fields" error should exist.
|
|
643
|
-
const missingFields = this.#missingRequiredFields();
|
|
644
|
-
// 3. Determine if the standard 'required' error should exist.
|
|
645
|
-
const shouldHaveRequiredError = this.required && this._isNilOrEmpty(this.value);
|
|
646
|
-
// --- APPLY THE ERROR STATE TO THE CONTROL ---
|
|
647
|
-
// 4. Preserve other errors that might be on the control (e.g., minlength, pattern).
|
|
648
|
-
const newErrors = { ...control.errors };
|
|
649
|
-
delete newErrors['required'];
|
|
650
|
-
delete newErrors['multipleInputListMissingSomeFields'];
|
|
651
|
-
// 5. Add our managed errors back if their conditions are met.
|
|
652
|
-
if (shouldHaveRequiredError) {
|
|
653
|
-
newErrors['required'] = true;
|
|
654
|
-
}
|
|
655
|
-
if (missingFields.length > 0) {
|
|
656
|
-
// `missing` names the offending rows/fields so the rendered message can
|
|
657
|
-
// tell the user exactly what to fix — see inputErrorMessage.ts.
|
|
658
|
-
newErrors['multipleInputListMissingSomeFields'] = { value: true, missing: missingFields };
|
|
659
|
-
}
|
|
660
|
-
// 6. Finalize the error object. If no errors, it must be null.
|
|
661
|
-
const finalErrors = Object.keys(newErrors).length > 0 ? newErrors : null;
|
|
662
|
-
// 7. IMPORTANT: Only update the control if the errors have actually changed.
|
|
663
|
-
// This prevents infinite loops within ngDoCheck. A simple stringify is a
|
|
664
|
-
// dependency-free way to compare the error objects.
|
|
665
|
-
if (JSON.stringify(control.errors) !== JSON.stringify(finalErrors)) {
|
|
666
|
-
control.setErrors(finalErrors);
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
get empty() {
|
|
670
|
-
return !this.value;
|
|
671
|
-
}
|
|
672
|
-
get shouldLabelFloat() {
|
|
673
|
-
return this.focused || !this.empty;
|
|
674
|
-
}
|
|
675
|
-
get errorState() {
|
|
676
|
-
// 1. Check for standard validation errors from Angular's Forms API.
|
|
677
|
-
const hasStandardError = !!this.ngControl?.errors;
|
|
678
|
-
// 2. Check for custom validation errors specific to 'IMultiple' type.
|
|
679
|
-
const hasCustomError = this.#missingRequiredFields().length > 0;
|
|
680
|
-
// 3. The final error state is true if *any* validation fails,
|
|
681
|
-
// AND the control has been "touched" by the user.
|
|
682
|
-
return (hasStandardError || hasCustomError) && this.touched;
|
|
683
|
-
}
|
|
684
|
-
_isNilOrEmpty(value) {
|
|
685
|
-
return value === null || value === undefined || value === '';
|
|
686
|
-
}
|
|
687
|
-
/**
|
|
688
|
-
* Rows (1-based, in value order) whose required child inputs are empty,
|
|
689
|
-
* each with the labels of the inputs still missing. Drives both `errorState`
|
|
690
|
-
* and the `multipleInputListMissingSomeFields` error payload.
|
|
691
|
-
*/
|
|
692
|
-
#missingRequiredFields() {
|
|
693
|
-
const formInputs = this.inputConfig()?.formInputs;
|
|
694
|
-
if (!Array.isArray(formInputs) || !Array.isArray(this.value))
|
|
695
|
-
return [];
|
|
696
|
-
const requiredFields = formInputs.filter(i => i.required);
|
|
697
|
-
if (requiredFields.length === 0)
|
|
698
|
-
return [];
|
|
699
|
-
const configId = this.inputConfig().id;
|
|
700
|
-
const missing = [];
|
|
701
|
-
this.value.forEach((item, index) => {
|
|
702
|
-
const fields = requiredFields
|
|
703
|
-
.filter(f => this._isNilOrEmpty(item?.[`${configId}.${f.id}`]))
|
|
704
|
-
.map(f => f.label || f.id);
|
|
705
|
-
if (fields.length > 0) {
|
|
706
|
-
missing.push({ row: index + 1, fields });
|
|
707
|
-
}
|
|
708
|
-
});
|
|
709
|
-
return missing;
|
|
710
|
-
}
|
|
711
|
-
listenToValueChanges() {
|
|
712
|
-
this.stateChanges
|
|
713
|
-
.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
714
|
-
.subscribe(() => {
|
|
715
|
-
this.checkItemList();
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
checkItemList() {
|
|
719
|
-
try {
|
|
720
|
-
if (this.value) {
|
|
721
|
-
const config = this.inputConfig();
|
|
722
|
-
const TableData = (config.groupBy?.length ?? 0) > 0
|
|
723
|
-
? addGroups(this.value, config.groupBy)
|
|
724
|
-
: this.value;
|
|
725
|
-
const data = getCaluculatedTableData(config, TableData);
|
|
726
|
-
if (!this.dataSource) {
|
|
727
|
-
this.dataSource = new MatTableDataSource(data);
|
|
728
|
-
this.dataSource;
|
|
729
|
-
}
|
|
730
|
-
else {
|
|
731
|
-
this.dataSource.data = data;
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
return true;
|
|
735
|
-
}
|
|
736
|
-
catch {
|
|
737
|
-
return false;
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
multipleInputRemoveItem(item) {
|
|
741
|
-
if (!item)
|
|
742
|
-
return;
|
|
743
|
-
if (!this.value)
|
|
744
|
-
return;
|
|
745
|
-
this.value = this.value.filter((i) => !_isEqual(i, item));
|
|
746
|
-
this.applyOptionsTo = undefined;
|
|
747
|
-
this.onChange(this.value);
|
|
748
|
-
this.stateChanges.next();
|
|
749
|
-
}
|
|
750
|
-
generateMultipleInputForm() {
|
|
751
|
-
const id = this.inputConfig()?.id;
|
|
752
|
-
if (!id)
|
|
753
|
-
return;
|
|
754
|
-
this.formBuilderFunctions()?.multipleInputToggleForm(id, true);
|
|
755
|
-
}
|
|
756
|
-
editRow(rowId) {
|
|
757
|
-
if (!rowId) {
|
|
758
|
-
throw new Error('Row id not provided');
|
|
759
|
-
}
|
|
760
|
-
const config = this.inputConfig();
|
|
761
|
-
const fbf = this.formBuilderFunctions();
|
|
762
|
-
if (!fbf || !config)
|
|
763
|
-
return;
|
|
764
|
-
fbf.multipleInputEditRow(config.id, rowId);
|
|
765
|
-
// if( !this.inputConfig?.multipleInputController){
|
|
766
|
-
// return
|
|
767
|
-
// }
|
|
768
|
-
// this.inputConfig.multipleInputInEditId = this.applyOptionsTo.id;
|
|
769
|
-
// this.inputConfig.applyMultipleInputValuesToForm(
|
|
770
|
-
// this.applyOptionsTo
|
|
771
|
-
// );
|
|
772
|
-
}
|
|
773
|
-
copy(rowId) {
|
|
774
|
-
const config = this.inputConfig();
|
|
775
|
-
const fbf = this.formBuilderFunctions();
|
|
776
|
-
if (!fbf || !config)
|
|
777
|
-
return;
|
|
778
|
-
fbf.multipleInputDuplicateRow(config.id, rowId);
|
|
779
|
-
// this.generateMultipleInputForm();
|
|
780
|
-
// this.inputConfig?.applyMultipleInputValuesToForm(
|
|
781
|
-
// this.applyOptionsTo
|
|
782
|
-
// );
|
|
783
|
-
// this.applyOptionsTo = undefined;
|
|
784
|
-
}
|
|
785
|
-
get handleLabel() {
|
|
786
|
-
return this.inputConfig()?.handleLabel;
|
|
787
|
-
}
|
|
788
|
-
handleIcon() {
|
|
789
|
-
// NOTE(phase-4): `handleIcon` is declared on `IBasicFormInput` but not on `IMultiple` directly;
|
|
790
|
-
// narrow through `ITowerStepColumn` (which extends FormColumnInputs) and provide a string fallback.
|
|
791
|
-
const cfg = this.inputConfig();
|
|
792
|
-
return cfg?.handleIcon || 'add';
|
|
793
|
-
}
|
|
794
|
-
saveMultipleInputForm() {
|
|
795
|
-
this.formBuilderFunctions()?.multipleInputSaveForm(this.inputConfig().id);
|
|
796
|
-
// const value: any = this.inputConfig?.multipleInputFormValue();
|
|
797
|
-
// value['id'] = uuidv4();
|
|
798
|
-
// if (!this.inputConfig) {
|
|
799
|
-
// return
|
|
800
|
-
// }
|
|
801
|
-
// const previousValue = this.value
|
|
802
|
-
// if (!previousValue) {
|
|
803
|
-
// this.value = [value];
|
|
804
|
-
// this.inputConfig.multipleInputController = undefined;
|
|
805
|
-
// } else {
|
|
806
|
-
// if (this.inputConfig?.multipleInputInEditId) {
|
|
807
|
-
// let inEdit = previousValue.find(
|
|
808
|
-
// (i: { id: any }) =>
|
|
809
|
-
// i.id === this.inputConfig?.multipleInputInEditId
|
|
810
|
-
// );
|
|
811
|
-
// Object.keys(inEdit).every((s) => {
|
|
812
|
-
// s;
|
|
813
|
-
// inEdit[s] = value[s];
|
|
814
|
-
// return !!inEdit[s];
|
|
815
|
-
// });
|
|
816
|
-
// this.value = [...previousValue],
|
|
817
|
-
// this.inputConfig.multipleInputController = undefined;
|
|
818
|
-
// } else {
|
|
819
|
-
// this.value = [...previousValue, value];
|
|
820
|
-
// this.inputConfig.multipleInputController = undefined;
|
|
821
|
-
// }
|
|
822
|
-
// }
|
|
823
|
-
// this.onChange(this.value);
|
|
824
|
-
// this.stateChanges.next();
|
|
825
|
-
// this.checkItemList(this.value || []);
|
|
826
|
-
// return
|
|
827
|
-
}
|
|
828
|
-
editInput(input) {
|
|
829
|
-
const fbf = this.formBuilderFunctions();
|
|
830
|
-
if (typeof fbf?.editInput !== 'function') {
|
|
831
|
-
throw new Error('editInput function not defined in formBuilderFunctions');
|
|
832
|
-
}
|
|
833
|
-
fbf.editInput(input);
|
|
834
|
-
}
|
|
835
|
-
deleteItemInput(input) {
|
|
836
|
-
this.formBuilderFunctions()?.deleteInput(input);
|
|
837
|
-
}
|
|
838
|
-
showItemAsLabel(input) {
|
|
839
|
-
this.formBuilderFunctions()?.multipleInputToggleLabel(input);
|
|
840
|
-
}
|
|
841
|
-
addFunction(func) {
|
|
842
|
-
this.formBuilderFunctions()?.addFunction(func, this.inputConfig()?.id);
|
|
843
|
-
}
|
|
844
|
-
// `FormBuilderFunctions.reorderItems` is now generic over the row shape; the
|
|
845
|
-
// container/data slots stay `unknown` (opaque drag payload).
|
|
846
|
-
reorderItems(event) {
|
|
847
|
-
const config = this.inputConfig();
|
|
848
|
-
const fbf = this.formBuilderFunctions();
|
|
849
|
-
if (!fbf || !config)
|
|
850
|
-
return;
|
|
851
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Phase-4 TODO: deduplicate @angular/cdk peer dep in typings package; CdkDragDrop types are nominally distinct across copies.
|
|
852
|
-
fbf.reorderItems(event, config.id);
|
|
853
|
-
}
|
|
854
|
-
get parentFormGroup() {
|
|
855
|
-
return this.ngControl?.control?.parent;
|
|
856
|
-
}
|
|
857
|
-
get canAddRecords() {
|
|
858
|
-
const config = this.inputConfig();
|
|
859
|
-
if (!config)
|
|
860
|
-
return false;
|
|
861
|
-
//NOTE: Temporary backward compatibility for older versions of the config that might not have the new property
|
|
862
|
-
if (!config.multipleInputAvailableOperations)
|
|
863
|
-
return true;
|
|
864
|
-
return config.multipleInputAvailableOperations?.includes(MultipleInputAvailableOperations.Add);
|
|
865
|
-
}
|
|
866
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
867
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MultipleInputTableComponent, isStandalone: true, selector: "lib-multiple-input-table", inputs: { editorMode: { classPropertyName: "editorMode", publicName: "editorMode", isSignal: true, isRequired: false, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, formBuilderFunctions: { classPropertyName: "formBuilderFunctions", publicName: "formBuilderFunctions", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: MultipleInputTableComponent }], usesInheritance: true, ngImport: i0, template: "<lib-multiple-input-table-view\r\n [inputConfig]=\"inputConfig()\"\r\n [dataSource]=\"dataSource\"\r\n [applyOptionsTo]=\"applyOptionsTo\"\r\n [formGroup]=\"parentFormGroup\"\r\n (onEditItem)=\"editRow($event)\"\r\n (showItemAsLabel)=\"showItemAsLabel(inputConfig())\"\r\n (onDeleteItem)=\"multipleInputRemoveItem(applyOptionsTo)\"\r\n (onCopy)=\"copy($event)\"\r\n (onApplyOptionsTo)=\"applyOptionsTo = $event\"\r\n></lib-multiple-input-table-view>\r\n\r\n@if (!!inputConfig().formIsOpen || !!rowInViewOnly) {\r\n <lib-multiple-input-table-edit\r\n [editorMode]=\"editorMode()\"\r\n (editMultipleInput)=\"editInput($event)\"\r\n (deleteInput)=\"deleteItemInput($event)\"\r\n (addFunction)=\"addFunction($event)\"\r\n (showItemAsLabel)=\"showItemAsLabel($event)\"\r\n (onSaveMultipleInputForm)=\"saveMultipleInputForm()\"\r\n (reorderItems)=\"reorderItems($event)\"\r\n [formBuilderFunctions]=\"formBuilderFunctions()\"\r\n [formGroup]=\"parentFormGroup\"\r\n [inputConfig]=\"inputConfig()\"\r\n ></lib-multiple-input-table-edit>\r\n}\r\n\r\n@if (!inputConfig().readonly && !inputConfig().disabled && !inputConfig().formIsOpen && canAddRecords) {\r\n <section class=\"add-row-bar\">\r\n <button class=\"add-row-button\" (click)=\"generateMultipleInputForm()\" mat-stroked-button>\r\n <mat-icon class=\"add-row-icon\">{{ handleIcon() }}</mat-icon>\r\n <span class=\"add-row-label\">{{ handleLabel }}</span>\r\n </button>\r\n </section>\r\n}\r\n", styles: [".table-container{position:relative;max-height:400px;overflow:auto}table{width:100%}.add-row-bar{margin-top:.5rem}.add-row-button{width:100%;min-height:2.25rem;display:inline-flex;align-items:center;justify-content:center;gap:.375rem;border:1px dashed color-mix(in srgb,var(--mat-sys-outline, #79747e) 60%,transparent);border-radius:8px;color:var(--mat-sys-on-surface-variant, #49454f);background:transparent;font-size:.8125rem;font-weight:500;letter-spacing:.01em;transition:border-color .3s cubic-bezier(.16,1,.3,1),color .3s cubic-bezier(.16,1,.3,1),background .3s cubic-bezier(.16,1,.3,1)}.add-row-button:hover{border-color:var(--mat-sys-primary, #6750a4);color:var(--mat-sys-primary, #6750a4);background:color-mix(in srgb,var(--mat-sys-primary, #6750a4) 6%,transparent)}.add-row-button:focus-visible{border-style:solid;border-color:var(--mat-sys-primary, #6750a4);box-shadow:0 0 0 2px color-mix(in srgb,var(--mat-sys-primary, #6750a4) 25%,transparent)}.add-row-icon{font-size:1.125rem;width:1.125rem;height:1.125rem;line-height:1.125rem}.add-row-label{line-height:1}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MultipleInputTableEditComponent, selector: "lib-multiple-input-table-edit", inputs: ["inputConfig", "editorMode", "formGroup", "formBuilderFunctions"], outputs: ["onSaveMultipleInputForm", "editMultipleInput", "deleteInput", "showItemAsLabel", "addFunction", "reorderItems"] }, { kind: "component", type: MultipleInputTableViewComponent, selector: "lib-multiple-input-table-view", inputs: ["inputConfig", "dataSource", "applyOptionsTo", "formGroup"], outputs: ["onEditItem", "onDeleteItem", "onCopy", "onApplyOptionsTo", "showItemAsLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
868
|
-
}
|
|
869
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputTableComponent, decorators: [{
|
|
870
|
-
type: Component,
|
|
871
|
-
args: [{ selector: 'lib-multiple-input-table', imports: [
|
|
872
|
-
MatButtonModule,
|
|
873
|
-
MatIconModule,
|
|
874
|
-
MultipleInputTableEditComponent,
|
|
875
|
-
MultipleInputTableViewComponent,
|
|
876
|
-
], providers: [{ provide: MatFormFieldControl, useExisting: MultipleInputTableComponent }], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "<lib-multiple-input-table-view\r\n [inputConfig]=\"inputConfig()\"\r\n [dataSource]=\"dataSource\"\r\n [applyOptionsTo]=\"applyOptionsTo\"\r\n [formGroup]=\"parentFormGroup\"\r\n (onEditItem)=\"editRow($event)\"\r\n (showItemAsLabel)=\"showItemAsLabel(inputConfig())\"\r\n (onDeleteItem)=\"multipleInputRemoveItem(applyOptionsTo)\"\r\n (onCopy)=\"copy($event)\"\r\n (onApplyOptionsTo)=\"applyOptionsTo = $event\"\r\n></lib-multiple-input-table-view>\r\n\r\n@if (!!inputConfig().formIsOpen || !!rowInViewOnly) {\r\n <lib-multiple-input-table-edit\r\n [editorMode]=\"editorMode()\"\r\n (editMultipleInput)=\"editInput($event)\"\r\n (deleteInput)=\"deleteItemInput($event)\"\r\n (addFunction)=\"addFunction($event)\"\r\n (showItemAsLabel)=\"showItemAsLabel($event)\"\r\n (onSaveMultipleInputForm)=\"saveMultipleInputForm()\"\r\n (reorderItems)=\"reorderItems($event)\"\r\n [formBuilderFunctions]=\"formBuilderFunctions()\"\r\n [formGroup]=\"parentFormGroup\"\r\n [inputConfig]=\"inputConfig()\"\r\n ></lib-multiple-input-table-edit>\r\n}\r\n\r\n@if (!inputConfig().readonly && !inputConfig().disabled && !inputConfig().formIsOpen && canAddRecords) {\r\n <section class=\"add-row-bar\">\r\n <button class=\"add-row-button\" (click)=\"generateMultipleInputForm()\" mat-stroked-button>\r\n <mat-icon class=\"add-row-icon\">{{ handleIcon() }}</mat-icon>\r\n <span class=\"add-row-label\">{{ handleLabel }}</span>\r\n </button>\r\n </section>\r\n}\r\n", styles: [".table-container{position:relative;max-height:400px;overflow:auto}table{width:100%}.add-row-bar{margin-top:.5rem}.add-row-button{width:100%;min-height:2.25rem;display:inline-flex;align-items:center;justify-content:center;gap:.375rem;border:1px dashed color-mix(in srgb,var(--mat-sys-outline, #79747e) 60%,transparent);border-radius:8px;color:var(--mat-sys-on-surface-variant, #49454f);background:transparent;font-size:.8125rem;font-weight:500;letter-spacing:.01em;transition:border-color .3s cubic-bezier(.16,1,.3,1),color .3s cubic-bezier(.16,1,.3,1),background .3s cubic-bezier(.16,1,.3,1)}.add-row-button:hover{border-color:var(--mat-sys-primary, #6750a4);color:var(--mat-sys-primary, #6750a4);background:color-mix(in srgb,var(--mat-sys-primary, #6750a4) 6%,transparent)}.add-row-button:focus-visible{border-style:solid;border-color:var(--mat-sys-primary, #6750a4);box-shadow:0 0 0 2px color-mix(in srgb,var(--mat-sys-primary, #6750a4) 25%,transparent)}.add-row-icon{font-size:1.125rem;width:1.125rem;height:1.125rem;line-height:1.125rem}.add-row-label{line-height:1}\n"] }]
|
|
877
|
-
}], ctorParameters: () => [], propDecorators: { editorMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "editorMode", required: false }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: true }] }], inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }], formBuilderFunctions: [{ type: i0.Input, args: [{ isSignal: true, alias: "formBuilderFunctions", required: false }] }] } });
|
|
878
|
-
function addGroups(tableValue, groupBy) {
|
|
879
|
-
throw new Error('Function not implemented.');
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
/** Wraps a multi-row input table inside a `mat-form-field`. */
|
|
883
|
-
class MultipleInputInputElementComponent {
|
|
884
|
-
constructor() {
|
|
885
|
-
this.inputConfig = input.required(...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
|
|
886
|
-
this.formGroup = input.required(...(ngDevMode ? [{ debugName: "formGroup" }] : /* istanbul ignore next */ []));
|
|
887
|
-
this.editorMode = input(false, ...(ngDevMode ? [{ debugName: "editorMode" }] : /* istanbul ignore next */ []));
|
|
888
|
-
this.formBuilderFunctions = input(undefined, ...(ngDevMode ? [{ debugName: "formBuilderFunctions" }] : /* istanbul ignore next */ []));
|
|
889
|
-
this.reload = output();
|
|
890
|
-
this.errorMessage = computed(() => getInputErrorMessage(this.inputConfig(), this.formGroup()), ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
891
|
-
}
|
|
892
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputInputElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
893
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MultipleInputInputElementComponent, isStandalone: true, selector: "lib-multiple-input-input-element", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, editorMode: { classPropertyName: "editorMode", publicName: "editorMode", isSignal: true, isRequired: false, transformFunction: null }, formBuilderFunctions: { classPropertyName: "formBuilderFunctions", publicName: "formBuilderFunctions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { reload: "reload" }, ngImport: i0, template: "<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field\r\n class=\"multiple-input-field\"\r\n [appearance]=\"inputConfig.appearance || 'fill'\"\r\n subscriptSizing=\"dynamic\"\r\n floatLabel=\"always\"\r\n >\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n @if (inputConfig.id) {\r\n <lib-multiple-input-table\r\n [editorMode]=\"editorMode()\"\r\n [required]=\"inputConfig.required\"\r\n [formGroup]=\"formGroup()\"\r\n [formBuilderFunctions]=\"formBuilderFunctions()\"\r\n [formControlName]=\"inputConfig.id\"\r\n [inputConfig]=\"inputConfig\"\r\n ></lib-multiple-input-table>\r\n }\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon>sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span class=\"affix-text\" matPrefix>{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span class=\"affix-text affix-text--suffix\" matSuffix>{{ inputConfig.suffixText }}</span>\r\n }\r\n\r\n @if (inputConfig.maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n</form>\r\n", styles: [":host{display:block}.multiple-input-field{width:100%}.affix-text{top:0;color:var(--mat-sys-on-surface-variant, #49454f);font-size:.8125rem}.affix-text--suffix{padding-left:.3125rem}.input-sync-button{margin-right:.25rem;opacity:0;transform:scale(.85);pointer-events:none;transition:opacity .3s cubic-bezier(.16,1,.3,1),transform .3s cubic-bezier(.16,1,.3,1)}.input-sync-button mat-icon{color:var(--mat-sys-primary, #6750a4)}.multiple-input-field:hover .input-sync-button,.multiple-input-field:focus-within .input-sync-button{opacity:1;transform:scale(1);pointer-events:auto}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$2.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: TFormInputStatusComponent, selector: "lib-t-form-input-status", inputs: ["inputConfig"] }, { kind: "component", type: MultipleInputTableComponent, selector: "lib-multiple-input-table", inputs: ["editorMode", "formGroup", "inputConfig", "formBuilderFunctions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
894
|
-
}
|
|
895
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultipleInputInputElementComponent, decorators: [{
|
|
896
|
-
type: Component,
|
|
897
|
-
args: [{ selector: 'lib-multiple-input-input-element', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
898
|
-
ReactiveFormsModule,
|
|
899
|
-
MatFormFieldModule,
|
|
900
|
-
MatIconModule,
|
|
901
|
-
MatButtonModule,
|
|
902
|
-
MatTooltipModule,
|
|
903
|
-
TFormInputStatusComponent,
|
|
904
|
-
MultipleInputTableComponent,
|
|
905
|
-
], template: "<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field\r\n class=\"multiple-input-field\"\r\n [appearance]=\"inputConfig.appearance || 'fill'\"\r\n subscriptSizing=\"dynamic\"\r\n floatLabel=\"always\"\r\n >\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n @if (inputConfig.id) {\r\n <lib-multiple-input-table\r\n [editorMode]=\"editorMode()\"\r\n [required]=\"inputConfig.required\"\r\n [formGroup]=\"formGroup()\"\r\n [formBuilderFunctions]=\"formBuilderFunctions()\"\r\n [formControlName]=\"inputConfig.id\"\r\n [inputConfig]=\"inputConfig\"\r\n ></lib-multiple-input-table>\r\n }\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon>sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span class=\"affix-text\" matPrefix>{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span class=\"affix-text affix-text--suffix\" matSuffix>{{ inputConfig.suffixText }}</span>\r\n }\r\n\r\n @if (inputConfig.maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n</form>\r\n", styles: [":host{display:block}.multiple-input-field{width:100%}.affix-text{top:0;color:var(--mat-sys-on-surface-variant, #49454f);font-size:.8125rem}.affix-text--suffix{padding-left:.3125rem}.input-sync-button{margin-right:.25rem;opacity:0;transform:scale(.85);pointer-events:none;transition:opacity .3s cubic-bezier(.16,1,.3,1),transform .3s cubic-bezier(.16,1,.3,1)}.input-sync-button mat-icon{color:var(--mat-sys-primary, #6750a4)}.multiple-input-field:hover .input-sync-button,.multiple-input-field:focus-within .input-sync-button{opacity:1;transform:scale(1);pointer-events:auto}\n"] }]
|
|
906
|
-
}], propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: true }] }], editorMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "editorMode", required: false }] }], formBuilderFunctions: [{ type: i0.Input, args: [{ isSignal: true, alias: "formBuilderFunctions", required: false }] }], reload: [{ type: i0.Output, args: ["reload"] }] } });
|
|
907
|
-
|
|
908
|
-
export { MultipleInputInputElementComponent };
|
|
909
|
-
//# sourceMappingURL=ngx-t-forms-multiple-input-input-element.component-DlgTjJpj.mjs.map
|