ngx-t-forms 2.0.29 → 2.0.31

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 (161) hide show
  1. package/fesm2022/ngx-t-forms-auto-complete-input-element.component-DCKuXHAW.mjs +104 -0
  2. package/fesm2022/ngx-t-forms-auto-complete-input-element.component-DCKuXHAW.mjs.map +1 -0
  3. package/fesm2022/ngx-t-forms-basic-input-input-element.component-Ce4ipSUc.mjs +85 -0
  4. package/fesm2022/ngx-t-forms-basic-input-input-element.component-Ce4ipSUc.mjs.map +1 -0
  5. package/fesm2022/ngx-t-forms-calculated-field-rules.component-C5TPddVe.mjs +643 -0
  6. package/fesm2022/ngx-t-forms-calculated-field-rules.component-C5TPddVe.mjs.map +1 -0
  7. package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-CICQaqz6.mjs +97 -0
  8. package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-CICQaqz6.mjs.map +1 -0
  9. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-CzisLSIP.mjs +195 -0
  10. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-CzisLSIP.mjs.map +1 -0
  11. package/fesm2022/ngx-t-forms-data-source-picker.component-Dzz_o6fJ.mjs +261 -0
  12. package/fesm2022/ngx-t-forms-data-source-picker.component-Dzz_o6fJ.mjs.map +1 -0
  13. package/fesm2022/ngx-t-forms-date-picker-input-element.component-CYUbVyzP.mjs +85 -0
  14. package/fesm2022/ngx-t-forms-date-picker-input-element.component-CYUbVyzP.mjs.map +1 -0
  15. package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-CmoquQGV.mjs +156 -0
  16. package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-CmoquQGV.mjs.map +1 -0
  17. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-CLUOXreG.mjs +368 -0
  18. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-CLUOXreG.mjs.map +1 -0
  19. package/fesm2022/ngx-t-forms-document-picker.component-qObjcqhE.mjs +704 -0
  20. package/fesm2022/ngx-t-forms-document-picker.component-qObjcqhE.mjs.map +1 -0
  21. package/fesm2022/ngx-t-forms-editor-input-element.component-BLXlfb6F.mjs +294 -0
  22. package/fesm2022/ngx-t-forms-editor-input-element.component-BLXlfb6F.mjs.map +1 -0
  23. package/fesm2022/ngx-t-forms-editor-js-input.component-BQL0AH7H.mjs +240 -0
  24. package/fesm2022/ngx-t-forms-editor-js-input.component-BQL0AH7H.mjs.map +1 -0
  25. package/fesm2022/ngx-t-forms-file-upload-input-element.component-C7mMeEjF.mjs +205 -0
  26. package/fesm2022/ngx-t-forms-file-upload-input-element.component-C7mMeEjF.mjs.map +1 -0
  27. package/fesm2022/ngx-t-forms-form-input-selector.component-C9u8zq9B.mjs +86 -0
  28. package/fesm2022/ngx-t-forms-form-input-selector.component-C9u8zq9B.mjs.map +1 -0
  29. package/fesm2022/ngx-t-forms-form-json-view.component-856Hx1Bg.mjs +22 -0
  30. package/fesm2022/ngx-t-forms-form-json-view.component-856Hx1Bg.mjs.map +1 -0
  31. package/fesm2022/ngx-t-forms-form-payload-projection.component-CDkTuX9S.mjs +179 -0
  32. package/fesm2022/ngx-t-forms-form-payload-projection.component-CDkTuX9S.mjs.map +1 -0
  33. package/fesm2022/ngx-t-forms-form-section-stepper.component-Bs50-nEB.mjs +319 -0
  34. package/fesm2022/ngx-t-forms-form-section-stepper.component-Bs50-nEB.mjs.map +1 -0
  35. package/fesm2022/ngx-t-forms-forms-builder-menu.component-qrhM0jGL.mjs +379 -0
  36. package/fesm2022/ngx-t-forms-forms-builder-menu.component-qrhM0jGL.mjs.map +1 -0
  37. package/fesm2022/ngx-t-forms-geo-location.component-Bosp1UzR.mjs +124 -0
  38. package/fesm2022/ngx-t-forms-geo-location.component-Bosp1UzR.mjs.map +1 -0
  39. package/fesm2022/ngx-t-forms-getInputIcon-B4ADgevZ.mjs +31 -0
  40. package/fesm2022/ngx-t-forms-getInputIcon-B4ADgevZ.mjs.map +1 -0
  41. package/fesm2022/ngx-t-forms-image-capture-input-element.component-C1g7Z0cK.mjs +180 -0
  42. package/fesm2022/ngx-t-forms-image-capture-input-element.component-C1g7Z0cK.mjs.map +1 -0
  43. package/fesm2022/ngx-t-forms-index-dDSobs6A.mjs +2 -0
  44. package/fesm2022/ngx-t-forms-index-dDSobs6A.mjs.map +1 -0
  45. package/fesm2022/ngx-t-forms-input-custom.component-BkbHFAyR.mjs +105 -0
  46. package/fesm2022/ngx-t-forms-input-custom.component-BkbHFAyR.mjs.map +1 -0
  47. package/fesm2022/ngx-t-forms-input-editor.component-BPUOM9kQ.mjs +181 -0
  48. package/fesm2022/ngx-t-forms-input-editor.component-BPUOM9kQ.mjs.map +1 -0
  49. package/fesm2022/{ngx-t-forms-map-mat-options-keys-CbdW82su.mjs → ngx-t-forms-map-mat-options-keys-B6hJ7Io5.mjs} +12 -14
  50. package/fesm2022/ngx-t-forms-map-mat-options-keys-B6hJ7Io5.mjs.map +1 -0
  51. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-c7uZT1sr.mjs +66 -0
  52. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-c7uZT1sr.mjs.map +1 -0
  53. package/fesm2022/ngx-t-forms-mat-slider-editor.component-CTSBrM-j.mjs +211 -0
  54. package/fesm2022/ngx-t-forms-mat-slider-editor.component-CTSBrM-j.mjs.map +1 -0
  55. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-CcYiwx-8.mjs +165 -0
  56. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-CcYiwx-8.mjs.map +1 -0
  57. package/fesm2022/ngx-t-forms-missing-form-configs.component-DrnH8qdG.mjs +38 -0
  58. package/fesm2022/ngx-t-forms-missing-form-configs.component-DrnH8qdG.mjs.map +1 -0
  59. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-C_abEBQ5.mjs +38 -0
  60. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-C_abEBQ5.mjs.map +1 -0
  61. package/fesm2022/ngx-t-forms-mscoa-error-display.component-99DpVSy7.mjs +126 -0
  62. package/fesm2022/ngx-t-forms-mscoa-error-display.component-99DpVSy7.mjs.map +1 -0
  63. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C0qsMfsq.mjs +336 -0
  64. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C0qsMfsq.mjs.map +1 -0
  65. package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs +74 -0
  66. package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs.map +1 -0
  67. package/fesm2022/ngx-t-forms-multiple-input-input-element.component-C7y1OGPx.mjs +905 -0
  68. package/fesm2022/ngx-t-forms-multiple-input-input-element.component-C7y1OGPx.mjs.map +1 -0
  69. package/fesm2022/ngx-t-forms-ngx-t-forms-u_kigDid.mjs +19461 -0
  70. package/fesm2022/ngx-t-forms-ngx-t-forms-u_kigDid.mjs.map +1 -0
  71. package/fesm2022/ngx-t-forms-paginated-selection-table-AQZSMmhr.mjs +555 -0
  72. package/fesm2022/ngx-t-forms-paginated-selection-table-AQZSMmhr.mjs.map +1 -0
  73. package/fesm2022/ngx-t-forms-pipeline-generator.component-DmNSc5aw.mjs +748 -0
  74. package/fesm2022/ngx-t-forms-pipeline-generator.component-DmNSc5aw.mjs.map +1 -0
  75. package/fesm2022/ngx-t-forms-record-list-manager.component-CUMMvMch.mjs +358 -0
  76. package/fesm2022/ngx-t-forms-record-list-manager.component-CUMMvMch.mjs.map +1 -0
  77. package/fesm2022/ngx-t-forms-required-inputs.component-Ch2yNcIS.mjs +272 -0
  78. package/fesm2022/ngx-t-forms-required-inputs.component-Ch2yNcIS.mjs.map +1 -0
  79. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-C_aFtdvW.mjs +398 -0
  80. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-C_aFtdvW.mjs.map +1 -0
  81. package/fesm2022/ngx-t-forms-search-field.component-B2ZO7lqO.mjs +38 -0
  82. package/fesm2022/ngx-t-forms-search-field.component-B2ZO7lqO.mjs.map +1 -0
  83. package/fesm2022/ngx-t-forms-section-report.component-BxOhR6C0.mjs +98 -0
  84. package/fesm2022/ngx-t-forms-section-report.component-BxOhR6C0.mjs.map +1 -0
  85. package/fesm2022/ngx-t-forms-select-input-element.component-DbgZdNoe.mjs +150 -0
  86. package/fesm2022/ngx-t-forms-select-input-element.component-DbgZdNoe.mjs.map +1 -0
  87. package/fesm2022/ngx-t-forms-selection-options-editor.component-Dhln81DL.mjs +169 -0
  88. package/fesm2022/ngx-t-forms-selection-options-editor.component-Dhln81DL.mjs.map +1 -0
  89. package/fesm2022/ngx-t-forms-t-workflow-picker.component-leBokXvM.mjs +204 -0
  90. package/fesm2022/ngx-t-forms-t-workflow-picker.component-leBokXvM.mjs.map +1 -0
  91. package/fesm2022/ngx-t-forms-textarea-input-element.component-BEbXJjFA.mjs +95 -0
  92. package/fesm2022/ngx-t-forms-textarea-input-element.component-BEbXJjFA.mjs.map +1 -0
  93. package/fesm2022/ngx-t-forms-toggle-input-element.component-DDErRUJd.mjs +82 -0
  94. package/fesm2022/ngx-t-forms-toggle-input-element.component-DDErRUJd.mjs.map +1 -0
  95. package/fesm2022/ngx-t-forms-validators-config.component-oGjQVGE2.mjs +733 -0
  96. package/fesm2022/ngx-t-forms-validators-config.component-oGjQVGE2.mjs.map +1 -0
  97. package/fesm2022/ngx-t-forms-workflow-adjudication.component-CtU8dECN.mjs +1303 -0
  98. package/fesm2022/ngx-t-forms-workflow-adjudication.component-CtU8dECN.mjs.map +1 -0
  99. package/fesm2022/ngx-t-forms.mjs +2 -1
  100. package/fesm2022/ngx-t-forms.mjs.map +1 -1
  101. package/package.json +20 -18
  102. package/styles/_editor-mixins.scss +62 -0
  103. package/styles/_json-editor-syntax.scss +26 -0
  104. package/styles/_signature-pad.scss +26 -0
  105. package/styles/_tokens.scss +148 -0
  106. package/types/ngx-t-forms.d.ts +1767 -621
  107. package/fesm2022/ngx-t-forms-calculated-field-rules.component-D-SBMdYg.mjs +0 -313
  108. package/fesm2022/ngx-t-forms-calculated-field-rules.component-D-SBMdYg.mjs.map +0 -1
  109. package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-1cpszpPN.mjs +0 -191
  110. package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-1cpszpPN.mjs.map +0 -1
  111. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-DFdAVWTg.mjs +0 -207
  112. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-DFdAVWTg.mjs.map +0 -1
  113. package/fesm2022/ngx-t-forms-data-source-picker.component-DxORinAD.mjs +0 -204
  114. package/fesm2022/ngx-t-forms-data-source-picker.component-DxORinAD.mjs.map +0 -1
  115. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-DcWS1txl.mjs +0 -289
  116. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-DcWS1txl.mjs.map +0 -1
  117. package/fesm2022/ngx-t-forms-form-input-selector.component-B2QEnvkq.mjs +0 -134
  118. package/fesm2022/ngx-t-forms-form-input-selector.component-B2QEnvkq.mjs.map +0 -1
  119. package/fesm2022/ngx-t-forms-form-json-view.component-DePf44w6.mjs +0 -22
  120. package/fesm2022/ngx-t-forms-form-json-view.component-DePf44w6.mjs.map +0 -1
  121. package/fesm2022/ngx-t-forms-form-section-stepper.component-BTkcSjg7.mjs +0 -270
  122. package/fesm2022/ngx-t-forms-form-section-stepper.component-BTkcSjg7.mjs.map +0 -1
  123. package/fesm2022/ngx-t-forms-forms-builder-menu.component-Wamzf_sq.mjs +0 -345
  124. package/fesm2022/ngx-t-forms-forms-builder-menu.component-Wamzf_sq.mjs.map +0 -1
  125. package/fesm2022/ngx-t-forms-input-editor.component-D4xHO76K.mjs +0 -147
  126. package/fesm2022/ngx-t-forms-input-editor.component-D4xHO76K.mjs.map +0 -1
  127. package/fesm2022/ngx-t-forms-map-mat-options-keys-CbdW82su.mjs.map +0 -1
  128. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DmTyO9Wi.mjs +0 -105
  129. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DmTyO9Wi.mjs.map +0 -1
  130. package/fesm2022/ngx-t-forms-mat-slider-editor.component-DZ4TenrI.mjs +0 -109
  131. package/fesm2022/ngx-t-forms-mat-slider-editor.component-DZ4TenrI.mjs.map +0 -1
  132. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DPyBYE4p.mjs +0 -155
  133. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DPyBYE4p.mjs.map +0 -1
  134. package/fesm2022/ngx-t-forms-missing-form-configs.component-BRmnwAK6.mjs +0 -28
  135. package/fesm2022/ngx-t-forms-missing-form-configs.component-BRmnwAK6.mjs.map +0 -1
  136. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-D_umeAPL.mjs +0 -43
  137. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-D_umeAPL.mjs.map +0 -1
  138. package/fesm2022/ngx-t-forms-mscoa-error-display.component-CSX2NCNU.mjs +0 -116
  139. package/fesm2022/ngx-t-forms-mscoa-error-display.component-CSX2NCNU.mjs.map +0 -1
  140. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-B6IF8kGg.mjs +0 -296
  141. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-B6IF8kGg.mjs.map +0 -1
  142. package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-BPkjsRmH.mjs +0 -83
  143. package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-BPkjsRmH.mjs.map +0 -1
  144. package/fesm2022/ngx-t-forms-ngx-t-forms-D9qmig6g.mjs +0 -16844
  145. package/fesm2022/ngx-t-forms-ngx-t-forms-D9qmig6g.mjs.map +0 -1
  146. package/fesm2022/ngx-t-forms-pipeline-generator.component-DBJEyCbd.mjs +0 -613
  147. package/fesm2022/ngx-t-forms-pipeline-generator.component-DBJEyCbd.mjs.map +0 -1
  148. package/fesm2022/ngx-t-forms-record-list-manager.component-Dgs9lNSr.mjs +0 -269
  149. package/fesm2022/ngx-t-forms-record-list-manager.component-Dgs9lNSr.mjs.map +0 -1
  150. package/fesm2022/ngx-t-forms-required-inputs.component-CSIJvSHq.mjs +0 -190
  151. package/fesm2022/ngx-t-forms-required-inputs.component-CSIJvSHq.mjs.map +0 -1
  152. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-CY-JSkGs.mjs +0 -291
  153. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-CY-JSkGs.mjs.map +0 -1
  154. package/fesm2022/ngx-t-forms-section-report.component-12-KdKT6.mjs +0 -156
  155. package/fesm2022/ngx-t-forms-section-report.component-12-KdKT6.mjs.map +0 -1
  156. package/fesm2022/ngx-t-forms-selection-options-editor.component-Be3QAG_L.mjs +0 -186
  157. package/fesm2022/ngx-t-forms-selection-options-editor.component-Be3QAG_L.mjs.map +0 -1
  158. package/fesm2022/ngx-t-forms-t-workflow-picker.component-a4f1r8gH.mjs +0 -187
  159. package/fesm2022/ngx-t-forms-t-workflow-picker.component-a4f1r8gH.mjs.map +0 -1
  160. package/fesm2022/ngx-t-forms-validators-config.component-B3j9Dmgu.mjs +0 -215
  161. package/fesm2022/ngx-t-forms-validators-config.component-B3j9Dmgu.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-selection-options-editor.component-Dhln81DL.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/selection-options-editor/selection-options-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/selection-options-editor/selection-options-editor.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n PLATFORM_ID,\n ViewEncapsulation,\n computed,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n FormControl,\n FormGroup,\n NonNullableFormBuilder,\n ReactiveFormsModule,\n Validators,\n} from '@angular/forms';\n\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCardModule } from '@angular/material/card';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatToolbarModule } from '@angular/material/toolbar';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport type { IConfigElementError } from '../../t-dynamic-data-edit.component';\nimport { EmptyStateComponent } from '../_shared/empty-state/empty-state.component';\n\n/** A single selectable option managed by the editor. */\ninterface Option {\n /** Stable identifier, generated once per option and never reassigned. */\n id: string;\n /** Display text the end user sees in the rendered form. */\n label: string;\n /** Stored value persisted when the option is chosen. */\n value: string;\n}\n\n/** Reactive form shape backing the add/edit card. */\ntype OptionForm = FormGroup<{\n label: FormControl<string>;\n value: FormControl<string>;\n}>;\n\nlet nextUniqueId = 0;\n\n/**\n * Editor for a list of selectable `{ id, label, value }` options. Renders inside\n * `t-dynamic-data-edit`, which supplies the field label, hint, and validation\n * errors — so this component owns only the chip list plus the add/edit card.\n *\n * @example\n * <lib-selection-options-editor\n * [options]=\"options()\"\n * [disabled]=\"disabled()\"\n * (valueChanged)=\"onOptions($event)\" />\n */\n@Component({\n selector: 'lib-selection-options-editor',\n templateUrl: './selection-options-editor.component.html',\n styleUrl: './selection-options-editor.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n 'class': 'lib-selection-options-editor',\n '[attr.id]': 'hostId',\n },\n imports: [\n ReactiveFormsModule,\n MatButtonModule,\n MatCardModule,\n MatChipsModule,\n MatFormFieldModule,\n MatIconModule,\n MatInputModule,\n MatToolbarModule,\n MatTooltipModule,\n EmptyStateComponent,\n ],\n})\nexport class SelectionOptionsEditorComponent {\n /** Validation errors surfaced by the parent (kept for contract parity). */\n readonly errors = input<IConfigElementError[] | undefined>([]);\n\n /** Disables interaction with the chip list and the add control. */\n readonly disabled = input<boolean>(false);\n\n /** Current set of options to edit. */\n readonly options = input<readonly Option[]>([]);\n\n /** Fires the full option list whenever it is added to, edited, or pruned. */\n readonly valueChanged = output<Option[]>();\n\n /** Stable host id used by the parent's `[attr.id]` binding. */\n readonly hostId = `app-selection-options-editor-${nextUniqueId++}`;\n\n readonly #platformId = inject(PLATFORM_ID);\n readonly #document = inject(DOCUMENT);\n readonly #fb = inject(NonNullableFormBuilder);\n\n /** Option being edited (existing) or added (no id yet); `null` when closed. */\n protected readonly inEdit = signal<Option | null>(null);\n\n /** Whether the editor is in \"add new\" mode (open card, no existing id). */\n protected readonly isAdding = signal<boolean>(false);\n\n /** When true, an empty value auto-fills from the camelCased label on blur. */\n protected readonly isAutoCamelCase = signal<boolean>(true);\n\n /** Live snapshot of the upstream options, defensively normalised to an array. */\n protected readonly optionList = computed<readonly Option[]>(() => this.options() ?? []);\n\n /** Whether the add/edit card is currently open. */\n protected readonly isEditing = computed<boolean>(\n () => this.isAdding() || this.inEdit() !== null,\n );\n\n /** Reactive form for the open add/edit card. */\n protected readonly form: OptionForm = this.#fb.group({\n label: this.#fb.control('', Validators.required),\n value: this.#fb.control('', Validators.required),\n });\n\n /** Opens the card to add a new option. */\n protected add(): void {\n this.inEdit.set(null);\n this.isAdding.set(true);\n this.#resetForm('', '');\n }\n\n /** Opens the card to edit an existing option. */\n protected startEdit(option: Option): void {\n this.isAdding.set(false);\n this.inEdit.set(option);\n this.#resetForm(option.label, option.value);\n }\n\n /** Closes the card without persisting changes. */\n protected closeEdit(): void {\n this.inEdit.set(null);\n this.isAdding.set(false);\n }\n\n /** Removes an option after browser confirmation, then emits the new list. */\n protected remove(option: Option): void {\n if (!isPlatformBrowser(this.#platformId)) return;\n const win = this.#document.defaultView;\n if (!win) return;\n if (!win.confirm(`Are you sure you want to delete the option \"${option.label}\"?`)) return;\n\n this.valueChanged.emit(this.optionList().filter((o) => o.id !== option.id));\n if (this.inEdit()?.id === option.id) this.closeEdit();\n }\n\n /** Persists the open card as a new or updated option, then emits the list. */\n protected save(): void {\n if (this.form.invalid) return;\n\n const { label, value } = this.form.getRawValue();\n const editing = this.inEdit();\n const next = editing\n ? this.optionList().map((o) => (o.id === editing.id ? { ...o, label, value } : o))\n : [...this.optionList(), { id: uuidv4(), label, value }];\n\n this.valueChanged.emit(next);\n this.closeEdit();\n }\n\n /** Toggles auto-camelCase generation of an empty value from the label. */\n protected toggleAutoCamelCase(): void {\n this.isAutoCamelCase.update((on) => !on);\n }\n\n /**\n * Fills an empty `value` with the camelCased `label` on label blur. A value\n * the user already set is never overwritten.\n */\n protected autoFillValueFromLabel(): void {\n if (!this.isAutoCamelCase()) return;\n const label = this.form.controls.label.value.trim();\n if (label && !this.form.controls.value.value) {\n this.form.controls.value.setValue(this.#camelCase(label));\n }\n }\n\n /** Resets the form to the supplied label/value pair. */\n #resetForm(label: string, value: string): void {\n this.form.reset({ label, value });\n }\n\n /** Native camelCase: identical output to the previous lodash dependency. */\n #camelCase(input: string): string {\n const words = input\n .replace(/[^A-Za-z0-9]+/g, ' ')\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((w) => w.length > 0);\n return words\n .map((word, i) => (i === 0 ? word : word.charAt(0).toUpperCase() + word.slice(1)))\n .join('');\n }\n}\n","@if (optionList().length) {\n <mat-chip-listbox\n class=\"lib-selection-options-editor__listbox\"\n aria-label=\"Option selection\"\n [disabled]=\"disabled()\">\n @for (option of optionList(); track option.id) {\n <mat-chip-option\n class=\"lib-selection-options-editor__chip\"\n color=\"accent\"\n [value]=\"option.value\"\n [selected]=\"inEdit()?.id === option.id\"\n (click)=\"startEdit(option)\">\n {{ option.label }}\n <button\n matChipRemove\n [attr.aria-label]=\"'Remove ' + option.label\"\n (click)=\"$event.stopPropagation(); remove(option)\">\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-option>\n }\n </mat-chip-listbox>\n} @else if (!isEditing()) {\n <lib-empty-state icon=\"list_alt\" message=\"No options yet\" />\n}\n\n@if (!isEditing()) {\n <mat-toolbar class=\"lib-selection-options-editor__toolbar\">\n <button\n class=\"lib-selection-options-editor__add\"\n mat-stroked-button\n [disabled]=\"disabled()\"\n (click)=\"add()\">\n Add an option <mat-icon>add</mat-icon>\n </button>\n </mat-toolbar>\n} @else {\n <mat-card class=\"lib-selection-options-editor__card\" appearance=\"outlined\">\n <mat-card-header>\n <mat-card-subtitle>{{ inEdit() ? 'Edit Option' : 'Add New Option' }}</mat-card-subtitle>\n </mat-card-header>\n\n <mat-card-content>\n <form [formGroup]=\"form\">\n <mat-form-field\n class=\"lib-selection-options-editor__field\"\n subscriptSizing=\"dynamic\"\n floatLabel=\"always\"\n appearance=\"outline\">\n <mat-label>Display Text</mat-label>\n <input\n type=\"text\"\n matInput\n formControlName=\"label\"\n placeholder=\"Enter option text\"\n (blur)=\"autoFillValueFromLabel()\" />\n <mat-hint>The text users will see and select from the list.</mat-hint>\n </mat-form-field>\n\n <mat-form-field\n class=\"lib-selection-options-editor__field\"\n subscriptSizing=\"dynamic\"\n floatLabel=\"always\"\n appearance=\"outline\">\n <mat-label>Stored Value</mat-label>\n <input type=\"text\" matInput formControlName=\"value\" placeholder=\"Enter data value\" />\n <button\n matSuffix\n mat-icon-button\n matTooltip=\"Toggle auto-creation of value from display text\"\n [color]=\"isAutoCamelCase() ? 'primary' : ''\"\n (click)=\"toggleAutoCamelCase()\">\n <mat-icon>{{ isAutoCamelCase() ? 'drive_file_rename_outline' : 'edit_off' }}</mat-icon>\n </button>\n <mat-hint>The value saved when this option is chosen. (Often an ID or code)</mat-hint>\n </mat-form-field>\n </form>\n </mat-card-content>\n\n <mat-card-actions>\n <button mat-button (click)=\"closeEdit()\">Cancel</button>\n <button mat-flat-button [disabled]=\"form.invalid\" (click)=\"save()\">\n {{ inEdit() ? 'Save Changes' : 'Add Option' }}\n </button>\n </mat-card-actions>\n </mat-card>\n}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GAAA,EAAA,MAAA,EAAA,CAAA,2sBAAA,CAAA,EAAA;;;;;"}
@@ -0,0 +1,204 @@
1
+ import * as i0 from '@angular/core';
2
+ import { output, inject, ElementRef, DestroyRef, Input, Optional, Self, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
+ import * as i3$3 from '@angular/common';
5
+ import { CommonModule } from '@angular/common';
6
+ import { MatFormFieldControl } from '@angular/material/form-field';
7
+ import { Subject, take, tap, catchError } from 'rxjs';
8
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
9
+ import * as i5 from '@angular/material/toolbar';
10
+ import { MatToolbarModule } from '@angular/material/toolbar';
11
+ import * as i1$1 from '@angular/material/button';
12
+ import { MatButtonModule } from '@angular/material/button';
13
+ import * as i3 from '@angular/material/icon';
14
+ import { MatIconModule } from '@angular/material/icon';
15
+ import * as i3$1 from '@angular/material/card';
16
+ import { MatCardModule } from '@angular/material/card';
17
+ import * as i4 from '@angular/material/list';
18
+ import { MatListModule } from '@angular/material/list';
19
+ import * as i1$2 from '@angular/material/chips';
20
+ import { MatChipsModule } from '@angular/material/chips';
21
+ import { MatDividerModule } from '@angular/material/divider';
22
+ import * as i3$2 from '@angular/material/progress-spinner';
23
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
24
+ import * as i1 from '@angular/forms';
25
+
26
+ class TWorkflowPickerComponent {
27
+ static { this.nextId = 0; }
28
+ get required() {
29
+ return this._required;
30
+ }
31
+ set required(value) {
32
+ this._required = coerceBooleanProperty(value);
33
+ this.stateChanges.next();
34
+ }
35
+ get value() {
36
+ return this._value;
37
+ }
38
+ set value(val) {
39
+ this._value = val;
40
+ this.onChange(val);
41
+ this.stateChanges.next();
42
+ }
43
+ get placeholder() {
44
+ return this._placeholder;
45
+ }
46
+ set placeholder(value) {
47
+ this._placeholder = value;
48
+ this.stateChanges.next();
49
+ }
50
+ get shouldLabelFloat() {
51
+ return this.focused || !this.empty;
52
+ }
53
+ get empty() {
54
+ return !this.value || this.value.length === 0;
55
+ }
56
+ get errorState() {
57
+ return ((!this.value && this.required && this.touched) ||
58
+ !!this.ngControl?.errors ||
59
+ (this.errors || []).length > 0);
60
+ }
61
+ #elementRef;
62
+ #destroyRef;
63
+ constructor(ngControl) {
64
+ this.ngControl = ngControl;
65
+ this.stateChanges = new Subject();
66
+ this.focused = false;
67
+ this.touched = false;
68
+ this.disabled = false;
69
+ this.controlType = 'lib-t-workflow-picker';
70
+ this.autofilled = false;
71
+ this.errors = [];
72
+ this.valueChange = output();
73
+ this._required = false;
74
+ this._value = undefined;
75
+ this._placeholder = '';
76
+ this.id = `lib-t-workflow-picker-${TWorkflowPickerComponent.nextId++}`;
77
+ this.describedBy = '';
78
+ this.#elementRef = inject(ElementRef);
79
+ this.#destroyRef = inject(DestroyRef);
80
+ // ControlValueAccessor methods — Angular's CVA contract accepts any callback signature.
81
+ // TODO(Phase-4): revisit once Angular tightens CVA generics upstream.
82
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
83
+ this.onChange = () => { };
84
+ this.onTouched = () => { };
85
+ this.valueChanged = output();
86
+ this.workflowNameChanged = output();
87
+ this.error = undefined;
88
+ this.loading = false;
89
+ if (this.ngControl != null) {
90
+ this.ngControl.valueAccessor = this;
91
+ }
92
+ }
93
+ ngOnInit() {
94
+ this.loadWorkflows();
95
+ }
96
+ writeValue(value) {
97
+ this._value = value;
98
+ this.stateChanges.next();
99
+ }
100
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
101
+ registerOnChange(fn) {
102
+ this.onChange = fn;
103
+ }
104
+ registerOnTouched(fn) {
105
+ this.onTouched = fn;
106
+ }
107
+ setDisabledState(isDisabled) {
108
+ this.disabled = isDisabled;
109
+ this.stateChanges.next();
110
+ }
111
+ // MatFormFieldControl methods
112
+ setDescribedByIds(ids) {
113
+ const element = this.#elementRef?.nativeElement;
114
+ if (element) {
115
+ element.setAttribute('aria-describedby', ids.join(' '));
116
+ }
117
+ }
118
+ onContainerClick(_event) {
119
+ if (!this.focused) {
120
+ this.focused = true;
121
+ this.stateChanges.next();
122
+ }
123
+ }
124
+ markAsTouched() {
125
+ if (!this.touched) {
126
+ this.touched = true;
127
+ this.onTouched();
128
+ this.stateChanges.next();
129
+ }
130
+ }
131
+ set getWorkflowOptions(value) {
132
+ this._getWorkflowOptions = value;
133
+ }
134
+ get workflowOptions() {
135
+ return this._workflowOptions || [];
136
+ }
137
+ unbindInput() {
138
+ this.value = undefined;
139
+ this.valueChanged.emit(this.value);
140
+ this.workflowNameChanged.emit(undefined);
141
+ }
142
+ bindInput(workflow) {
143
+ this.valueChanged.emit(workflow.id);
144
+ this.workflowNameChanged.emit(workflow.name);
145
+ }
146
+ get selectedWorkflow() {
147
+ return this._workflowOptions?.find((workflow) => workflow.id === this.value);
148
+ }
149
+ loadWorkflows() {
150
+ if (!this._getWorkflowOptions)
151
+ return;
152
+ this.loading = true;
153
+ this._getWorkflowOptions
154
+ ?.pipe(take(1), tap((workflows) => {
155
+ this.error = undefined;
156
+ this._workflowOptions = workflows;
157
+ this.loading = false;
158
+ }, catchError((error) => {
159
+ this.loading = false;
160
+ this.error = error;
161
+ return error;
162
+ })), takeUntilDestroyed(this.#destroyRef))
163
+ .subscribe();
164
+ }
165
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TWorkflowPickerComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
166
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: TWorkflowPickerComponent, isStandalone: true, selector: "lib-t-workflow-picker", inputs: { disabled: "disabled", errors: "errors", required: "required", value: "value", placeholder: "placeholder", getWorkflowOptions: "getWorkflowOptions" }, outputs: { valueChange: "valueChange", valueChanged: "valueChanged", workflowNameChanged: "workflowNameChanged" }, host: { properties: { "attr.id": "id", "attr.aria-describedby": "describedBy", "class.floating": "shouldLabelFloat" } }, providers: [{ provide: MatFormFieldControl, useExisting: TWorkflowPickerComponent }], ngImport: i0, template: "@if (error) {\r\n<mat-toolbar>\r\n <span>\r\n Failed to load workflow list\r\n </span>\r\n <span class=\"spacer\"></span>\r\n <button color=\"primary\" mat-raised-button>\r\n Retry\r\n\r\n </button>\r\n</mat-toolbar>\r\n}@else {\r\n <mat-toolbar>\r\n <span style=\"font-size: x-small;\">\r\n Reload Worlkflows\r\n </span>\r\n <span class=\"spacer\">\r\n\r\n </span>\r\n <button (click)=\"loadWorkflows()\" mat-stroked-button>\r\n Reload \r\n <mat-icon>\r\n refresh\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n}\r\n@if(loading){\r\n<div class=\"loadingContainer\">\r\n <mat-spinner></mat-spinner>\r\n</div>\r\n}\r\n@if(!loading&& !error){\r\n<mat-card>\r\n <mat-nav-list style=\"padding: 0px;\">\r\n @if(!value){\r\n @for (option of workflowOptions; track option.id) {\r\n <mat-list-item (click)=\"bindInput(option)\">\r\n\r\n <mat-chip class=\"docType\" \r\n \r\n [style.background]=\"!option.isCheckInCheckOut && option['isDocument'] ? 'lightskyblue' :option.isCheckInCheckOut?'antiquewhite':'' \"\r\n \r\n matListItemIcon>\r\n <span style=\"font-size: 0.625em;\">\r\n @if (option.isCheckInCheckOut) {\r\n IN/OUT\r\n }@else {\r\n {{ option[\"isDocument\"] ? \"DOC\" : \"FLOW\" }}\r\n }\r\n\r\n </span>\r\n </mat-chip>\r\n\r\n\r\n <div matListItemTitle>\r\n <div>\r\n {{ option.name }}\r\n </div>\r\n\r\n <div style=\"font-size: 0.8125em; opacity: 0.6;line-height:normal\">\r\n {{ option[\"createdAt\"] | date: \"medium\" }} &nbsp;\r\n {{ option.numberOfSteps }}\r\n </div>\r\n </div>\r\n <button matListItemMeta mat-icon-button>\r\n <mat-icon>\r\n radio_button_unchecked\r\n </mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n }\r\n }\r\n @if(value){\r\n <mat-list-item (click)=\" unbindInput() \">\r\n\r\n <mat-chip class=\"docType\" \r\n \r\n [style.background]=\"!selectedWorkflow?.isCheckInCheckOut && selectedWorkflow?.['isDocument'] ? 'lightskyblue' :selectedWorkflow?.isCheckInCheckOut?'antiquewhite':'' \"\r\n matListItemIcon>\r\n <span style=\"font-size: 0.625em;\">\r\n @if (selectedWorkflow?.isCheckInCheckOut) {\r\n IN/OUT\r\n }@else {\r\n {{ selectedWorkflow?.[\"isDocument\"] ? \"DOC\" : \"FLOW\" }}\r\n }\r\n </span>\r\n </mat-chip>\r\n\r\n\r\n <div matListItemTitle>\r\n <div>\r\n {{ selectedWorkflow?.name }}\r\n </div>\r\n\r\n <div style=\"font-size: 0.8125em; opacity: 0.6;line-height:normal\">\r\n {{selectedWorkflow?.[\"createdAt\"] | date: \"medium\" }} &nbsp;\r\n {{ selectedWorkflow?.numberOfSteps }}\r\n </div>\r\n </div>\r\n <button matListItemMeta mat-icon-button>\r\n <mat-icon color=\"primary\">\r\n check_circle\r\n </mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n }\r\n\r\n\r\n </mat-nav-list>\r\n \r\n</mat-card>\r\n\r\n}", styles: [".suggestion-container{display:flex;width:100%;gap:14px}.docType{width:min-content;margin-top:auto!important;margin-bottom:auto!important}mat-card{margin-bottom:8px;background:var(--mat-sys-surface-container, var(--mat-app-surface))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatToolbarModule }, { kind: "component", type: i5.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.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: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.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: "ngmodule", type: MatListModule }, { kind: "component", type: i4.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i4.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i4.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "component", type: i4.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i4.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "directive", type: i4.MatListItemMeta, selector: "[matListItemMeta]" }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i1$2.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i3$2.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i3$3.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
167
+ }
168
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TWorkflowPickerComponent, decorators: [{
169
+ type: Component,
170
+ args: [{ selector: 'lib-t-workflow-picker', imports: [
171
+ CommonModule,
172
+ MatToolbarModule,
173
+ MatButtonModule,
174
+ MatIconModule,
175
+ MatCardModule,
176
+ MatListModule,
177
+ MatChipsModule,
178
+ MatDividerModule,
179
+ MatProgressSpinnerModule,
180
+ ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, providers: [{ provide: MatFormFieldControl, useExisting: TWorkflowPickerComponent }], host: {
181
+ '[attr.id]': 'id',
182
+ '[attr.aria-describedby]': 'describedBy',
183
+ '[class.floating]': 'shouldLabelFloat',
184
+ }, template: "@if (error) {\r\n<mat-toolbar>\r\n <span>\r\n Failed to load workflow list\r\n </span>\r\n <span class=\"spacer\"></span>\r\n <button color=\"primary\" mat-raised-button>\r\n Retry\r\n\r\n </button>\r\n</mat-toolbar>\r\n}@else {\r\n <mat-toolbar>\r\n <span style=\"font-size: x-small;\">\r\n Reload Worlkflows\r\n </span>\r\n <span class=\"spacer\">\r\n\r\n </span>\r\n <button (click)=\"loadWorkflows()\" mat-stroked-button>\r\n Reload \r\n <mat-icon>\r\n refresh\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n}\r\n@if(loading){\r\n<div class=\"loadingContainer\">\r\n <mat-spinner></mat-spinner>\r\n</div>\r\n}\r\n@if(!loading&& !error){\r\n<mat-card>\r\n <mat-nav-list style=\"padding: 0px;\">\r\n @if(!value){\r\n @for (option of workflowOptions; track option.id) {\r\n <mat-list-item (click)=\"bindInput(option)\">\r\n\r\n <mat-chip class=\"docType\" \r\n \r\n [style.background]=\"!option.isCheckInCheckOut && option['isDocument'] ? 'lightskyblue' :option.isCheckInCheckOut?'antiquewhite':'' \"\r\n \r\n matListItemIcon>\r\n <span style=\"font-size: 0.625em;\">\r\n @if (option.isCheckInCheckOut) {\r\n IN/OUT\r\n }@else {\r\n {{ option[\"isDocument\"] ? \"DOC\" : \"FLOW\" }}\r\n }\r\n\r\n </span>\r\n </mat-chip>\r\n\r\n\r\n <div matListItemTitle>\r\n <div>\r\n {{ option.name }}\r\n </div>\r\n\r\n <div style=\"font-size: 0.8125em; opacity: 0.6;line-height:normal\">\r\n {{ option[\"createdAt\"] | date: \"medium\" }} &nbsp;\r\n {{ option.numberOfSteps }}\r\n </div>\r\n </div>\r\n <button matListItemMeta mat-icon-button>\r\n <mat-icon>\r\n radio_button_unchecked\r\n </mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n }\r\n }\r\n @if(value){\r\n <mat-list-item (click)=\" unbindInput() \">\r\n\r\n <mat-chip class=\"docType\" \r\n \r\n [style.background]=\"!selectedWorkflow?.isCheckInCheckOut && selectedWorkflow?.['isDocument'] ? 'lightskyblue' :selectedWorkflow?.isCheckInCheckOut?'antiquewhite':'' \"\r\n matListItemIcon>\r\n <span style=\"font-size: 0.625em;\">\r\n @if (selectedWorkflow?.isCheckInCheckOut) {\r\n IN/OUT\r\n }@else {\r\n {{ selectedWorkflow?.[\"isDocument\"] ? \"DOC\" : \"FLOW\" }}\r\n }\r\n </span>\r\n </mat-chip>\r\n\r\n\r\n <div matListItemTitle>\r\n <div>\r\n {{ selectedWorkflow?.name }}\r\n </div>\r\n\r\n <div style=\"font-size: 0.8125em; opacity: 0.6;line-height:normal\">\r\n {{selectedWorkflow?.[\"createdAt\"] | date: \"medium\" }} &nbsp;\r\n {{ selectedWorkflow?.numberOfSteps }}\r\n </div>\r\n </div>\r\n <button matListItemMeta mat-icon-button>\r\n <mat-icon color=\"primary\">\r\n check_circle\r\n </mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n }\r\n\r\n\r\n </mat-nav-list>\r\n \r\n</mat-card>\r\n\r\n}", styles: [".suggestion-container{display:flex;width:100%;gap:14px}.docType{width:min-content;margin-top:auto!important;margin-bottom:auto!important}mat-card{margin-bottom:8px;background:var(--mat-sys-surface-container, var(--mat-app-surface))}\n"] }]
185
+ }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
186
+ type: Optional
187
+ }, {
188
+ type: Self
189
+ }] }], propDecorators: { disabled: [{
190
+ type: Input
191
+ }], errors: [{
192
+ type: Input
193
+ }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], required: [{
194
+ type: Input
195
+ }], value: [{
196
+ type: Input
197
+ }], placeholder: [{
198
+ type: Input
199
+ }], getWorkflowOptions: [{
200
+ type: Input
201
+ }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }], workflowNameChanged: [{ type: i0.Output, args: ["workflowNameChanged"] }] } });
202
+
203
+ export { TWorkflowPickerComponent };
204
+ //# sourceMappingURL=ngx-t-forms-t-workflow-picker.component-leBokXvM.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-t-workflow-picker.component-leBokXvM.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/t-workflow-picker/t-workflow-picker.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/t-workflow-picker/t-workflow-picker.component.html"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n Input,\r\n OnInit,\r\n Optional,\r\n Self,\r\n ViewEncapsulation,\r\n inject,\r\n output,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\n\r\nimport { IWorkflowOption } from 'ngx-t-forms-types';\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\nimport { catchError, Observable, Subject, take, tap } from 'rxjs';\r\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\r\nimport { NgControl } from '@angular/forms';\r\nimport { MatToolbarModule } from '@angular/material/toolbar';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatCardModule } from '@angular/material/card';\r\nimport { MatListModule } from '@angular/material/list';\r\nimport { MatChipsModule } from '@angular/material/chips';\r\nimport { MatDividerModule } from '@angular/material/divider';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\n\r\n@Component({\r\n selector: 'lib-t-workflow-picker',\r\n imports: [\r\n CommonModule,\r\n MatToolbarModule,\r\n MatButtonModule,\r\n MatIconModule,\r\n MatCardModule,\r\n MatListModule,\r\n MatChipsModule,\r\n MatDividerModule,\r\n MatProgressSpinnerModule,\r\n ],\r\n templateUrl: './t-workflow-picker.component.html',\r\n styleUrl: './t-workflow-picker.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n providers: [{ provide: MatFormFieldControl, useExisting: TWorkflowPickerComponent }],\r\n host: {\r\n '[attr.id]': 'id',\r\n '[attr.aria-describedby]': 'describedBy',\r\n '[class.floating]': 'shouldLabelFloat',\r\n },\r\n})\r\nexport class TWorkflowPickerComponent\r\n implements MatFormFieldControl<string | undefined>, OnInit\r\n{\r\n static nextId = 0;\r\n\r\n readonly stateChanges = new Subject<void>();\r\n focused = false;\r\n touched = false;\r\n @Input() disabled = false;\r\n readonly controlType = 'lib-t-workflow-picker';\r\n readonly autofilled = false;\r\n\r\n @Input() errors: IConfigElementError[] | undefined = [];\r\n readonly valueChange = output<string[] | undefined>();\r\n\r\n private _required = false;\r\n @Input()\r\n get required(): boolean {\r\n return this._required;\r\n }\r\n set required(value: boolean) {\r\n this._required = coerceBooleanProperty(value);\r\n this.stateChanges.next();\r\n }\r\n\r\n private _value: string | undefined = undefined;\r\n @Input()\r\n get value(): string | undefined {\r\n return this._value;\r\n }\r\n set value(val: string | undefined) {\r\n this._value = val;\r\n this.onChange(val);\r\n this.stateChanges.next();\r\n }\r\n\r\n @Input()\r\n get placeholder(): string {\r\n return this._placeholder;\r\n }\r\n set placeholder(value: string) {\r\n this._placeholder = value;\r\n this.stateChanges.next();\r\n }\r\n private _placeholder: string = '';\r\n\r\n readonly id = `lib-t-workflow-picker-${TWorkflowPickerComponent.nextId++}`;\r\n describedBy = '';\r\n get shouldLabelFloat(): boolean {\r\n return this.focused || !this.empty;\r\n }\r\n\r\n get empty(): boolean {\r\n return !this.value || this.value.length === 0;\r\n }\r\n\r\n get errorState(): boolean {\r\n return (\r\n (!this.value && this.required && this.touched) ||\r\n !!this.ngControl?.errors ||\r\n (this.errors || []).length > 0\r\n );\r\n }\r\n\r\n readonly #elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\r\n readonly #destroyRef = inject(DestroyRef);\r\n\r\n constructor(@Optional() @Self() public ngControl: NgControl) {\r\n if (this.ngControl != null) {\r\n this.ngControl.valueAccessor = this;\r\n }\r\n }\r\n\r\n ngOnInit(): void {\r\n this.loadWorkflows();\r\n }\r\n\r\n // ControlValueAccessor methods — Angular's CVA contract accepts any callback signature.\r\n // TODO(Phase-4): revisit once Angular tightens CVA generics upstream.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onChange: (val: any) => void = () => {};\r\n onTouched: () => void = () => {};\r\n\r\n writeValue(value: string | undefined): void {\r\n this._value = value;\r\n this.stateChanges.next();\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n registerOnChange(fn: (val: any) => void): void {\r\n this.onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: () => void): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(isDisabled: boolean): void {\r\n this.disabled = isDisabled;\r\n this.stateChanges.next();\r\n }\r\n\r\n // MatFormFieldControl methods\r\n setDescribedByIds(ids: string[]): void {\r\n const element = this.#elementRef?.nativeElement;\r\n if (element) {\r\n element.setAttribute('aria-describedby', ids.join(' '));\r\n }\r\n }\r\n\r\n onContainerClick(_event: MouseEvent): void {\r\n if (!this.focused) {\r\n this.focused = true;\r\n this.stateChanges.next();\r\n }\r\n }\r\n\r\n markAsTouched(): void {\r\n if (!this.touched) {\r\n this.touched = true;\r\n this.onTouched();\r\n this.stateChanges.next();\r\n }\r\n }\r\n\r\n private _workflowOptions: IWorkflowOption[] | undefined;\r\n protected _getWorkflowOptions: Observable<IWorkflowOption[] | undefined> | undefined;\r\n @Input() set getWorkflowOptions(\r\n value: Observable<IWorkflowOption[] | undefined> | undefined\r\n ) {\r\n this._getWorkflowOptions = value;\r\n }\r\n\r\n readonly valueChanged = output<string | undefined>();\r\n readonly workflowNameChanged = output<string | undefined>();\r\n\r\n protected error: unknown = undefined;\r\n protected loading: boolean = false;\r\n\r\n protected get workflowOptions(): IWorkflowOption[] {\r\n return this._workflowOptions || [];\r\n }\r\n\r\n protected unbindInput(): void {\r\n this.value = undefined;\r\n this.valueChanged.emit(this.value);\r\n this.workflowNameChanged.emit(undefined);\r\n }\r\n\r\n protected bindInput(workflow: IWorkflowOption): void {\r\n this.valueChanged.emit(workflow.id);\r\n this.workflowNameChanged.emit(workflow.name);\r\n }\r\n\r\n protected get selectedWorkflow(): IWorkflowOption | undefined {\r\n return this._workflowOptions?.find((workflow) => workflow.id === this.value);\r\n }\r\n\r\n protected loadWorkflows(): void {\r\n if (!this._getWorkflowOptions) return;\r\n this.loading = true;\r\n this._getWorkflowOptions\r\n ?.pipe(\r\n take(1),\r\n tap(\r\n (workflows) => {\r\n this.error = undefined;\r\n this._workflowOptions = workflows;\r\n this.loading = false;\r\n },\r\n catchError((error) => {\r\n this.loading = false;\r\n this.error = error;\r\n return error;\r\n })\r\n ),\r\n takeUntilDestroyed(this.#destroyRef)\r\n )\r\n .subscribe();\r\n }\r\n}\r\n","@if (error) {\r\n<mat-toolbar>\r\n <span>\r\n Failed to load workflow list\r\n </span>\r\n <span class=\"spacer\"></span>\r\n <button color=\"primary\" mat-raised-button>\r\n Retry\r\n\r\n </button>\r\n</mat-toolbar>\r\n}@else {\r\n <mat-toolbar>\r\n <span style=\"font-size: x-small;\">\r\n Reload Worlkflows\r\n </span>\r\n <span class=\"spacer\">\r\n\r\n </span>\r\n <button (click)=\"loadWorkflows()\" mat-stroked-button>\r\n Reload \r\n <mat-icon>\r\n refresh\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n}\r\n@if(loading){\r\n<div class=\"loadingContainer\">\r\n <mat-spinner></mat-spinner>\r\n</div>\r\n}\r\n@if(!loading&& !error){\r\n<mat-card>\r\n <mat-nav-list style=\"padding: 0px;\">\r\n @if(!value){\r\n @for (option of workflowOptions; track option.id) {\r\n <mat-list-item (click)=\"bindInput(option)\">\r\n\r\n <mat-chip class=\"docType\" \r\n \r\n [style.background]=\"!option.isCheckInCheckOut && option['isDocument'] ? 'lightskyblue' :option.isCheckInCheckOut?'antiquewhite':'' \"\r\n \r\n matListItemIcon>\r\n <span style=\"font-size: 0.625em;\">\r\n @if (option.isCheckInCheckOut) {\r\n IN/OUT\r\n }@else {\r\n {{ option[\"isDocument\"] ? \"DOC\" : \"FLOW\" }}\r\n }\r\n\r\n </span>\r\n </mat-chip>\r\n\r\n\r\n <div matListItemTitle>\r\n <div>\r\n {{ option.name }}\r\n </div>\r\n\r\n <div style=\"font-size: 0.8125em; opacity: 0.6;line-height:normal\">\r\n {{ option[\"createdAt\"] | date: \"medium\" }} &nbsp;\r\n {{ option.numberOfSteps }}\r\n </div>\r\n </div>\r\n <button matListItemMeta mat-icon-button>\r\n <mat-icon>\r\n radio_button_unchecked\r\n </mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n }\r\n }\r\n @if(value){\r\n <mat-list-item (click)=\" unbindInput() \">\r\n\r\n <mat-chip class=\"docType\" \r\n \r\n [style.background]=\"!selectedWorkflow?.isCheckInCheckOut && selectedWorkflow?.['isDocument'] ? 'lightskyblue' :selectedWorkflow?.isCheckInCheckOut?'antiquewhite':'' \"\r\n matListItemIcon>\r\n <span style=\"font-size: 0.625em;\">\r\n @if (selectedWorkflow?.isCheckInCheckOut) {\r\n IN/OUT\r\n }@else {\r\n {{ selectedWorkflow?.[\"isDocument\"] ? \"DOC\" : \"FLOW\" }}\r\n }\r\n </span>\r\n </mat-chip>\r\n\r\n\r\n <div matListItemTitle>\r\n <div>\r\n {{ selectedWorkflow?.name }}\r\n </div>\r\n\r\n <div style=\"font-size: 0.8125em; opacity: 0.6;line-height:normal\">\r\n {{selectedWorkflow?.[\"createdAt\"] | date: \"medium\" }} &nbsp;\r\n {{ selectedWorkflow?.numberOfSteps }}\r\n </div>\r\n </div>\r\n <button matListItemMeta mat-icon-button>\r\n <mat-icon color=\"primary\">\r\n check_circle\r\n </mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n }\r\n\r\n\r\n </mat-nav-list>\r\n \r\n</mat-card>\r\n\r\n}"],"names":["i2","i3","i4","i5","i6","i7","i8","i9"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;MAuDa,wBAAwB,CAAA;aAG5B,IAAA,CAAA,MAAM,GAAG,CAAH,CAAK;AAalB,IAAA,IACI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,SAAS;IACvB;IACA,IAAI,QAAQ,CAAC,KAAc,EAAA;AACzB,QAAA,IAAI,CAAC,SAAS,GAAG,qBAAqB,CAAC,KAAK,CAAC;AAC7C,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;IAC1B;AAGA,IAAA,IACI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,MAAM;IACpB;IACA,IAAI,KAAK,CAAC,GAAuB,EAAA;AAC/B,QAAA,IAAI,CAAC,MAAM,GAAG,GAAG;AACjB,QAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;AAClB,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;IAC1B;AAEA,IAAA,IACI,WAAW,GAAA;QACb,OAAO,IAAI,CAAC,YAAY;IAC1B;IACA,IAAI,WAAW,CAAC,KAAa,EAAA;AAC3B,QAAA,IAAI,CAAC,YAAY,GAAG,KAAK;AACzB,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;IAC1B;AAKA,IAAA,IAAI,gBAAgB,GAAA;QAClB,OAAO,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK;IACpC;AAEA,I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component, output, computed } from '@angular/core';
3
+ import * as i1 from '@angular/forms';
4
+ import { NgControl, ReactiveFormsModule } from '@angular/forms';
5
+ import * as i2$1 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 i1$1 from '@angular/material/button';
10
+ import { MatButtonModule } from '@angular/material/button';
11
+ import * as i5 from '@angular/material/tooltip';
12
+ import { MatTooltipModule } from '@angular/material/tooltip';
13
+ import { B as BaseCustomInput, m as getInputErrorMessage, n as TFormInputStatusComponent } from './ngx-t-forms-ngx-t-forms-u_kigDid.mjs';
14
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
15
+ import * as i2 from '@angular/material/input';
16
+ import { MatInputModule } from '@angular/material/input';
17
+ import { Subject, debounceTime } from 'rxjs';
18
+
19
+ const customInputConfig = {
20
+ controlType: 'lib-text-area-reactive-input',
21
+ nextId: 0,
22
+ };
23
+ class TextAreaReactiveInputComponent extends BaseCustomInput {
24
+ get empty() {
25
+ const n = this.value;
26
+ // Check for null, undefined, or empty string, but allow 0
27
+ return n === null || n === undefined || n === '';
28
+ }
29
+ get shouldLabelFloat() {
30
+ return true;
31
+ }
32
+ #destroyRef;
33
+ #debounceTime;
34
+ #valueSubject;
35
+ constructor() {
36
+ super(inject(NgControl, { self: true, optional: true }), inject(ElementRef), customInputConfig);
37
+ this.auto = input(undefined, ...(ngDevMode ? [{ debugName: "auto" }] : /* istanbul ignore next */ []));
38
+ this.inputConfig = input.required(...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
39
+ this.#destroyRef = inject(DestroyRef);
40
+ this.#debounceTime = 300;
41
+ this.#valueSubject = new Subject();
42
+ }
43
+ ngOnInit() {
44
+ this.#valueSubject
45
+ .pipe(debounceTime(this.#debounceTime), takeUntilDestroyed(this.#destroyRef))
46
+ .subscribe(event => {
47
+ const target = event.target;
48
+ this.value = target.value;
49
+ this.stateChanges.next();
50
+ this.onChange(this.value);
51
+ });
52
+ }
53
+ onInputChange($event) {
54
+ this.#valueSubject.next($event);
55
+ }
56
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TextAreaReactiveInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
57
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: TextAreaReactiveInputComponent, isStandalone: true, selector: "lib-text-area-reactive-input", inputs: { auto: { classPropertyName: "auto", publicName: "auto", isSignal: true, isRequired: false, transformFunction: null }, inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.floating": "shouldLabelFloat", "id": "id" } }, providers: [{ provide: MatFormFieldControl, useExisting: TextAreaReactiveInputComponent }], usesInheritance: true, ngImport: i0, template: "\r\n<textarea\r\n [readonly]=\"inputConfig().readonly\"\r\n [required]=\"inputConfig().required\"\r\n [attr.maxlength]=\"inputConfig().maxLength\" [attr.minlength]=\"inputConfig().minLength\"\r\n [rows]=\"inputConfig().rows\" [spellcheck]=\"inputConfig().spellcheck\"\r\n [value]=\"value\"\r\n [autocapitalize]=\"inputConfig().autocapitalize\" [autocomplete]=\"inputConfig().autocomplete\"\r\n (input)=\"onInputChange($event)\"\r\n [placeholder]=\"inputConfig().placeholder||''\" [wrap]=\"inputConfig().wrap\" matInput></textarea>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
58
+ }
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TextAreaReactiveInputComponent, decorators: [{
60
+ type: Component,
61
+ args: [{ selector: 'lib-text-area-reactive-input', imports: [
62
+ ReactiveFormsModule,
63
+ MatInputModule,
64
+ ], host: {
65
+ '[class.floating]': 'shouldLabelFloat',
66
+ '[id]': 'id',
67
+ }, providers: [{ provide: MatFormFieldControl, useExisting: TextAreaReactiveInputComponent }], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, template: "\r\n<textarea\r\n [readonly]=\"inputConfig().readonly\"\r\n [required]=\"inputConfig().required\"\r\n [attr.maxlength]=\"inputConfig().maxLength\" [attr.minlength]=\"inputConfig().minLength\"\r\n [rows]=\"inputConfig().rows\" [spellcheck]=\"inputConfig().spellcheck\"\r\n [value]=\"value\"\r\n [autocapitalize]=\"inputConfig().autocapitalize\" [autocomplete]=\"inputConfig().autocomplete\"\r\n (input)=\"onInputChange($event)\"\r\n [placeholder]=\"inputConfig().placeholder||''\" [wrap]=\"inputConfig().wrap\" matInput></textarea>\r\n" }]
68
+ }], ctorParameters: () => [], propDecorators: { auto: [{ type: i0.Input, args: [{ isSignal: true, alias: "auto", required: false }] }], inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }] } });
69
+
70
+ /** Wraps a reactive textarea control inside a `mat-form-field`. */
71
+ class TextareaInputElementComponent {
72
+ constructor() {
73
+ this.inputConfig = input.required(...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
74
+ this.formGroup = input.required(...(ngDevMode ? [{ debugName: "formGroup" }] : /* istanbul ignore next */ []));
75
+ this.reload = output();
76
+ this.errorMessage = computed(() => getInputErrorMessage(this.inputConfig(), this.formGroup()), ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
77
+ }
78
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TextareaInputElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
79
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: TextareaInputElementComponent, isStandalone: true, selector: "lib-textarea-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 } }, outputs: { reload: "reload" }, ngImport: i0, template: "<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\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 <lib-text-area-reactive-input\r\n [inputConfig]=\"inputConfig\"\r\n [required]=\"inputConfig.required\"\r\n [formControlName]=\"inputConfig.id\"\r\n ></lib-text-area-reactive-input>\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 style=\"margin-right: 4px;\"\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 style=\"color: var(--mat-sys-primary)\">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 matPrefix style=\"top: 0\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding-left: 5px\">{{ 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: ["mat-form-field{width:100%!important}mat-form-field .input-sync-button{display:none}mat-form-field:hover .input-sync-button{display:inline-block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.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: i1$1.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.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: TextAreaReactiveInputComponent, selector: "lib-text-area-reactive-input", inputs: ["auto", "inputConfig"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
80
+ }
81
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TextareaInputElementComponent, decorators: [{
82
+ type: Component,
83
+ args: [{ selector: 'lib-textarea-input-element', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
84
+ ReactiveFormsModule,
85
+ MatFormFieldModule,
86
+ MatIconModule,
87
+ MatButtonModule,
88
+ MatTooltipModule,
89
+ TFormInputStatusComponent,
90
+ TextAreaReactiveInputComponent,
91
+ ], template: "<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\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 <lib-text-area-reactive-input\r\n [inputConfig]=\"inputConfig\"\r\n [required]=\"inputConfig.required\"\r\n [formControlName]=\"inputConfig.id\"\r\n ></lib-text-area-reactive-input>\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 style=\"margin-right: 4px;\"\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 style=\"color: var(--mat-sys-primary)\">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 matPrefix style=\"top: 0\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding-left: 5px\">{{ 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: ["mat-form-field{width:100%!important}mat-form-field .input-sync-button{display:none}mat-form-field:hover .input-sync-button{display:inline-block}\n"] }]
92
+ }], propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: true }] }], reload: [{ type: i0.Output, args: ["reload"] }] } });
93
+
94
+ export { TextareaInputElementComponent };
95
+ //# sourceMappingURL=ngx-t-forms-textarea-input-element.component-BEbXJjFA.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-textarea-input-element.component-BEbXJjFA.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/textarea-input-element/core/text-area-reactive-input/text-area-reactive-input.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/textarea-input-element/core/text-area-reactive-input/text-area-reactive-input.component.html","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/textarea-input-element/textarea-input-element.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/textarea-input-element/textarea-input-element.component.html"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n OnInit,\r\n ViewEncapsulation,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { NgControl, ReactiveFormsModule } from '@angular/forms';\r\nimport { BaseCustomInput, BaseCustomInputConfig } from '../../../../../../services/core/t-input-controller/functions/baseCustomInput';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { MatAutocomplete } from '@angular/material/autocomplete';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { Subject, debounceTime } from 'rxjs';\r\n\r\nconst customInputConfig: BaseCustomInputConfig = {\r\n controlType: 'lib-text-area-reactive-input',\r\n nextId: 0,\r\n};\r\n\r\n@Component({\r\n selector: 'lib-text-area-reactive-input',\r\n imports: [\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n ],\r\n host: {\r\n '[class.floating]': 'shouldLabelFloat',\r\n '[id]': 'id',\r\n },\r\n providers: [{ provide: MatFormFieldControl, useExisting: TextAreaReactiveInputComponent }],\r\n templateUrl: './text-area-reactive-input.component.html',\r\n styleUrl: './text-area-reactive-input.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n})\r\nexport class TextAreaReactiveInputComponent extends BaseCustomInput<string | number | Date> implements OnInit {\r\n override get empty(): boolean {\r\n const n = this.value;\r\n // Check for null, undefined, or empty string, but allow 0\r\n return n === null || n === undefined || (n as unknown) === '';\r\n }\r\n\r\n override get shouldLabelFloat(): boolean {\r\n return true;\r\n }\r\n\r\n readonly auto = input<MatAutocomplete | undefined>(undefined);\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n\r\n readonly #destroyRef = inject(DestroyRef);\r\n readonly #debounceTime = 300;\r\n readonly #valueSubject = new Subject<Event>();\r\n\r\n constructor() {\r\n super(\r\n inject(NgControl, { self: true, optional: true }) as NgControl,\r\n inject<ElementRef<HTMLElement>>(ElementRef),\r\n customInputConfig,\r\n );\r\n }\r\n\r\n ngOnInit(): void {\r\n this.#valueSubject\r\n .pipe(\r\n debounceTime(this.#debounceTime),\r\n takeUntilDestroyed(this.#destroyRef),\r\n )\r\n .subscribe(event => {\r\n const target = event.target as HTMLTextAreaElement;\r\n this.value = target.value;\r\n this.stateChanges.next();\r\n this.onChange(this.value);\r\n });\r\n }\r\n\r\n protected onInputChange($event: Event): void {\r\n this.#valueSubject.next($event);\r\n }\r\n}\r\n","\r\n<textarea\r\n [readonly]=\"inputConfig().readonly\"\r\n [required]=\"inputConfig().required\"\r\n [attr.maxlength]=\"inputConfig().maxLength\" [attr.minlength]=\"inputConfig().minLength\"\r\n [rows]=\"inputConfig().rows\" [spellcheck]=\"inputConfig().spellcheck\"\r\n [value]=\"value\"\r\n [autocapitalize]=\"inputConfig().autocapitalize\" [autocomplete]=\"inputConfig().autocomplete\"\r\n (input)=\"onInputChange($event)\"\r\n [placeholder]=\"inputConfig().placeholder||''\" [wrap]=\"inputConfig().wrap\" matInput></textarea>\r\n","import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\r\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport type { ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { TFormInputStatusComponent } from '../../../t-form-input-status/t-form-input-status.component';\r\nimport { TextAreaReactiveInputComponent } from './core/text-area-reactive-input/text-area-reactive-input.component';\r\nimport { getInputErrorMessage } from '../../../../services/core/t-input-controller/functions/inputErrorMessage';\r\n\r\n/** Wraps a reactive textarea control inside a `mat-form-field`. */\r\n@Component({\r\n selector: 'lib-textarea-input-element',\r\n templateUrl: './textarea-input-element.component.html',\r\n styleUrl: './textarea-input-element.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n ReactiveFormsModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatButtonModule,\r\n MatTooltipModule,\r\n TFormInputStatusComponent,\r\n TextAreaReactiveInputComponent,\r\n ],\r\n})\r\nexport class TextareaInputElementComponent {\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n readonly formGroup = input.required<FormGroup>();\r\n readonly reload = output<void>();\r\n\r\n protected readonly errorMessage = computed(() =>\r\n getInputErrorMessage(this.inputConfig(), this.formGroup()),\r\n );\r\n}\r\n","<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\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 <lib-text-area-reactive-input\r\n [inputConfig]=\"inputConfig\"\r\n [required]=\"inputConfig.required\"\r\n [formControlName]=\"inputConfig.id\"\r\n ></lib-text-area-reactive-input>\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 style=\"margin-right: 4px;\"\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 style=\"color: var(--mat-sys-primary)\">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 matPrefix style=\"top: 0\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding-left: 5px\">{{ 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"],"names":["i1","i2","i4"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,MAAM,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;AAC/B,qBAAA,EAAA,QAAA,EAAA,ssEAAA,EAAA,MAAA,EAAA,CAAA,oJAAA,CAAA,EAAA;;;;;"}
@@ -0,0 +1,82 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, ElementRef, input, ChangeDetectionStrategy, Component, output, computed } from '@angular/core';
3
+ import * as i1$1 from '@angular/forms';
4
+ import { NgControl, ReactiveFormsModule } from '@angular/forms';
5
+ import * as i2$1 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 i1$2 from '@angular/material/button';
10
+ import { MatButtonModule } from '@angular/material/button';
11
+ import * as i5 from '@angular/material/tooltip';
12
+ import { MatTooltipModule } from '@angular/material/tooltip';
13
+ import { B as BaseCustomInput, m as getInputErrorMessage, n as TFormInputStatusComponent } from './ngx-t-forms-ngx-t-forms-u_kigDid.mjs';
14
+ import * as i1 from '@angular/material/slide-toggle';
15
+ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
16
+ import * as i2 from '@angular/cdk/overlay';
17
+ import { OverlayModule } from '@angular/cdk/overlay';
18
+ import { TitleCasePipe } from '@angular/common';
19
+
20
+ const customInputConfig = {
21
+ controlType: 'lib-toggle',
22
+ nextId: 0
23
+ };
24
+ class ToggleComponent extends BaseCustomInput {
25
+ constructor() {
26
+ super(inject(NgControl, { optional: true, self: true }), inject(ElementRef), customInputConfig);
27
+ this.inputConfig = input.required(...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
28
+ }
29
+ get empty() {
30
+ return !this.value;
31
+ }
32
+ get shouldLabelFloat() {
33
+ return this.focused || !this.empty;
34
+ }
35
+ changed(event) {
36
+ this.value = event.checked;
37
+ this.onChange(event.checked);
38
+ this.stateChanges.next();
39
+ }
40
+ get isChecked() {
41
+ return Boolean(this.value);
42
+ }
43
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
44
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: ToggleComponent, isStandalone: true, selector: "lib-toggle", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null } }, providers: [{ provide: MatFormFieldControl, useExisting: ToggleComponent }], usesInheritance: true, ngImport: i0, template: "<ng-template\r\n cdkConnectedOverlay\r\n [cdkConnectedOverlayOpen]=\"!!(inputConfig().disabled || inputConfig().readonly)\"\r\n>\r\n <div style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.1);\">\r\n </div>\r\n</ng-template>\r\n\r\n<mat-slide-toggle\r\n style=\"display: block\"\r\n [disabledInteractive]=\"inputConfig().disabled || inputConfig().readonly\"\r\n [required]=\"inputConfig().required\"\r\n [labelPosition]=\"inputConfig().labelPosition || 'after'\"\r\n (change)=\"changed($event)\"\r\n [checked]=\"isChecked\"\r\n [ariaReadOnly]=\"inputConfig().disabled\"\r\n [disabled]=\"inputConfig().disabled\"\r\n>\r\n @if (inputConfig().falseLabel || inputConfig().trueLabel) {\r\n @if (inputConfig().labelPosition !== 'after') {\r\n {{ inputConfig().label | titlecase }}\r\n <span class=\"spacer\"></span>\r\n @if (isChecked) {\r\n <span class=\"true-label\">{{ inputConfig().trueLabel || 'Yes' }}</span>\r\n } @else {\r\n <span class=\"false-label\">{{ inputConfig().falseLabel || 'No' }}</span>\r\n }\r\n } @else {\r\n @if (isChecked) {\r\n <span class=\"true-label\">{{ inputConfig().trueLabel || 'Yes' }}</span>\r\n } @else {\r\n <span class=\"false-label\">{{ inputConfig().falseLabel || 'No' }}</span>\r\n }\r\n <span class=\"spacer\"></span>\r\n {{ inputConfig().label | titlecase }}\r\n }\r\n }\r\n</mat-slide-toggle>\r\n", styles: [".false-label{font-weight:500;color:var(--mat-sys-error)!important}.true-label{font-weight:500;color:var(--mat-sys-primary)!important}.spacer{width:16px;display:inline-block}\n"], dependencies: [{ kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i2.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
45
+ }
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ToggleComponent, decorators: [{
47
+ type: Component,
48
+ args: [{ selector: 'lib-toggle', imports: [MatSlideToggleModule, OverlayModule, TitleCasePipe], providers: [{ provide: MatFormFieldControl, useExisting: ToggleComponent }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template\r\n cdkConnectedOverlay\r\n [cdkConnectedOverlayOpen]=\"!!(inputConfig().disabled || inputConfig().readonly)\"\r\n>\r\n <div style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.1);\">\r\n </div>\r\n</ng-template>\r\n\r\n<mat-slide-toggle\r\n style=\"display: block\"\r\n [disabledInteractive]=\"inputConfig().disabled || inputConfig().readonly\"\r\n [required]=\"inputConfig().required\"\r\n [labelPosition]=\"inputConfig().labelPosition || 'after'\"\r\n (change)=\"changed($event)\"\r\n [checked]=\"isChecked\"\r\n [ariaReadOnly]=\"inputConfig().disabled\"\r\n [disabled]=\"inputConfig().disabled\"\r\n>\r\n @if (inputConfig().falseLabel || inputConfig().trueLabel) {\r\n @if (inputConfig().labelPosition !== 'after') {\r\n {{ inputConfig().label | titlecase }}\r\n <span class=\"spacer\"></span>\r\n @if (isChecked) {\r\n <span class=\"true-label\">{{ inputConfig().trueLabel || 'Yes' }}</span>\r\n } @else {\r\n <span class=\"false-label\">{{ inputConfig().falseLabel || 'No' }}</span>\r\n }\r\n } @else {\r\n @if (isChecked) {\r\n <span class=\"true-label\">{{ inputConfig().trueLabel || 'Yes' }}</span>\r\n } @else {\r\n <span class=\"false-label\">{{ inputConfig().falseLabel || 'No' }}</span>\r\n }\r\n <span class=\"spacer\"></span>\r\n {{ inputConfig().label | titlecase }}\r\n }\r\n }\r\n</mat-slide-toggle>\r\n", styles: [".false-label{font-weight:500;color:var(--mat-sys-error)!important}.true-label{font-weight:500;color:var(--mat-sys-primary)!important}.spacer{width:16px;display:inline-block}\n"] }]
49
+ }], ctorParameters: () => [], propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }] } });
50
+
51
+ /**
52
+ * Wraps `lib-toggle` in a `mat-form-field` and surfaces the configured
53
+ * label / hint / error / suffix / prefix metadata for the column.
54
+ */
55
+ class ToggleInputElementComponent {
56
+ constructor() {
57
+ /** Form-input column definition. */
58
+ this.inputConfig = input.required(...(ngDevMode ? [{ debugName: "inputConfig" }] : /* istanbul ignore next */ []));
59
+ /** Reactive form group hosting the control identified by `inputConfig.id`. */
60
+ this.formGroup = input.required(...(ngDevMode ? [{ debugName: "formGroup" }] : /* istanbul ignore next */ []));
61
+ /** Emitted when the consumer requests a reload of this input. */
62
+ this.reload = output();
63
+ this.errorMessage = computed(() => getInputErrorMessage(this.inputConfig(), this.formGroup()), ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
64
+ }
65
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ToggleInputElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
66
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: ToggleInputElementComponent, isStandalone: true, selector: "lib-toggle-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 } }, outputs: { reload: "reload" }, ngImport: i0, template: "<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field\r\n [appearance]=\"inputConfig.appearance || 'fill'\"\r\n floatLabel=\"always\"\r\n subscriptSizing=\"dynamic\"\r\n >\r\n @if (!(inputConfig.disabled || errorMessage())) {\r\n <mat-label>\r\n toggle to select\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n }\r\n\r\n <lib-toggle\r\n [inputConfig]=\"inputConfig\"\r\n [required]=\"inputConfig.required\"\r\n [formControlName]=\"inputConfig.id\"\r\n ></lib-toggle>\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 style=\"margin-right: 4px;\"\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 style=\"color: var(--mat-sys-primary)\">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 matPrefix style=\"top: 0\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding-left: 5px\">{{ 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: ["mat-form-field{width:100%!important}mat-form-field .input-sync-button{display:none}mat-form-field:hover .input-sync-button{display:inline-block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2$1.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: i1$2.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.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: ToggleComponent, selector: "lib-toggle", inputs: ["inputConfig"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
67
+ }
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ToggleInputElementComponent, decorators: [{
69
+ type: Component,
70
+ args: [{ selector: 'lib-toggle-input-element', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
71
+ ReactiveFormsModule,
72
+ MatFormFieldModule,
73
+ MatIconModule,
74
+ MatButtonModule,
75
+ MatTooltipModule,
76
+ TFormInputStatusComponent,
77
+ ToggleComponent,
78
+ ], template: "<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field\r\n [appearance]=\"inputConfig.appearance || 'fill'\"\r\n floatLabel=\"always\"\r\n subscriptSizing=\"dynamic\"\r\n >\r\n @if (!(inputConfig.disabled || errorMessage())) {\r\n <mat-label>\r\n toggle to select\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n }\r\n\r\n <lib-toggle\r\n [inputConfig]=\"inputConfig\"\r\n [required]=\"inputConfig.required\"\r\n [formControlName]=\"inputConfig.id\"\r\n ></lib-toggle>\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 style=\"margin-right: 4px;\"\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 style=\"color: var(--mat-sys-primary)\">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 matPrefix style=\"top: 0\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding-left: 5px\">{{ 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: ["mat-form-field{width:100%!important}mat-form-field .input-sync-button{display:none}mat-form-field:hover .input-sync-button{display:inline-block}\n"] }]
79
+ }], propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: true }] }], reload: [{ type: i0.Output, args: ["reload"] }] } });
80
+
81
+ export { ToggleInputElementComponent };
82
+ //# sourceMappingURL=ngx-t-forms-toggle-input-element.component-DDErRUJd.mjs.map