ngx-t-forms 2.0.14 → 2.0.16

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.
Files changed (98) hide show
  1. package/fesm2022/{ngx-t-forms-api-value-access-rules.component-CMKTgeD4.mjs → ngx-t-forms-api-value-access-rules.component-DADGz7pX.mjs} +8 -4
  2. package/fesm2022/ngx-t-forms-api-value-access-rules.component-DADGz7pX.mjs.map +1 -0
  3. package/fesm2022/{ngx-t-forms-calculated-field-rules.component-FkPPTG1s.mjs → ngx-t-forms-calculated-field-rules.component-BkkHK5vI.mjs} +11 -6
  4. package/fesm2022/ngx-t-forms-calculated-field-rules.component-BkkHK5vI.mjs.map +1 -0
  5. package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CMScZq9C.mjs → ngx-t-forms-chip-options-creator-editor.component-CHnQQdI8.mjs} +7 -5
  6. package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-CHnQQdI8.mjs.map +1 -0
  7. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CdJ-r4XS.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-AhbjCCQv.mjs} +6 -4
  8. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-AhbjCCQv.mjs.map +1 -0
  9. package/fesm2022/ngx-t-forms-data-source-picker.component-BOlk7nkl.mjs +206 -0
  10. package/fesm2022/ngx-t-forms-data-source-picker.component-BOlk7nkl.mjs.map +1 -0
  11. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-Bc-qTS2m.mjs +239 -0
  12. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-Bc-qTS2m.mjs.map +1 -0
  13. package/fesm2022/{ngx-t-forms-form-input-selector.component-Cmn8r7Ex.mjs → ngx-t-forms-form-input-selector.component-BuVzRUkY.mjs} +2 -2
  14. package/fesm2022/{ngx-t-forms-form-input-selector.component-Cmn8r7Ex.mjs.map → ngx-t-forms-form-input-selector.component-BuVzRUkY.mjs.map} +1 -1
  15. package/fesm2022/{ngx-t-forms-form-json-view.component-C1brLmzI.mjs → ngx-t-forms-form-json-view.component-hCrrYu82.mjs} +2 -2
  16. package/fesm2022/{ngx-t-forms-form-json-view.component-C1brLmzI.mjs.map → ngx-t-forms-form-json-view.component-hCrrYu82.mjs.map} +1 -1
  17. package/fesm2022/ngx-t-forms-form-section-stepper.component-CR3gyw3D.mjs +253 -0
  18. package/fesm2022/ngx-t-forms-form-section-stepper.component-CR3gyw3D.mjs.map +1 -0
  19. package/fesm2022/{ngx-t-forms-forms-builder-menu.component-5v76lDgO.mjs → ngx-t-forms-forms-builder-menu.component-DuXf9zC_.mjs} +4 -4
  20. package/fesm2022/{ngx-t-forms-forms-builder-menu.component-5v76lDgO.mjs.map → ngx-t-forms-forms-builder-menu.component-DuXf9zC_.mjs.map} +1 -1
  21. package/fesm2022/{ngx-t-forms-input-editor.component-St6l9Hr-.mjs → ngx-t-forms-input-editor.component-C5cPOIhT.mjs} +4 -4
  22. package/fesm2022/ngx-t-forms-input-editor.component-C5cPOIhT.mjs.map +1 -0
  23. package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-BrRevSpQ.mjs → ngx-t-forms-mat-chip-list-editor.component-C9Hd21i1.mjs} +7 -5
  24. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-C9Hd21i1.mjs.map +1 -0
  25. package/fesm2022/{ngx-t-forms-mat-slider-editor.component-BcgU9NYj.mjs → ngx-t-forms-mat-slider-editor.component-9K8e2gqm.mjs} +6 -4
  26. package/fesm2022/ngx-t-forms-mat-slider-editor.component-9K8e2gqm.mjs.map +1 -0
  27. package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-C0bZ6L19.mjs → ngx-t-forms-mat-slider-toggle-editor.component-CbYV5fCZ.mjs} +6 -4
  28. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-CbYV5fCZ.mjs.map +1 -0
  29. package/fesm2022/{ngx-t-forms-missing-form-configs.component-BBsEWu1_.mjs → ngx-t-forms-missing-form-configs.component-DynxybEE.mjs} +2 -2
  30. package/fesm2022/{ngx-t-forms-missing-form-configs.component-BBsEWu1_.mjs.map → ngx-t-forms-missing-form-configs.component-DynxybEE.mjs.map} +1 -1
  31. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C1zx7OZB.mjs +282 -0
  32. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C1zx7OZB.mjs.map +1 -0
  33. package/fesm2022/{ngx-t-forms-ngx-t-forms-DOtego0e.mjs → ngx-t-forms-ngx-t-forms-BX1gh-MK.mjs} +232 -275
  34. package/fesm2022/ngx-t-forms-ngx-t-forms-BX1gh-MK.mjs.map +1 -0
  35. package/fesm2022/{ngx-t-forms-pipeline-generator.component-CuXpNDYZ.mjs → ngx-t-forms-pipeline-generator.component-CmSkYW71.mjs} +10 -5
  36. package/fesm2022/ngx-t-forms-pipeline-generator.component-CmSkYW71.mjs.map +1 -0
  37. package/fesm2022/ngx-t-forms-required-inputs.component-QsOGfmug.mjs +189 -0
  38. package/fesm2022/ngx-t-forms-required-inputs.component-QsOGfmug.mjs.map +1 -0
  39. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-HDQwuGiu.mjs → ngx-t-forms-rest-api-call-setup.component-CDraedkm.mjs} +8 -4
  40. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-CDraedkm.mjs.map +1 -0
  41. package/fesm2022/{ngx-t-forms-section-report.component-C92mqFtY.mjs → ngx-t-forms-section-report.component-DFvcLFZn.mjs} +2 -2
  42. package/fesm2022/{ngx-t-forms-section-report.component-C92mqFtY.mjs.map → ngx-t-forms-section-report.component-DFvcLFZn.mjs.map} +1 -1
  43. package/fesm2022/ngx-t-forms-selection-options-editor.component-Cj7fqo70.mjs +145 -0
  44. package/fesm2022/ngx-t-forms-selection-options-editor.component-Cj7fqo70.mjs.map +1 -0
  45. package/fesm2022/ngx-t-forms-validators-config.component-DPD3QcOu.mjs +218 -0
  46. package/fesm2022/ngx-t-forms-validators-config.component-DPD3QcOu.mjs.map +1 -0
  47. package/fesm2022/ngx-t-forms.mjs +1 -1
  48. package/lib/components/form-builder/elements/form-section-stepper/form-section-stepper.component.d.ts +4 -1
  49. package/lib/components/index.d.ts +1 -2
  50. package/lib/components/t-dynamic-data-edit/elements/api-value-access-rules/api-value-access-rules.component.d.ts +1 -1
  51. package/lib/components/t-dynamic-data-edit/elements/calculated-field-rules/calculated-field-rules.component.d.ts +1 -1
  52. package/lib/components/t-dynamic-data-edit/elements/chip-options-creator-editor/chip-options-creator-editor.component.d.ts +1 -1
  53. package/lib/components/t-dynamic-data-edit/elements/config-mscoa-additional-inputs/config-mscoa-additional-inputs.component.d.ts +1 -1
  54. package/lib/components/t-dynamic-data-edit/elements/data-source-picker/data-source-picker.component.d.ts +57 -0
  55. package/lib/components/t-dynamic-data-edit/elements/document-list-label-config-editor/document-list-label-config-editor.component.d.ts +62 -0
  56. package/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-editor.component.d.ts +1 -1
  57. package/lib/components/t-dynamic-data-edit/elements/mat-slider-editor/mat-slider-editor.component.d.ts +1 -1
  58. package/lib/components/t-dynamic-data-edit/elements/mat-slider-toggle-editor/mat-slider-toggle-editor.component.d.ts +2 -2
  59. package/lib/components/t-dynamic-data-edit/elements/mscoa-segment-config/mscoa-segment-config.component.d.ts +1 -1
  60. package/lib/components/t-dynamic-data-edit/elements/pipeline-generator/pipeline-generator.component.d.ts +1 -1
  61. package/lib/components/t-dynamic-data-edit/elements/required-inputs/required-inputs.component.d.ts +1 -1
  62. package/lib/components/t-dynamic-data-edit/elements/rest-api-call-setup/rest-api-call-setup.component.d.ts +1 -1
  63. package/lib/components/t-dynamic-data-edit/elements/selection-options-editor/selection-options-editor.component.d.ts +1 -1
  64. package/lib/components/t-dynamic-data-edit/elements/validators-config/validators-config.component.d.ts +1 -1
  65. package/lib/components/t-dynamic-data-edit/t-dynamic-data-edit.component.d.ts +5 -2
  66. package/lib/components/t-form-input/elements/mscoa-form-input/elements/account-value/account-value.component.d.ts +1 -1
  67. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/mscoa-chart.component.d.ts +1 -0
  68. package/lib/components/t-form-input/elements/mscoa-form-input/elements/scoa-account-table/scoa-account-table.component.d.ts +2 -2
  69. package/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table/multiple-input-table.component.d.ts +1 -1
  70. package/lib/services/core/t-form-builder/functions/inputElementEditorConfigs.d.ts +2 -2
  71. package/lib/services/index.d.ts +2 -1
  72. package/package.json +2 -2
  73. package/fesm2022/ngx-t-forms-api-value-access-rules.component-CMKTgeD4.mjs.map +0 -1
  74. package/fesm2022/ngx-t-forms-calculated-field-rules.component-FkPPTG1s.mjs.map +0 -1
  75. package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-CMScZq9C.mjs.map +0 -1
  76. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-CdJ-r4XS.mjs.map +0 -1
  77. package/fesm2022/ngx-t-forms-form-section-stepper.component-CxuWKb7v.mjs +0 -243
  78. package/fesm2022/ngx-t-forms-form-section-stepper.component-CxuWKb7v.mjs.map +0 -1
  79. package/fesm2022/ngx-t-forms-input-editor.component-St6l9Hr-.mjs.map +0 -1
  80. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-BrRevSpQ.mjs.map +0 -1
  81. package/fesm2022/ngx-t-forms-mat-slider-editor.component-BcgU9NYj.mjs.map +0 -1
  82. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-C0bZ6L19.mjs.map +0 -1
  83. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-Cx08Sysp.mjs +0 -280
  84. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-Cx08Sysp.mjs.map +0 -1
  85. package/fesm2022/ngx-t-forms-ngx-t-forms-DOtego0e.mjs.map +0 -1
  86. package/fesm2022/ngx-t-forms-pipeline-generator.component-CuXpNDYZ.mjs.map +0 -1
  87. package/fesm2022/ngx-t-forms-required-inputs.component-aoZjTIVr.mjs +0 -187
  88. package/fesm2022/ngx-t-forms-required-inputs.component-aoZjTIVr.mjs.map +0 -1
  89. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-HDQwuGiu.mjs.map +0 -1
  90. package/fesm2022/ngx-t-forms-selection-options-editor.component--TlWm7_4.mjs +0 -143
  91. package/fesm2022/ngx-t-forms-selection-options-editor.component--TlWm7_4.mjs.map +0 -1
  92. package/fesm2022/ngx-t-forms-validators-config.component-hCT8BAtp.mjs +0 -216
  93. package/fesm2022/ngx-t-forms-validators-config.component-hCT8BAtp.mjs.map +0 -1
  94. package/lib/components/workflow-builder/store/workflow-builder-store.service.d.ts +0 -18
  95. package/lib/components/workflow-builder/store/workflowEditorActions.d.ts +0 -4
  96. package/lib/components/workflow-builder/store/workflowEditorEffects.d.ts +0 -2
  97. package/lib/components/workflow-builder/store/workflowEditorSelectors.d.ts +0 -2
  98. package/lib/components/workflow-builder/workflow-builder.component.d.ts +0 -12
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-config-mscoa-additional-inputs.component-AhbjCCQv.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/config-mscoa-additional-inputs/config-mscoa-additional-inputs.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/config-mscoa-additional-inputs/config-mscoa-additional-inputs.component.html"],"sourcesContent":["import { Component, ElementRef, EventEmitter, HostBinding, inject, Input, OnInit, Optional, Output, Self } from '@angular/core';\r\nimport { BehaviorSubject, catchError, Observable, Subject, take, tap } from 'rxjs';\r\n\r\nimport { MatDialog } from '@angular/material/dialog';\r\nimport { FormColumnInputs } from 'ngx-t-forms-types';\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\nimport { IGetTreeResponse } from 'ngx-t-forms-types';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { NgControl } from '@angular/forms';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\n\r\n\r\n\r\n\r\ninterface ConfiguredMscoaInput extends FormColumnInputs {\r\n segment:string\r\n}\r\n@Component({\r\n selector: 'app-config-mscoa-additional-inputs',\r\n standalone: true,\r\n imports:[\r\n CommonModule,\r\n MatModulesModule,\r\n ],\r\n templateUrl: './config-mscoa-additional-inputs.component.html',\r\n styleUrls: ['./config-mscoa-additional-inputs.component.scss'],\r\n providers: [{ provide: MatFormFieldControl, useExisting: ConfigMscoaAdditionalInputsComponent}],\r\n})\r\nexport class ConfigMscoaAdditionalInputsComponent implements OnInit, MatFormFieldControl<ConfiguredMscoaInput[]> {\r\n\r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n \r\n @HostBinding() id = `app-config-mscoa-additional-inputs-${ConfigMscoaAdditionalInputsComponent .nextId++}`;\r\n \r\n placeholder: string = ''\r\n constructor(@Optional() @Self() public ngControl: NgControl, private _elementRef: ElementRef<HTMLElement>,) { }\r\n focused: boolean = false;\r\n get empty() {\r\n return !this.value\r\n }\r\n get shouldLabelFloat() {\r\n return this.focused || !this.empty;\r\n }\r\n required: boolean = false;\r\n @Input() disabled: boolean = false;\r\n get errorState(): boolean {\r\n const hasError = !!this.ngControl?.control?.errors || (this.errors||[]).length > 0 && this.touched\r\n return !this.value && !!this.required || hasError\r\n }\r\n \r\n controlType?: string | undefined;\r\n autofilled?: boolean | undefined;\r\n userAriaDescribedBy?: string | undefined;\r\n disableAutomaticLabeling?: boolean | undefined;\r\n setDescribedByIds(ids: string[]) {\r\n // Ensure the component view is initialized\r\n if (this._elementRef && this._elementRef.nativeElement) {\r\n const controlElement = this._elementRef.nativeElement.querySelector('.app-config-mscoa-additional-inputs');\r\n // Check if the controlElement exists before attempting to set its attribute\r\n if (controlElement) {\r\n controlElement.setAttribute('aria-describedby', ids.join(' '));\r\n }\r\n }\r\n }\r\n onContainerClick(event: MouseEvent): void {\r\n this.markAsTouched();\r\n this.stateChanges.next();\r\n }\r\n \r\n touched: boolean = false;\r\n onTouched = () => {};\r\n markAsTouched() {\r\n console.log('markAsTouched') \r\n if (!this.touched) {\r\n this.onTouched();\r\n this.touched = true;\r\n }\r\n } \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n mscoaInitiated = false\r\n @Input() errors:IConfigElementError[] |undefined = [];\r\n @Input() set getMscoaTree(options$:Observable<IGetTreeResponse| undefined> ){\r\n if(!!options$ &&!this.mscoaInitiated){\r\n this.mscoaInitiated = true\r\n options$.pipe(\r\n take(1),\r\n tap((options) => {\r\n this.accountTreeKeys = options?.accountTreeKeys || []\r\n }),\r\n catchError((error) => {\r\n console.error('Error while fetching SCOA tree:', error);\r\n return [null];\r\n })\r\n ).subscribe();\r\n\r\n }\r\n }\r\n @Input() mapToData:FormColumnInputs | undefined = undefined;\r\n @Input() set value(val: ConfiguredMscoaInput[]) {\r\n this._value.next(val || []);\r\n }\r\n get value(): ConfiguredMscoaInput[] {\r\n return this._value.value;\r\n }\r\n _inputInEdit = new BehaviorSubject<ConfiguredMscoaInput|null>(null)\r\n inputInEdit:ConfiguredMscoaInput|undefined = undefined\r\n\r\n @Output() valueChanged = new EventEmitter<ConfiguredMscoaInput[]>();\r\n private _value = new BehaviorSubject<ConfiguredMscoaInput[]>([]);\r\n\r\n editingIndex: number | null = null;\r\n isAddingNew = false;\r\n accountTreeKeys: string[] = [];\r\n \r\n ngOnInit() {\r\n\r\n }\r\n hovered :null|number = null\r\n\r\n\r\n startAddNew() {\r\n this.isAddingNew = true;\r\n this.editingIndex = null;\r\n this.inputInEdit = undefined\r\n this.openElementEditor();\r\n }\r\n\r\n startEdit(index: number) {\r\n this.editingIndex = index;\r\n this.isAddingNew = false;\r\n this.inputInEdit = this.value[index]\r\n this.openElementEditor();\r\n }\r\n removeInput(index: number) {\r\n const updatedValue = this.value.filter((_, i) => i !== index);\r\n this._value.next(updatedValue);\r\n this.valueChanged.emit(updatedValue);\r\n }\r\n cancelEdit() {\r\n this.editingIndex = null;\r\n this.isAddingNew = false;\r\n }\r\n\r\n saveSegment() {\r\n // if (this.segmentForm.valid) {\r\n // const newSegment = ({\r\n // segment:this.segmentForm.value.segment,\r\n // label:this.toTitleCase(this.segmentForm.value.segment),\r\n // }) as IIncludedSegmentConfig;\r\n // const updatedValue = [...this.value];\r\n\r\n // if (this.isAddingNew) {\r\n // updatedValue.push(newSegment);\r\n // } else if (this.editingIndex !== null) {\r\n // updatedValue[this.editingIndex] = newSegment;\r\n // }\r\n\r\n \r\n // this._value.next(updatedValue);\r\n // this.valueChanged.emit(updatedValue);\r\n // this.cancelEdit();\r\n // }\r\n }\r\n hoveredIndex:number|null = null\r\n removeSegment(index: number) {\r\n const updatedValue = this.value.filter((_, i) => i !== index);\r\n this._value.next(updatedValue);\r\n this.valueChanged.emit(updatedValue);\r\n }\r\n parentId:string|undefined \r\n async openElementEditor() {\r\n\r\n this.openFormDialog()\r\n }\r\n inputSegmentChanged($event:any,i:number){\r\n if($event.detail.value === 'None'&&this.value[i] !== undefined){\r\n this.value[i]!.segment = undefined as any\r\n }else if(this.value[i] !== undefined){\r\n this.value[i]!.segment = $event.detail.value\r\n }\r\n this.valueChanged.emit(this.value)\r\n }\r\nreadonly dialog = inject(MatDialog);\r\nopenFormDialog() {\r\n // const dialogRef = this.dialog.open(FormElementModalEditorComponent,{\r\n // maxHeight:'95vh',\r\n // panelClass:'form-element-modal-editor',\r\n // data:{\r\n // inputInEdit:this.inputInEdit\r\n // }\r\n // });\r\n\r\n // dialogRef.afterClosed().pipe(take(1)).subscribe(result => {\r\n // const {input,action} = result\r\n // if(action === 'add'){\r\n // this.value.push(input)\r\n // this.valueChanged.emit(this.value)\r\n // }\r\n // if(action === 'edit'&& this.editingIndex !== null){\r\n // this.value[this.editingIndex] = input\r\n // this.valueChanged.emit(this.value)\r\n // }\r\n // this.cancelEdit()\r\n // });\r\n}\r\nget limitInputTo(){\r\n return [...this.accountTreeKeys.map((key) => ({\r\n value: key,\r\n label: key,\r\n })),{\r\n value:undefined,\r\n label:'None'\r\n }]\r\n}\r\n\r\n}\r\n","\n\n<mat-list *ngIf=\"(value?.length||0) > 0; else noInputs\">\n <mat-toolbar>\n Additional inputs configuration\n </mat-toolbar>\n <mat-form-field \n (mouseover)=\"hovered = i\"\n\n (mouseleave)=\"hovered = null\"\n *ngFor=\"let input of value; let i = index\" style=\" margin-bottom: 8px;\" appearance=\"outline\" >\n <mat-label>\n {{ input.label }}\n </mat-label>\n <mat-select [disabled]=\"disabled\" matNativeControl \n \n [value]=\"input.segment\"\n\n placeholder=\"select segment\" (selectionChange)=\"inputSegmentChanged($event,i)\"\n >\n \n \n @for (segment of limitInputTo; track segment.value) {\n <mat-option [value]=\"segment.value\" >{{segment.label}}</mat-option>\n }\n\n\n </mat-select>\n <mat-hint>\n Link formula to an input value\n </mat-hint>\n </mat-form-field>\n\n</mat-list>\n\n<ng-template #noInputs>\n <div *ngIf=\"mapToData?.id\" class=\"tree-instructions\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span><strong>\n No input configuration available. \n </strong> <br>\n Start by adding inputs below.</span>\n </div>\n\n</ng-template>\n\n\n\n\n<mat-toolbar *ngIf=\"!isAddingNew && editingIndex === null && mapToData?.id\">\n <button [disabled]=\"disabled\" style=\"width: 100%;\" (click)=\"startAddNew()\" mat-stroked-button>\n <mat-icon>\n add\n </mat-icon>\n Add New Input\n </button>\n</mat-toolbar>\n\n<ng-template #InputEditor>\n <h1>\n Not implemented yet\n </h1>\n\n not implemented\n</ng-template>\n"],"names":["i4","i5","i6","i7","i8"],"mappings":";;;;;;;;;;;;;;;;MA6Ba,oCAAoC,CAAA;aAEvC,IAAM,CAAA,MAAA,GAAG,CAAH,CAAK;IAMlB,WAAuC,CAAA,SAAoB,EAAU,WAAoC,EAAA;QAAlE,IAAS,CAAA,SAAA,GAAT,SAAS;QAAqB,IAAW,CAAA,WAAA,GAAX,WAAW;AALhF,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO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AAA,EAAA,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAsC,oCAAA,EAAC,CAAC,EAAA,QAAA,EAAA,yjDAAA,EAAA,MAAA,EAAA,CAAA,4JAAA,CAAA,EAAA;;0BAUjF;;0BAAY;kEAHV,EAAE,EAAA,CAAA;sBAAhB;gBAYO,QAAQ,EAAA,CAAA;sBAAhB;gBA8CY,MAAM,EAAA,CAAA;sBAAd;gBACQ,YAAY,EAAA,CAAA;sBAAxB;gBAgBQ,SAAS,EAAA,CAAA;sBAAjB;gBACY,KAAK,EAAA,CAAA;sBAAjB;gBASS,YAAY,EAAA,CAAA;sBAArB;;;;;"}
@@ -0,0 +1,206 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Input, Output, HostBinding, Optional, Self, Component } from '@angular/core';
3
+ import { MatFormFieldControl } from '@angular/material/form-field';
4
+ import { Subject, BehaviorSubject } from 'rxjs';
5
+ import { DataSources } from 'ngx-t-forms-types';
6
+ import * as i2 from '@angular/material/button';
7
+ import { MatButtonModule } from '@angular/material/button';
8
+ import { CommonModule } from '@angular/common';
9
+ import { MatChipListEditorComponent } from './ngx-t-forms-mat-chip-list-editor.component-C9Hd21i1.mjs';
10
+ import { RestApiCallSetupComponent } from './ngx-t-forms-rest-api-call-setup.component-CDraedkm.mjs';
11
+ import { PipelineGeneratorComponent } from './ngx-t-forms-pipeline-generator.component-CmSkYW71.mjs';
12
+ import * as i3 from '@angular/material/card';
13
+ import { MatCardModule } from '@angular/material/card';
14
+ import * as i4 from '@angular/material/divider';
15
+ import { MatDividerModule } from '@angular/material/divider';
16
+ import * as i6 from '@angular/material/list';
17
+ import { MatListModule } from '@angular/material/list';
18
+ import * as i6$1 from '@angular/material/icon';
19
+ import { MatIconModule } from '@angular/material/icon';
20
+ import { v4 } from 'uuid';
21
+ import { RequiredInputsComponent } from './ngx-t-forms-required-inputs.component-QsOGfmug.mjs';
22
+ import * as i8 from '@angular/material/tooltip';
23
+ import { MatTooltipModule } from '@angular/material/tooltip';
24
+ import * as i1 from '@angular/forms';
25
+
26
+ class DataSourcePickerComponent {
27
+ static { this.nextId = 0; }
28
+ constructor(ngControl, _elementRef) {
29
+ this.ngControl = ngControl;
30
+ this._elementRef = _elementRef;
31
+ this.stateChanges = new Subject();
32
+ this.errors = [];
33
+ this.id = `lib-data-source-picker-${DataSourcePickerComponent.nextId++}`;
34
+ this.placeholder = '';
35
+ this.focused = false;
36
+ this.required = false;
37
+ this.touched = false;
38
+ this.onTouched = () => { };
39
+ this._value = new BehaviorSubject(undefined);
40
+ this._editorConfig = undefined;
41
+ this.formInputs = [];
42
+ this.disabled = false;
43
+ this.valueChange = new EventEmitter();
44
+ this.dataSourceInEdit = undefined;
45
+ this.dataSources = DataSources;
46
+ }
47
+ get empty() {
48
+ return !this.value;
49
+ }
50
+ get shouldLabelFloat() {
51
+ return this.focused || !this.empty;
52
+ }
53
+ get errorState() {
54
+ const hasError = !!this.ngControl?.control?.errors || (this.errors || []).length > 0 && this.touched;
55
+ return !this.value && !!this.required || hasError;
56
+ }
57
+ setDescribedByIds(ids) {
58
+ // Ensure the component view is initialized
59
+ if (this._elementRef && this._elementRef.nativeElement) {
60
+ const controlElement = this._elementRef.nativeElement.querySelector('.lib-data-source-picker');
61
+ // Check if the controlElement exists before attempting to set its attribute
62
+ if (controlElement) {
63
+ controlElement.setAttribute('aria-describedby', ids.join(' '));
64
+ }
65
+ }
66
+ }
67
+ onContainerClick(event) {
68
+ this.markAsTouched();
69
+ this.stateChanges.next();
70
+ }
71
+ markAsTouched() {
72
+ console.log('markAsTouched');
73
+ if (!this.touched) {
74
+ this.onTouched();
75
+ this.touched = true;
76
+ }
77
+ }
78
+ set value(value) {
79
+ if (this._value.getValue() === value) {
80
+ return;
81
+ }
82
+ this._value.next(value);
83
+ }
84
+ get value() {
85
+ return this._value.getValue();
86
+ }
87
+ get value$() {
88
+ return this._value.asObservable();
89
+ }
90
+ set editorConfig(config) {
91
+ this._editorConfig = (config);
92
+ }
93
+ get editorConfig() {
94
+ return this._editorConfig;
95
+ }
96
+ get dataSourceOptions() {
97
+ return [
98
+ {
99
+ label: 'API',
100
+ value: DataSources.Api
101
+ },
102
+ {
103
+ label: 'MongoDB',
104
+ value: DataSources.MongoDb
105
+ }
106
+ ];
107
+ }
108
+ dataSourceChanged(source) {
109
+ if (!this.dataSourceInEdit) {
110
+ return;
111
+ }
112
+ this.dataSourceInEdit['source'] = source;
113
+ console.error(this.dataSourceInEdit);
114
+ }
115
+ sourceValueChanged(value) {
116
+ if (!this.dataSourceInEdit) {
117
+ return;
118
+ }
119
+ this.dataSourceInEdit['config'] = value;
120
+ }
121
+ minimumInputRequiredValueChanged(value) {
122
+ if (!this.dataSourceInEdit) {
123
+ return;
124
+ }
125
+ this.dataSourceInEdit['config']['backEndConfig']['minimumInputRequired'] = value;
126
+ }
127
+ saveNewSource() {
128
+ if (!this.dataSourceInEdit) {
129
+ return;
130
+ }
131
+ const data = {
132
+ ...this.dataSourceInEdit,
133
+ id: v4(),
134
+ };
135
+ this.value = [...(this.value || []), data];
136
+ this.dataSourceInEdit = undefined;
137
+ this.valueChange.emit(this.value);
138
+ }
139
+ removeSubmissionApi(api) {
140
+ if (!this.value) {
141
+ return;
142
+ }
143
+ this.value = this.value.filter((item) => item.id !== api.id);
144
+ this.valueChange.emit(this.value);
145
+ }
146
+ getName(value, index) {
147
+ if ((value?.config).name) {
148
+ return (value?.config).name;
149
+ }
150
+ if (value?.source !== 'api') {
151
+ return `MongoDB ${index + 1}`;
152
+ }
153
+ return `API ${index + 1}`;
154
+ }
155
+ getIcon(value) {
156
+ if (value?.source === 'api') {
157
+ return "api";
158
+ }
159
+ return 'storage';
160
+ }
161
+ getEndpoint(value) {
162
+ if (value?.source === 'api') {
163
+ return value.config.httpEndPoint;
164
+ }
165
+ return (value?.config).workflowId;
166
+ }
167
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: DataSourcePickerComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
168
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: DataSourcePickerComponent, isStandalone: true, selector: "lib-data-source-picker", inputs: { errors: "errors", value: "value", formInputs: "formInputs", disabled: "disabled", editorConfig: "editorConfig" }, outputs: { valueChange: "valueChange" }, host: { properties: { "id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: DataSourcePickerComponent, }], ngImport: i0, template: "<mat-nav-list >\r\n <h5 matSubheader class=\"api-list-header\">\r\n\r\n DataSources\r\n </h5>\r\n @if((value)?.length === 0){\r\n <p class=\"no-api-list\">\r\n No data sources configured. Add one to get started.\r\n </p>\r\n }\r\n @for (source of value||[]; track source.id) {\r\n\r\n <mat-list-item \r\n style=\"background: azure;\"\r\n matTooltipPosition=\"before\"\r\n [matTooltip]=\"source.source +' ' + getEndpoint(source)\"\r\n class=\"api-list-item\">\r\n\r\n <mat-icon \r\n \r\n matListItemIcon \r\n [style.color]=\"source.source === 'api' ? 'green' : 'blue'\">\r\n {{getIcon(source)}}\r\n </mat-icon>\r\n <div matListItemTitle>\r\n <div style=\"line-height: normal;\">\r\n <small style=\"white-space: nowrap;overflow: hidden;text-overflow: ellipsis;\">\r\n <strong>\r\n {{getName(source,$index)}}\r\n\r\n </strong>\r\n </small>\r\n\r\n </div>\r\n <div style=\"line-height: normal;opacity: 0.6;\">\r\n <small>\r\n\r\n {{getEndpoint(source)}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <button [disabled]=\"disabled\" matListItemMeta (click)=\"removeSubmissionApi(source)\" mat-icon-button>\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n <mat-divider>\r\n </mat-divider>\r\n\r\n\r\n\r\n }\r\n\r\n\r\n</mat-nav-list>\r\n\r\n@if(dataSourceInEdit !== undefined ) {\r\n<mat-card appearance=\"outlined\" class=\"data-source-card\">\r\n <mat-card-content>\r\n\r\n\r\n <label for=\"629879d6-763b-4f98-b67f-67bbe91045ea\">\r\n Select Source Type\r\n </label>\r\n <lib-mat-chip-list-editor [id]=\"'629879d6-763b-4f98-b67f-67bbe91045ea'\" (valueChange)=\"dataSourceChanged($event)\"\r\n [value]=\"dataSourceInEdit.source\" [options]=\"dataSourceOptions\"></lib-mat-chip-list-editor>\r\n @if(dataSourceInEdit.source !== undefined) {\r\n @switch (dataSourceInEdit.source) {\r\n @case(dataSources.Api){\r\n <label for=\"1a049f19-b4a0-42c9-8058-1759792ee4a5\">\r\n Select API\r\n </label>\r\n <lib-rest-api-call-setup [postmanCollectionConfig]=\"(editorConfig)?.postmanCollectionConfig\"\r\n [httpGetDataFunction]=\"(editorConfig)?.httpGetDataFunction\" [id]=\"'1a049f19-b4a0-42c9-8058-1759792ee4a5'\"\r\n [value]=\"(dataSourceInEdit?.config)\" (valueChanged)=\"sourceValueChanged($event)\">\r\n\r\n </lib-rest-api-call-setup>\r\n @if ((dataSourceInEdit.config?.backEndConfig?.minimumInputRequired)) {\r\n <app-required-inputs [formInputs]=\"formInputs ||[]\" [id]=\"'0ca91260-b610-4d0d-91c1-fdaca61cc5f2'\"\r\n [value]=\"(dataSourceInEdit.config.backEndConfig.minimumInputRequired)\" [errors]=\"[]\"\r\n (valueChanged)=\"minimumInputRequiredValueChanged($event)\">\r\n </app-required-inputs>\r\n }\r\n\r\n }\r\n @case(dataSources.MongoDb){\r\n <label for=\"d3c22913-505d-41f8-a267-72c086b8b10b\">\r\n Add a MongoDB pipeline\r\n </label>\r\n <app-pipeline-generator [id]=\"'d3c22913-505d-41f8-a267-72c086b8b10b'\" [value]=\"(dataSourceInEdit?.config)\"\r\n [getWorkflowOptions]=\"editorConfig?.getWorkflowOptions\"\r\n (valueChanged)=\"sourceValueChanged($event)\"></app-pipeline-generator>\r\n\r\n\r\n }\r\n\r\n }\r\n }\r\n </mat-card-content>\r\n <br>\r\n <mat-divider></mat-divider>\r\n <mat-card-actions>\r\n <button mat-flat-button color=\"primary\" (click)=\"saveNewSource()\">Save Source</button>\r\n <span class=\"spacer\"></span>\r\n <button mat-button (click)=\"dataSourceInEdit = undefined\" color=\"warn\">Cancel</button>\r\n </mat-card-actions>\r\n</mat-card>\r\n\r\n}\r\n\r\n\r\n\r\n@if (dataSourceInEdit === undefined) {\r\n<button [disabled]=\"disabled\" (click)=\"dataSourceInEdit={}\" class=\"AddButton\" mat-stroked-button color=\"primary\">\r\n Add Data Source\r\n</button>\r\n}", styles: [".AddButton{width:100%}label{font-size:12px;margin-top:8px}.data-source-card{background:azure}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: MatChipListEditorComponent, selector: "lib-mat-chip-list-editor", inputs: ["disabled", "errors", "value", "required", "options"], outputs: ["valueChange"] }, { kind: "component", type: RestApiCallSetupComponent, selector: "lib-rest-api-call-setup", inputs: ["disabled", "postmanCollectionConfig", "httpGetDataFunction", "value", "errors"], outputs: ["valueChanged"] }, { kind: "component", type: PipelineGeneratorComponent, selector: "app-pipeline-generator", inputs: ["disabled", "value", "getWorkflowOptions", "userName", "errors"], outputs: ["valueChanged"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i3.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i4.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i6.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i6.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i6.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "directive", type: i6.MatListSubheaderCssMatStyler, selector: "[mat-subheader], [matSubheader]" }, { kind: "directive", type: i6.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "directive", type: i6.MatListItemMeta, selector: "[matListItemMeta]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i6$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: RequiredInputsComponent, selector: "app-required-inputs", inputs: ["disabled", "errors", "value", "formInputs"], outputs: ["valueChanged"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
169
+ }
170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: DataSourcePickerComponent, decorators: [{
171
+ type: Component,
172
+ args: [{ selector: 'lib-data-source-picker', imports: [
173
+ MatButtonModule,
174
+ CommonModule,
175
+ MatChipListEditorComponent,
176
+ RestApiCallSetupComponent,
177
+ PipelineGeneratorComponent,
178
+ MatCardModule,
179
+ MatDividerModule,
180
+ MatListModule,
181
+ MatIconModule,
182
+ RequiredInputsComponent,
183
+ MatTooltipModule
184
+ ], providers: [{ provide: MatFormFieldControl, useExisting: DataSourcePickerComponent, }], template: "<mat-nav-list >\r\n <h5 matSubheader class=\"api-list-header\">\r\n\r\n DataSources\r\n </h5>\r\n @if((value)?.length === 0){\r\n <p class=\"no-api-list\">\r\n No data sources configured. Add one to get started.\r\n </p>\r\n }\r\n @for (source of value||[]; track source.id) {\r\n\r\n <mat-list-item \r\n style=\"background: azure;\"\r\n matTooltipPosition=\"before\"\r\n [matTooltip]=\"source.source +' ' + getEndpoint(source)\"\r\n class=\"api-list-item\">\r\n\r\n <mat-icon \r\n \r\n matListItemIcon \r\n [style.color]=\"source.source === 'api' ? 'green' : 'blue'\">\r\n {{getIcon(source)}}\r\n </mat-icon>\r\n <div matListItemTitle>\r\n <div style=\"line-height: normal;\">\r\n <small style=\"white-space: nowrap;overflow: hidden;text-overflow: ellipsis;\">\r\n <strong>\r\n {{getName(source,$index)}}\r\n\r\n </strong>\r\n </small>\r\n\r\n </div>\r\n <div style=\"line-height: normal;opacity: 0.6;\">\r\n <small>\r\n\r\n {{getEndpoint(source)}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <button [disabled]=\"disabled\" matListItemMeta (click)=\"removeSubmissionApi(source)\" mat-icon-button>\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n <mat-divider>\r\n </mat-divider>\r\n\r\n\r\n\r\n }\r\n\r\n\r\n</mat-nav-list>\r\n\r\n@if(dataSourceInEdit !== undefined ) {\r\n<mat-card appearance=\"outlined\" class=\"data-source-card\">\r\n <mat-card-content>\r\n\r\n\r\n <label for=\"629879d6-763b-4f98-b67f-67bbe91045ea\">\r\n Select Source Type\r\n </label>\r\n <lib-mat-chip-list-editor [id]=\"'629879d6-763b-4f98-b67f-67bbe91045ea'\" (valueChange)=\"dataSourceChanged($event)\"\r\n [value]=\"dataSourceInEdit.source\" [options]=\"dataSourceOptions\"></lib-mat-chip-list-editor>\r\n @if(dataSourceInEdit.source !== undefined) {\r\n @switch (dataSourceInEdit.source) {\r\n @case(dataSources.Api){\r\n <label for=\"1a049f19-b4a0-42c9-8058-1759792ee4a5\">\r\n Select API\r\n </label>\r\n <lib-rest-api-call-setup [postmanCollectionConfig]=\"(editorConfig)?.postmanCollectionConfig\"\r\n [httpGetDataFunction]=\"(editorConfig)?.httpGetDataFunction\" [id]=\"'1a049f19-b4a0-42c9-8058-1759792ee4a5'\"\r\n [value]=\"(dataSourceInEdit?.config)\" (valueChanged)=\"sourceValueChanged($event)\">\r\n\r\n </lib-rest-api-call-setup>\r\n @if ((dataSourceInEdit.config?.backEndConfig?.minimumInputRequired)) {\r\n <app-required-inputs [formInputs]=\"formInputs ||[]\" [id]=\"'0ca91260-b610-4d0d-91c1-fdaca61cc5f2'\"\r\n [value]=\"(dataSourceInEdit.config.backEndConfig.minimumInputRequired)\" [errors]=\"[]\"\r\n (valueChanged)=\"minimumInputRequiredValueChanged($event)\">\r\n </app-required-inputs>\r\n }\r\n\r\n }\r\n @case(dataSources.MongoDb){\r\n <label for=\"d3c22913-505d-41f8-a267-72c086b8b10b\">\r\n Add a MongoDB pipeline\r\n </label>\r\n <app-pipeline-generator [id]=\"'d3c22913-505d-41f8-a267-72c086b8b10b'\" [value]=\"(dataSourceInEdit?.config)\"\r\n [getWorkflowOptions]=\"editorConfig?.getWorkflowOptions\"\r\n (valueChanged)=\"sourceValueChanged($event)\"></app-pipeline-generator>\r\n\r\n\r\n }\r\n\r\n }\r\n }\r\n </mat-card-content>\r\n <br>\r\n <mat-divider></mat-divider>\r\n <mat-card-actions>\r\n <button mat-flat-button color=\"primary\" (click)=\"saveNewSource()\">Save Source</button>\r\n <span class=\"spacer\"></span>\r\n <button mat-button (click)=\"dataSourceInEdit = undefined\" color=\"warn\">Cancel</button>\r\n </mat-card-actions>\r\n</mat-card>\r\n\r\n}\r\n\r\n\r\n\r\n@if (dataSourceInEdit === undefined) {\r\n<button [disabled]=\"disabled\" (click)=\"dataSourceInEdit={}\" class=\"AddButton\" mat-stroked-button color=\"primary\">\r\n Add Data Source\r\n</button>\r\n}", styles: [".AddButton{width:100%}label{font-size:12px;margin-top:8px}.data-source-card{background:azure}\n"] }]
185
+ }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
186
+ type: Optional
187
+ }, {
188
+ type: Self
189
+ }] }, { type: i0.ElementRef }], propDecorators: { errors: [{
190
+ type: Input
191
+ }], id: [{
192
+ type: HostBinding
193
+ }], value: [{
194
+ type: Input
195
+ }], formInputs: [{
196
+ type: Input
197
+ }], disabled: [{
198
+ type: Input
199
+ }], valueChange: [{
200
+ type: Output
201
+ }], editorConfig: [{
202
+ type: Input
203
+ }] } });
204
+
205
+ export { DataSourcePickerComponent };
206
+ //# sourceMappingURL=ngx-t-forms-data-source-picker.component-BOlk7nkl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-data-source-picker.component-BOlk7nkl.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/data-source-picker/data-source-picker.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/data-source-picker/data-source-picker.component.html"],"sourcesContent":["import { Component, ElementRef, EventEmitter, HostBinding, Input, Optional, Output, Self } from '@angular/core';\r\nimport { NgControl } from '@angular/forms';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { BehaviorSubject, Subject } from 'rxjs';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\nimport { APIDataFetchingConfigurationInterface, DataSources, ElementEditorInnerSectionElementInterface, FormColumnInputs, IReportDataSources, MinimumInputRequiredInterface, MongoDbPipeLineConfigInterface } from 'ngx-t-forms-types';\r\nimport {MatButtonModule} from '@angular/material/button';\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatChipListEditorComponent } from '../mat-chip-list-editor/mat-chip-list-editor.component';\r\nimport { RestApiCallSetupComponent } from '../rest-api-call-setup/rest-api-call-setup.component';\r\nimport { PipelineGeneratorComponent } from '../pipeline-generator/pipeline-generator.component';\r\nimport {MatCardModule} from '@angular/material/card';\r\nimport {MatDividerModule} from '@angular/material/divider';\r\nimport {MatListModule} from '@angular/material/list';\r\nimport {MatIconModule} from '@angular/material/icon';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport { RequiredInputsComponent } from '../required-inputs/required-inputs.component';\r\nimport {MatTooltipModule} from '@angular/material/tooltip';\r\n@Component({\r\n selector: 'lib-data-source-picker',\r\n imports: [\r\n MatButtonModule,\r\n CommonModule,\r\n MatChipListEditorComponent,\r\n RestApiCallSetupComponent,\r\n PipelineGeneratorComponent,\r\n MatCardModule,\r\n MatDividerModule,\r\n MatListModule,\r\n MatIconModule,\r\n RequiredInputsComponent,\r\n MatTooltipModule\r\n \r\n ],\r\n templateUrl: './data-source-picker.component.html',\r\n styleUrl: './data-source-picker.component.css',\r\n providers: [{ provide: MatFormFieldControl, useExisting: DataSourcePickerComponent,}],\r\n})\r\nexport class DataSourcePickerComponent implements MatFormFieldControl< Array< IReportDataSources>| undefined> {\r\n\r\n static nextId = 0;\r\n stateChanges = new Subject<void>();\r\n @Input() errors:IConfigElementError[] |undefined = [];\r\n @HostBinding() id = `lib-data-source-picker-${DataSourcePickerComponent .nextId++}`;\r\n \r\n placeholder: string = ''\r\n constructor(@Optional() @Self() public ngControl: NgControl, private _elementRef: ElementRef<HTMLElement>,) { }\r\n focused: boolean = false;\r\n get empty() {\r\n return !this.value\r\n }\r\n get shouldLabelFloat() {\r\n return this.focused || !this.empty;\r\n }\r\n required: boolean = false;\r\nget errorState(): boolean {\r\n const hasError = !!this.ngControl?.control?.errors || (this.errors||[]).length > 0 && this.touched\r\n return !this.value && !!this.required || hasError\r\n }\r\n\r\n controlType?: string | undefined;\r\n autofilled?: boolean | undefined;\r\n userAriaDescribedBy?: string | undefined;\r\n disableAutomaticLabeling?: boolean | undefined;\r\n setDescribedByIds(ids: string[]) {\r\n // Ensure the component view is initialized\r\n if (this._elementRef && this._elementRef.nativeElement) {\r\n const controlElement = this._elementRef.nativeElement.querySelector('.lib-data-source-picker');\r\n // Check if the controlElement exists before attempting to set its attribute\r\n if (controlElement) {\r\n controlElement.setAttribute('aria-describedby', ids.join(' '));\r\n }\r\n }\r\n }\r\n onContainerClick(event: MouseEvent): void {\r\n this.markAsTouched();\r\n this.stateChanges.next();\r\n }\r\n\r\n touched: boolean = false;\r\n onTouched = () => {};\r\n markAsTouched() {\r\n console.log('markAsTouched') \r\n if (!this.touched) {\r\n this.onTouched();\r\n this.touched = true;\r\n }\r\n } \r\n\r\n\r\n\r\n\r\n _value = new BehaviorSubject<Array< IReportDataSources>|undefined>(undefined)\r\n @Input() set value(value: Array<IReportDataSources>| undefined) {\r\n if (this._value.getValue() === value) {\r\n return\r\n }\r\n this._value.next(value)\r\n }\r\n get value() {\r\n return this._value.getValue()\r\n }\r\n get value$() {\r\n return this._value.asObservable()\r\n\r\n }\r\n _editorConfig:ElementEditorInnerSectionElementInterface | undefined = undefined\r\n @Input() formInputs: Array<FormColumnInputs> = []\r\n @Input() disabled: boolean = false\r\n @Output() valueChange = new EventEmitter<any>()\r\n @Input() set editorConfig(config: ElementEditorInnerSectionElementInterface | undefined) {\r\n this._editorConfig = (config)\r\n }\r\n get editorConfig() {\r\n return this._editorConfig\r\n }\r\n dataSourceInEdit:IReportDataSources | undefined | Record<string,any> = undefined\r\n get dataSourceOptions(){\r\n return [\r\n {\r\n label: 'API',\r\n value: DataSources.Api\r\n },\r\n {\r\n label: 'MongoDB',\r\n value: DataSources.MongoDb\r\n }\r\n ]\r\n }\r\n dataSources = DataSources\r\n dataSourceChanged(source:DataSources | undefined) {\r\n if(!this.dataSourceInEdit) {\r\n return\r\n }\r\n this.dataSourceInEdit['source'] = source\r\n console.error(this.dataSourceInEdit)\r\n }\r\n sourceValueChanged(value:APIDataFetchingConfigurationInterface | MongoDbPipeLineConfigInterface | undefined) {\r\n if(!this.dataSourceInEdit) {\r\n return\r\n }\r\n this.dataSourceInEdit['config'] = value\r\n\r\n }\r\n minimumInputRequiredValueChanged(value: Array<MinimumInputRequiredInterface> ) {\r\n if(!this.dataSourceInEdit) {\r\n return\r\n }\r\n this.dataSourceInEdit['config']['backEndConfig']['minimumInputRequired'] = value\r\n\r\n }\r\n saveNewSource(){\r\n if(!this.dataSourceInEdit) {\r\n return\r\n }\r\n const data:any = {\r\n ...this.dataSourceInEdit,\r\n id:uuidv4(),\r\n }\r\n this.value = [...(this.value || []), data]\r\n this.dataSourceInEdit = undefined\r\n this.valueChange.emit(this.value)\r\n \r\n }\r\n removeSubmissionApi(api:IReportDataSources) {\r\n if(!this.value) {\r\n return\r\n }\r\n this.value = this.value.filter((item) => item.id !== api.id)\r\n this.valueChange.emit(this.value)\r\n }\r\n getName(value:IReportDataSources | undefined, index:number) {\r\n if((value?.config as APIDataFetchingConfigurationInterface).name) {\r\n return (value?.config as APIDataFetchingConfigurationInterface).name\r\n\r\n }\r\n if(value?.source !== 'api') {\r\n return `MongoDB ${index + 1}`\r\n }\r\n return `API ${index + 1}`\r\n }\r\n getIcon(value:IReportDataSources | undefined) {\r\n if(value?.source === 'api') {\r\n return\"api\"\r\n }\r\n return 'storage'\r\n }\r\n getEndpoint(value:IReportDataSources | undefined) {\r\n if(value?.source === 'api') {\r\n return (value.config as APIDataFetchingConfigurationInterface).httpEndPoint\r\n }\r\n return (value?.config as MongoDbPipeLineConfigInterface).workflowId\r\n }\r\n\r\n}\r\n","<mat-nav-list >\r\n <h5 matSubheader class=\"api-list-header\">\r\n\r\n DataSources\r\n </h5>\r\n @if((value)?.length === 0){\r\n <p class=\"no-api-list\">\r\n No data sources configured. Add one to get started.\r\n </p>\r\n }\r\n @for (source of value||[]; track source.id) {\r\n\r\n <mat-list-item \r\n style=\"background: azure;\"\r\n matTooltipPosition=\"before\"\r\n [matTooltip]=\"source.source +' ' + getEndpoint(source)\"\r\n class=\"api-list-item\">\r\n\r\n <mat-icon \r\n \r\n matListItemIcon \r\n [style.color]=\"source.source === 'api' ? 'green' : 'blue'\">\r\n {{getIcon(source)}}\r\n </mat-icon>\r\n <div matListItemTitle>\r\n <div style=\"line-height: normal;\">\r\n <small style=\"white-space: nowrap;overflow: hidden;text-overflow: ellipsis;\">\r\n <strong>\r\n {{getName(source,$index)}}\r\n\r\n </strong>\r\n </small>\r\n\r\n </div>\r\n <div style=\"line-height: normal;opacity: 0.6;\">\r\n <small>\r\n\r\n {{getEndpoint(source)}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <button [disabled]=\"disabled\" matListItemMeta (click)=\"removeSubmissionApi(source)\" mat-icon-button>\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n <mat-divider>\r\n </mat-divider>\r\n\r\n\r\n\r\n }\r\n\r\n\r\n</mat-nav-list>\r\n\r\n@if(dataSourceInEdit !== undefined ) {\r\n<mat-card appearance=\"outlined\" class=\"data-source-card\">\r\n <mat-card-content>\r\n\r\n\r\n <label for=\"629879d6-763b-4f98-b67f-67bbe91045ea\">\r\n Select Source Type\r\n </label>\r\n <lib-mat-chip-list-editor [id]=\"'629879d6-763b-4f98-b67f-67bbe91045ea'\" (valueChange)=\"dataSourceChanged($event)\"\r\n [value]=\"dataSourceInEdit.source\" [options]=\"dataSourceOptions\"></lib-mat-chip-list-editor>\r\n @if(dataSourceInEdit.source !== undefined) {\r\n @switch (dataSourceInEdit.source) {\r\n @case(dataSources.Api){\r\n <label for=\"1a049f19-b4a0-42c9-8058-1759792ee4a5\">\r\n Select API\r\n </label>\r\n <lib-rest-api-call-setup [postmanCollectionConfig]=\"(editorConfig)?.postmanCollectionConfig\"\r\n [httpGetDataFunction]=\"(editorConfig)?.httpGetDataFunction\" [id]=\"'1a049f19-b4a0-42c9-8058-1759792ee4a5'\"\r\n [value]=\"(dataSourceInEdit?.config)\" (valueChanged)=\"sourceValueChanged($event)\">\r\n\r\n </lib-rest-api-call-setup>\r\n @if ((dataSourceInEdit.config?.backEndConfig?.minimumInputRequired)) {\r\n <app-required-inputs [formInputs]=\"formInputs ||[]\" [id]=\"'0ca91260-b610-4d0d-91c1-fdaca61cc5f2'\"\r\n [value]=\"(dataSourceInEdit.config.backEndConfig.minimumInputRequired)\" [errors]=\"[]\"\r\n (valueChanged)=\"minimumInputRequiredValueChanged($event)\">\r\n </app-required-inputs>\r\n }\r\n\r\n }\r\n @case(dataSources.MongoDb){\r\n <label for=\"d3c22913-505d-41f8-a267-72c086b8b10b\">\r\n Add a MongoDB pipeline\r\n </label>\r\n <app-pipeline-generator [id]=\"'d3c22913-505d-41f8-a267-72c086b8b10b'\" [value]=\"(dataSourceInEdit?.config)\"\r\n [getWorkflowOptions]=\"editorConfig?.getWorkflowOptions\"\r\n (valueChanged)=\"sourceValueChanged($event)\"></app-pipeline-generator>\r\n\r\n\r\n }\r\n\r\n }\r\n }\r\n </mat-card-content>\r\n <br>\r\n <mat-divider></mat-divider>\r\n <mat-card-actions>\r\n <button mat-flat-button color=\"primary\" (click)=\"saveNewSource()\">Save Source</button>\r\n <span class=\"spacer\"></span>\r\n <button mat-button (click)=\"dataSourceInEdit = undefined\" color=\"warn\">Cancel</button>\r\n </mat-card-actions>\r\n</mat-card>\r\n\r\n}\r\n\r\n\r\n\r\n@if (dataSourceInEdit === undefined) {\r\n<button [disabled]=\"disabled\" (click)=\"dataSourceInEdit={}\" class=\"AddButton\" mat-stroked-button color=\"primary\">\r\n Add Data Source\r\n</button>\r\n}"],"names":["uuidv4","i5","i6","i7"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;MAsCa,yBAAyB,CAAA;aAE7B,IAAM,CAAA,MAAA,GAAG,CAAH,CAAK;IAMlB,WAAuC,CAAA,SAAoB,EAAU,WAAoC,EAAA;QAAlE,IAAS,CAAA,SAAA,GAAT,SAAS;QAAqB,IAAW,CAAA,WAAA,GAAX,WAAW;AALhF,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;QACvB,IAAM,CAAA,MAAA,GAAoC,EAAE;AACxC,QAAA,IAAA,CAAA,EAAE,GAAG,CAA0B,uBAAA,EAAA,yBAAyB,CAAE,MAAM,EAAE,EAAE;QAEnF,IAAW,CAAA,WAAA,GAAW,EAAE;QAExB,IAAO,CAAA,OAAA,GAAY,KAAK;QAOxB,IAAQ,CAAA,QAAA,GAAY,KAAK;QAyBzB,IAAO,C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@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Input, Output, HostBinding, Optional, Self, Component } from '@angular/core';
3
+ import { Subject } from 'rxjs';
4
+ import { DocumentLitsLabelConfigInterfaceValueType } from 'ngx-t-forms-types';
5
+ import { MatFormFieldModule, MatFormFieldControl } from '@angular/material/form-field';
6
+ import { CommonModule } from '@angular/common';
7
+ import * as i6 from '@angular/material/list';
8
+ import { MatListModule } from '@angular/material/list';
9
+ import * as i8 from '@angular/material/tooltip';
10
+ import { MatTooltipModule } from '@angular/material/tooltip';
11
+ import * as i6$1 from '@angular/material/icon';
12
+ import { MatIconModule } from '@angular/material/icon';
13
+ import * as i3$1 from '@angular/material/card';
14
+ import { MatCardModule } from '@angular/material/card';
15
+ import { MatSliderToggleEditorComponent } from './ngx-t-forms-mat-slider-toggle-editor.component-CbYV5fCZ.mjs';
16
+ import * as i2 from '@angular/material/button';
17
+ import { MatButtonModule } from '@angular/material/button';
18
+ import { MatChipListEditorComponent } from './ngx-t-forms-mat-chip-list-editor.component-C9Hd21i1.mjs';
19
+ import * as i3 from '@angular/material/autocomplete';
20
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
21
+ import { MatInputModule } from '@angular/material/input';
22
+ import { CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';
23
+ import * as i12 from '@angular/cdk/clipboard';
24
+ import { ClipboardModule } from '@angular/cdk/clipboard';
25
+ import * as i1 from '@angular/forms';
26
+ import * as i4 from '@angular/material/divider';
27
+
28
+ class DocumentListLabelConfigEditorComponent {
29
+ static { this.nextId = 0; }
30
+ constructor(ngControl, _elementRef) {
31
+ this.ngControl = ngControl;
32
+ this._elementRef = _elementRef;
33
+ this.stateChanges = new Subject();
34
+ this.errors = [];
35
+ this.id = `lib-document-list-label-config-editor-${DocumentListLabelConfigEditorComponent.nextId++}`;
36
+ this.placeholder = '';
37
+ this.focused = false;
38
+ this.required = false;
39
+ this.touched = false;
40
+ this.onTouched = () => { };
41
+ this._value = [];
42
+ this._editorConfig = undefined;
43
+ this.formInputs = [];
44
+ this.disabled = false;
45
+ this.mapToData = [];
46
+ this.valueChange = new EventEmitter();
47
+ this.labelInEdit = null;
48
+ }
49
+ get empty() {
50
+ return !this.value;
51
+ }
52
+ get shouldLabelFloat() {
53
+ return this.focused || !this.empty;
54
+ }
55
+ get errorState() {
56
+ const hasError = !!this.ngControl?.control?.errors || (this.errors || []).length > 0 && this.touched;
57
+ return !this.value && !!this.required || hasError;
58
+ }
59
+ setDescribedByIds(ids) {
60
+ // Ensure the component view is initialized
61
+ if (this._elementRef && this._elementRef.nativeElement) {
62
+ const controlElement = this._elementRef.nativeElement.querySelector('.lib-document-list-label-config-editor');
63
+ // Check if the controlElement exists before attempting to set its attribute
64
+ if (controlElement) {
65
+ controlElement.setAttribute('aria-describedby', ids.join(' '));
66
+ }
67
+ }
68
+ }
69
+ onContainerClick(event) {
70
+ this.markAsTouched();
71
+ this.stateChanges.next();
72
+ }
73
+ markAsTouched() {
74
+ console.log('markAsTouched');
75
+ if (!this.touched) {
76
+ this.onTouched();
77
+ this.touched = true;
78
+ }
79
+ }
80
+ set value(value) {
81
+ this._value = value;
82
+ }
83
+ get value() {
84
+ return this._value;
85
+ }
86
+ set editorConfig(config) {
87
+ this._editorConfig = (config);
88
+ }
89
+ get editorConfig() {
90
+ return this._editorConfig;
91
+ }
92
+ get filteredControlNames() {
93
+ // Handle case where mapToData is undefined
94
+ if (!this.mapToData)
95
+ return [];
96
+ const searchTerm = this.labelInEdit?.formControlName;
97
+ // If searchTerm is undefined or empty, return all options
98
+ if (!searchTerm || searchTerm.trim() === '') {
99
+ return this.mapToData;
100
+ }
101
+ const lowerSearchTerm = searchTerm.toLowerCase();
102
+ return this.mapToData.filter(option => {
103
+ // Skip null/undefined options
104
+ if (option == null)
105
+ return false;
106
+ // Convert option to string for comparison
107
+ const optionStr = String(option).toLowerCase();
108
+ // Flexible matching using includes (less rigid than exact RegExp)
109
+ if (optionStr.includes(lowerSearchTerm))
110
+ return true;
111
+ // Also match if any word in the option starts with the search term
112
+ // This helps with partial word matching
113
+ return optionStr.split(/\s+/).some(word => word.startsWith(lowerSearchTerm));
114
+ });
115
+ }
116
+ saveHeader() {
117
+ const formControlName = this.labelInEdit?.formControlName;
118
+ const index = this.value.findIndex((item) => item.formControlName === formControlName);
119
+ const v = [...this.value];
120
+ if (index !== -1) {
121
+ v[index] = this.labelInEdit;
122
+ }
123
+ else {
124
+ v.push(this.labelInEdit);
125
+ }
126
+ console.error('saveHeader', v);
127
+ this.value = v;
128
+ this.valueChange.emit(v);
129
+ this.labelInEdit = null;
130
+ }
131
+ removeLabel(label) {
132
+ this.value = this.value.filter((item) => item.formControlName !== label.formControlName);
133
+ this.valueChange.emit(this.value);
134
+ }
135
+ get labelSaveDisabled() {
136
+ if (!this.labelInEdit)
137
+ return true;
138
+ if (!this.labelInEdit.label)
139
+ return true;
140
+ if (!this.labelInEdit.formControlName)
141
+ return true;
142
+ if (!this.labelInEdit.valueType)
143
+ return true;
144
+ return false;
145
+ }
146
+ get valueTypes() {
147
+ return Object.keys(DocumentLitsLabelConfigInterfaceValueType).map((key) => {
148
+ return {
149
+ label: key.replace(/([A-Z])/g, ' $1').trim().toLowerCase().replace(/^\w/, c => c.toUpperCase()),
150
+ value: key
151
+ };
152
+ });
153
+ }
154
+ nameChange(event) {
155
+ const value = event.target?.value;
156
+ this.labelInEdit = {
157
+ ...this.labelInEdit,
158
+ label: value
159
+ };
160
+ }
161
+ formControlNameChange(event) {
162
+ const value = event.target?.value;
163
+ this.labelInEdit = {
164
+ ...this.labelInEdit,
165
+ formControlName: value
166
+ };
167
+ console.error('label', this.labelInEdit);
168
+ }
169
+ valueTypeChanged(event) {
170
+ const value = event;
171
+ this.labelInEdit = {
172
+ ...this.labelInEdit,
173
+ valueType: value
174
+ };
175
+ }
176
+ isHiddenChanged(event) {
177
+ this.labelInEdit = {
178
+ ...this.labelInEdit,
179
+ isHidden: event
180
+ };
181
+ }
182
+ formControlSelected(event) {
183
+ const formControlName = event.option.value;
184
+ this.labelInEdit = {
185
+ ...this.labelInEdit,
186
+ formControlName
187
+ };
188
+ }
189
+ reorderArray(arr, fromIndex, toIndex) {
190
+ const element = arr[fromIndex];
191
+ if (!element)
192
+ return arr;
193
+ const newArr = [...arr];
194
+ newArr.splice(fromIndex, 1);
195
+ newArr.splice(toIndex, 0, element);
196
+ return newArr;
197
+ }
198
+ drop(event) {
199
+ this.value = [...this.reorderArray(this.value, event.previousIndex, event.currentIndex)];
200
+ this.valueChange.emit(this.value);
201
+ }
202
+ copyToClipboard(value) {
203
+ }
204
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: DocumentListLabelConfigEditorComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
205
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: DocumentListLabelConfigEditorComponent, isStandalone: true, selector: "lib-document-list-label-config-editor", inputs: { errors: "errors", value: "value", formInputs: "formInputs", disabled: "disabled", mapToData: "mapToData", editorConfig: "editorConfig" }, outputs: { valueChange: "valueChange" }, host: { properties: { "id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: DocumentListLabelConfigEditorComponent }], ngImport: i0, template: "<mat-nav-list cdkDropList [cdkDropListData]=\"value\"\r\n(cdkDropListDropped)=\"drop($event)\" class=\"list\" >\r\n <h5 matSubheader class=\"api-list-header\">\r\n\r\n List header config\r\n </h5>\r\n @if((value).length === 0){\r\n <p class=\"no-api-list\">\r\n No header configured. Add one to get started.\r\n </p>\r\n }\r\n @for (label of value||[]; track label.formControlName) {\r\n\r\n <mat-list-item cdkDrag style=\"background: azure;\" \r\n [matTooltip]=\"'click to copy ' + label.formControlName\"\r\n [cdkCopyToClipboard]=\"label.formControlName\"\r\n matTooltipPosition=\"before\" class=\"api-list-item\">\r\n\r\n <mat-icon matListItemIcon>\r\n view_column\r\n </mat-icon>\r\n <div matListItemTitle>\r\n <div style=\"line-height: normal;\">\r\n <small style=\"white-space: nowrap;overflow: hidden;text-overflow: ellipsis;\">\r\n <strong>\r\n {{label.label}}\r\n\r\n </strong>\r\n </small>\r\n\r\n </div>\r\n <div style=\"line-height: normal;opacity: 0.6;\">\r\n <small>\r\n <strong><code>{{label.formControlName}}</code></strong>: {{label.valueType}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <button [disabled]=\"disabled\" matListItemMeta (click)=\"removeLabel(label)\" mat-icon-button>\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n <mat-divider>\r\n </mat-divider>\r\n\r\n\r\n\r\n }\r\n\r\n\r\n</mat-nav-list>\r\n<br>\r\n@if(labelInEdit !== null){\r\n<mat-card appearance=\"outlined\" class=\"data-source-card\">\r\n <mat-card-content>\r\n\r\n <label for=\"fb27a2ec-e41f-45f0-916b-f2ef303c2344\">\r\n Form Control Name\r\n </label>\r\n <input ngDefaultControl type=\"text\" \r\n [id]=\"'fb27a2ec-e41f-45f0-916b-f2ef303c2344'\"\r\n placeholder=\"Pick one\" aria-label=\"form control\" \r\n [value]=\"labelInEdit.formControlName||''\" \r\n (input)=\"formControlNameChange($event)\"\r\n [matAutocomplete]=\"auto\">\r\n <mat-autocomplete (optionSelected)=\"formControlSelected($event)\" autoActiveFirstOption #auto=\"matAutocomplete\">\r\n @for (option of filteredControlNames ; track option) {\r\n <mat-option [value]=\"option\">{{option}}</mat-option>\r\n }\r\n </mat-autocomplete>\r\n\r\n\r\n <label for=\"629879d6-763b-4f98-b67f-67bbe91045ea\">\r\n Name\r\n </label>\r\n <input (input)=\"nameChange($event)\" [value]=\"labelInEdit.label||''\" \r\n [id]=\"'4002a77c-9b01-4cdb-b4ce-fdad5a3597d7'\" [placeholder]=\"'Enter label name'\">\r\n <label for=\"bbdad0dc-f92e-4359-92af-a3ff90d0924b\">\r\n value Type\r\n </label>\r\n <lib-mat-chip-list-editor [errors]=\"[]\" [id]=\"'bbdad0dc-f92e-4359-92af-a3ff90d0924b'\"\r\n [value]=\"labelInEdit.valueType\" [options]=\"valueTypes\"\r\n (valueChange)=\"valueTypeChanged($event)\"></lib-mat-chip-list-editor>\r\n\r\n\r\n <lib-mat-slider-toggle-editor [label]=\"'is Hidden '\" [id]=\"'7c0b575c-c41c-4525-ac7e-dc4b9c351009'\"\r\n (valueChange)=\"isHiddenChanged(!!$event)\" [value]=\"labelInEdit.isHidden\" [errors]=\"[]\">\r\n </lib-mat-slider-toggle-editor>\r\n\r\n </mat-card-content>\r\n <br>\r\n <mat-divider></mat-divider>\r\n <mat-card-actions>\r\n <button mat-flat-button color=\"primary\"\r\n [disabled]=\"labelSaveDisabled\"\r\n (click)=\"saveHeader()\">Save Header</button>\r\n <span class=\"spacer\"></span>\r\n <button mat-button (click)=\"labelInEdit = null\" color=\"warn\">Cancel</button>\r\n </mat-card-actions>\r\n</mat-card>\r\n}\r\n\r\n@if (labelInEdit === null) {\r\n<button [disabled]=\"disabled\" (click)=\"labelInEdit={}\" style=\"width: 100%;\" class=\"AddButton\" mat-stroked-button color=\"primary\">\r\n Add new column\r\n</button>\r\n}", styles: ["mat-nav-list{max-height:404px;overflow:auto}label{font-size:12px;display:block;width:100%;margin-top:8px}input{width:100%;padding:8px;border:none;border-bottom:1px solid rgba(0,0,0,.42);background:transparent;font-size:14px;transition:border-bottom-color .3s;outline:none}input:focus{border-bottom:2px solid #243D91;caret-color:#243d91}input:hover{border-bottom-color:#000000de}input::placeholder{color:#0000008a}.data-source-card{background:azure}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.api-list-item:last-child{border:none}.list.cdk-drop-list-dragging .api-list-item:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i6.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i6.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i6.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "directive", type: i6.MatListSubheaderCssMatStyler, selector: "[mat-subheader], [matSubheader]" }, { kind: "component", type: i4.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i6.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "directive", type: i6.MatListItemMeta, selector: "[matListItemMeta]" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i12.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "component", type: MatSliderToggleEditorComponent, selector: "lib-mat-slider-toggle-editor", inputs: ["name", "label", "errors", "disabled", "required", "value", "placeholder"], outputs: ["valueChange"] }, { kind: "component", type: MatChipListEditorComponent, selector: "lib-mat-chip-list-editor", inputs: ["disabled", "errors", "value", "required", "options"], outputs: ["valueChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i3.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i3.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i6$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i3$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i3$1.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: 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"] }] }); }
206
+ }
207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: DocumentListLabelConfigEditorComponent, decorators: [{
208
+ type: Component,
209
+ args: [{ selector: 'lib-document-list-label-config-editor', imports: [CommonModule, MatListModule, MatTooltipModule, ClipboardModule, MatSliderToggleEditorComponent,
210
+ MatChipListEditorComponent,
211
+ MatFormFieldModule,
212
+ MatButtonModule,
213
+ MatAutocompleteModule,
214
+ MatInputModule,
215
+ MatIconModule, MatCardModule, CdkDropList, CdkDrag], providers: [{ provide: MatFormFieldControl, useExisting: DocumentListLabelConfigEditorComponent }], template: "<mat-nav-list cdkDropList [cdkDropListData]=\"value\"\r\n(cdkDropListDropped)=\"drop($event)\" class=\"list\" >\r\n <h5 matSubheader class=\"api-list-header\">\r\n\r\n List header config\r\n </h5>\r\n @if((value).length === 0){\r\n <p class=\"no-api-list\">\r\n No header configured. Add one to get started.\r\n </p>\r\n }\r\n @for (label of value||[]; track label.formControlName) {\r\n\r\n <mat-list-item cdkDrag style=\"background: azure;\" \r\n [matTooltip]=\"'click to copy ' + label.formControlName\"\r\n [cdkCopyToClipboard]=\"label.formControlName\"\r\n matTooltipPosition=\"before\" class=\"api-list-item\">\r\n\r\n <mat-icon matListItemIcon>\r\n view_column\r\n </mat-icon>\r\n <div matListItemTitle>\r\n <div style=\"line-height: normal;\">\r\n <small style=\"white-space: nowrap;overflow: hidden;text-overflow: ellipsis;\">\r\n <strong>\r\n {{label.label}}\r\n\r\n </strong>\r\n </small>\r\n\r\n </div>\r\n <div style=\"line-height: normal;opacity: 0.6;\">\r\n <small>\r\n <strong><code>{{label.formControlName}}</code></strong>: {{label.valueType}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <button [disabled]=\"disabled\" matListItemMeta (click)=\"removeLabel(label)\" mat-icon-button>\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n <mat-divider>\r\n </mat-divider>\r\n\r\n\r\n\r\n }\r\n\r\n\r\n</mat-nav-list>\r\n<br>\r\n@if(labelInEdit !== null){\r\n<mat-card appearance=\"outlined\" class=\"data-source-card\">\r\n <mat-card-content>\r\n\r\n <label for=\"fb27a2ec-e41f-45f0-916b-f2ef303c2344\">\r\n Form Control Name\r\n </label>\r\n <input ngDefaultControl type=\"text\" \r\n [id]=\"'fb27a2ec-e41f-45f0-916b-f2ef303c2344'\"\r\n placeholder=\"Pick one\" aria-label=\"form control\" \r\n [value]=\"labelInEdit.formControlName||''\" \r\n (input)=\"formControlNameChange($event)\"\r\n [matAutocomplete]=\"auto\">\r\n <mat-autocomplete (optionSelected)=\"formControlSelected($event)\" autoActiveFirstOption #auto=\"matAutocomplete\">\r\n @for (option of filteredControlNames ; track option) {\r\n <mat-option [value]=\"option\">{{option}}</mat-option>\r\n }\r\n </mat-autocomplete>\r\n\r\n\r\n <label for=\"629879d6-763b-4f98-b67f-67bbe91045ea\">\r\n Name\r\n </label>\r\n <input (input)=\"nameChange($event)\" [value]=\"labelInEdit.label||''\" \r\n [id]=\"'4002a77c-9b01-4cdb-b4ce-fdad5a3597d7'\" [placeholder]=\"'Enter label name'\">\r\n <label for=\"bbdad0dc-f92e-4359-92af-a3ff90d0924b\">\r\n value Type\r\n </label>\r\n <lib-mat-chip-list-editor [errors]=\"[]\" [id]=\"'bbdad0dc-f92e-4359-92af-a3ff90d0924b'\"\r\n [value]=\"labelInEdit.valueType\" [options]=\"valueTypes\"\r\n (valueChange)=\"valueTypeChanged($event)\"></lib-mat-chip-list-editor>\r\n\r\n\r\n <lib-mat-slider-toggle-editor [label]=\"'is Hidden '\" [id]=\"'7c0b575c-c41c-4525-ac7e-dc4b9c351009'\"\r\n (valueChange)=\"isHiddenChanged(!!$event)\" [value]=\"labelInEdit.isHidden\" [errors]=\"[]\">\r\n </lib-mat-slider-toggle-editor>\r\n\r\n </mat-card-content>\r\n <br>\r\n <mat-divider></mat-divider>\r\n <mat-card-actions>\r\n <button mat-flat-button color=\"primary\"\r\n [disabled]=\"labelSaveDisabled\"\r\n (click)=\"saveHeader()\">Save Header</button>\r\n <span class=\"spacer\"></span>\r\n <button mat-button (click)=\"labelInEdit = null\" color=\"warn\">Cancel</button>\r\n </mat-card-actions>\r\n</mat-card>\r\n}\r\n\r\n@if (labelInEdit === null) {\r\n<button [disabled]=\"disabled\" (click)=\"labelInEdit={}\" style=\"width: 100%;\" class=\"AddButton\" mat-stroked-button color=\"primary\">\r\n Add new column\r\n</button>\r\n}", styles: ["mat-nav-list{max-height:404px;overflow:auto}label{font-size:12px;display:block;width:100%;margin-top:8px}input{width:100%;padding:8px;border:none;border-bottom:1px solid rgba(0,0,0,.42);background:transparent;font-size:14px;transition:border-bottom-color .3s;outline:none}input:focus{border-bottom:2px solid #243D91;caret-color:#243d91}input:hover{border-bottom-color:#000000de}input::placeholder{color:#0000008a}.data-source-card{background:azure}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.api-list-item:last-child{border:none}.list.cdk-drop-list-dragging .api-list-item:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
216
+ }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
217
+ type: Optional
218
+ }, {
219
+ type: Self
220
+ }] }, { type: i0.ElementRef }], propDecorators: { errors: [{
221
+ type: Input
222
+ }], id: [{
223
+ type: HostBinding
224
+ }], value: [{
225
+ type: Input
226
+ }], formInputs: [{
227
+ type: Input
228
+ }], disabled: [{
229
+ type: Input
230
+ }], mapToData: [{
231
+ type: Input
232
+ }], valueChange: [{
233
+ type: Output
234
+ }], editorConfig: [{
235
+ type: Input
236
+ }] } });
237
+
238
+ export { DocumentListLabelConfigEditorComponent };
239
+ //# sourceMappingURL=ngx-t-forms-document-list-label-config-editor.component-Bc-qTS2m.mjs.map