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,66 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, input, output, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import * as i1 from '@angular/material/chips';
4
+ import { MatChipsModule } from '@angular/material/chips';
5
+ import { S as SearchFieldComponent } from './ngx-t-forms-search-field.component-B2ZO7lqO.mjs';
6
+ import { E as EmptyStateComponent } from './ngx-t-forms-ngx-t-forms-u_kigDid.mjs';
7
+
8
+ /**
9
+ * Chip-select editor: a searchable {@link MatChipsModule} listbox over a set of
10
+ * options, single- or multi-select. Renders inside `t-dynamic-data-edit`, which
11
+ * supplies the field label, hint, and validation errors — so this component owns
12
+ * only the search + chip content.
13
+ */
14
+ class MatChipListEditorComponent {
15
+ constructor() {
16
+ this.hostId = signal(`lib-mat-chip-list-editor-${MatChipListEditorComponent.nextId++}`, ...(ngDevMode ? [{ debugName: "hostId" }] : /* istanbul ignore next */ []));
17
+ this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
18
+ this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
19
+ this.required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
20
+ this.errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
21
+ // Internal `any` retained — wrapper templates bind heterogeneous value types
22
+ // (DataSources, string[], etc.); narrowing here would force wrapper changes.
23
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- wrappers bind heterogeneous chip-value payloads (DataSources, string[]).
24
+ this.value = input(undefined, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
25
+ this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
26
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- emits whatever shape `value` was bound to; narrows once wrappers tighten.
27
+ this.valueChange = output();
28
+ /** Free-text search term (two-way bound to the search field). */
29
+ this.search = signal('', ...(ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []));
30
+ /**
31
+ * Options matching the search term. Matches the visible label, the group, and
32
+ * a string value (the same reachable-string-leaf semantics the old
33
+ * `searchList` pipe applied, minus its now-removed nested-object scan).
34
+ */
35
+ this.filteredOptions = computed(() => {
36
+ const term = this.search().trim().toLowerCase();
37
+ const all = this.options() ?? [];
38
+ if (!term)
39
+ return all;
40
+ return all.filter((option) => {
41
+ const haystacks = [
42
+ option.label,
43
+ option.group,
44
+ typeof option.value === 'string' ? option.value : undefined,
45
+ ];
46
+ return haystacks.some((text) => typeof text === 'string' && text.toLowerCase().includes(term));
47
+ });
48
+ }, ...(ngDevMode ? [{ debugName: "filteredOptions" }] : /* istanbul ignore next */ []));
49
+ }
50
+ static { this.nextId = 0; }
51
+ valueListChanged($event) {
52
+ this.valueChange.emit($event.value);
53
+ }
54
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MatChipListEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
55
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MatChipListEditorComponent, isStandalone: true, selector: "lib-mat-chip-list-editor", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { properties: { "id": "hostId()" }, classAttribute: "lib-mat-chip-list-editor" }, ngImport: i0, template: "<lib-search-field\n [(value)]=\"search\"\n placeholder=\"Search options\"\n [resultCount]=\"filteredOptions().length\" />\n\n@if (filteredOptions().length) {\n<mat-chip-listbox\n class=\"lib-mat-chip-list-editor__listbox\"\n [multiple]=\"multiple()\"\n [value]=\"value()\"\n [disabled]=\"disabled()\"\n (change)=\"valueListChanged($event)\"\n aria-label=\"Chip select options\">\n @for (option of filteredOptions(); track option.value) {\n <mat-chip-option [value]=\"option.value\">{{ option.label }}</mat-chip-option>\n }\n</mat-chip-listbox>\n} @else {\n<lib-empty-state\n icon=\"search_off\"\n [message]=\"(options() || []).length ? 'No options match your search' : 'No options available'\" />\n}\n", styles: [":host{display:flex;flex-direction:column;gap:.75rem}.lib-mat-chip-list-editor__listbox{max-height:500px;overflow-y:auto}\n"], dependencies: [{ kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i1.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i1.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "component", type: SearchFieldComponent, selector: "lib-search-field", inputs: ["value", "placeholder", "resultCount"], outputs: ["valueChange"] }, { kind: "component", type: EmptyStateComponent, selector: "lib-empty-state", inputs: ["icon", "message"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
56
+ }
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MatChipListEditorComponent, decorators: [{
58
+ type: Component,
59
+ args: [{ selector: 'lib-mat-chip-list-editor', imports: [MatChipsModule, SearchFieldComponent, EmptyStateComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
60
+ 'class': 'lib-mat-chip-list-editor',
61
+ '[id]': 'hostId()',
62
+ }, template: "<lib-search-field\n [(value)]=\"search\"\n placeholder=\"Search options\"\n [resultCount]=\"filteredOptions().length\" />\n\n@if (filteredOptions().length) {\n<mat-chip-listbox\n class=\"lib-mat-chip-list-editor__listbox\"\n [multiple]=\"multiple()\"\n [value]=\"value()\"\n [disabled]=\"disabled()\"\n (change)=\"valueListChanged($event)\"\n aria-label=\"Chip select options\">\n @for (option of filteredOptions(); track option.value) {\n <mat-chip-option [value]=\"option.value\">{{ option.label }}</mat-chip-option>\n }\n</mat-chip-listbox>\n} @else {\n<lib-empty-state\n icon=\"search_off\"\n [message]=\"(options() || []).length ? 'No options match your search' : 'No options available'\" />\n}\n", styles: [":host{display:flex;flex-direction:column;gap:.75rem}.lib-mat-chip-list-editor__listbox{max-height:500px;overflow-y:auto}\n"] }]
63
+ }], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
64
+
65
+ export { MatChipListEditorComponent };
66
+ //# sourceMappingURL=ngx-t-forms-mat-chip-list-editor.component-c7uZT1sr.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-mat-chip-list-editor.component-c7uZT1sr.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-editor.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { MatChipListboxChange, MatChipsModule } from '@angular/material/chips';\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\nimport { SearchFieldComponent } from '../_shared/search-field/search-field.component';\nimport { EmptyStateComponent } from '../_shared/empty-state/empty-state.component';\n\ninterface ChipOption {\n label: string;\n value: unknown;\n group?: string;\n}\n\n/**\n * Chip-select editor: a searchable {@link MatChipsModule} listbox over a set of\n * options, single- or multi-select. Renders inside `t-dynamic-data-edit`, which\n * supplies the field label, hint, and validation errors — so this component owns\n * only the search + chip content.\n */\n@Component({\n selector: 'lib-mat-chip-list-editor',\n imports: [MatChipsModule, SearchFieldComponent, EmptyStateComponent],\n templateUrl: './mat-chip-list-editor.component.html',\n styleUrl: './mat-chip-list-editor.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n 'class': 'lib-mat-chip-list-editor',\n '[id]': 'hostId()',\n },\n})\nexport class MatChipListEditorComponent {\n static nextId = 0;\n\n protected readonly hostId = signal<string>(\n `lib-mat-chip-list-editor-${MatChipListEditorComponent.nextId++}`,\n );\n\n readonly disabled = input<boolean>(false);\n readonly multiple = input<boolean>(false);\n readonly required = input<boolean>(false);\n readonly errors = input<IConfigElementError[] | undefined>([]);\n // Internal `any` retained — wrapper templates bind heterogeneous value types\n // (DataSources, string[], etc.); narrowing here would force wrapper changes.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- wrappers bind heterogeneous chip-value payloads (DataSources, string[]).\n readonly value = input<any>(undefined);\n readonly options = input<ChipOption[] | undefined>([]);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- emits whatever shape `value` was bound to; narrows once wrappers tighten.\n readonly valueChange = output<any>();\n\n /** Free-text search term (two-way bound to the search field). */\n protected readonly search = signal<string>('');\n\n /**\n * Options matching the search term. Matches the visible label, the group, and\n * a string value (the same reachable-string-leaf semantics the old\n * `searchList` pipe applied, minus its now-removed nested-object scan).\n */\n protected readonly filteredOptions = computed<ChipOption[]>(() => {\n const term = this.search().trim().toLowerCase();\n const all = this.options() ?? [];\n if (!term) return all;\n return all.filter((option) => {\n const haystacks = [\n option.label,\n option.group,\n typeof option.value === 'string' ? option.value : undefined,\n ];\n return haystacks.some(\n (text): text is string => typeof text === 'string' && text.toLowerCase().includes(term),\n );\n });\n });\n\n protected valueListChanged($event: MatChipListboxChange): void {\n this.valueChange.emit($event.value);\n }\n}\n","<lib-search-field\n [(value)]=\"search\"\n placeholder=\"Search options\"\n [resultCount]=\"filteredOptions().length\" />\n\n@if (filteredOptions().length) {\n<mat-chip-listbox\n class=\"lib-mat-chip-list-editor__listbox\"\n [multiple]=\"multiple()\"\n [value]=\"value()\"\n [disabled]=\"disabled()\"\n (change)=\"valueListChanged($event)\"\n aria-label=\"Chip select options\">\n @for (option of filteredOptions(); track option.value) {\n <mat-chip-option [value]=\"option.value\">{{ option.label }}</mat-chip-option>\n }\n</mat-chip-listbox>\n} @else {\n<lib-empty-state\n icon=\"search_off\"\n [message]=\"(options() || []).length ? 'No options match your search' : 'No options available'\" />\n}\n"],"names":[],"mappings":";;;;;;;AAoBA;;;;;AAKG;MAaU,0BAA0B,CAAA;AAZvC,IAAA,WAAA,GAAA;QAeqB,IAAA,CAAA,MAAM,GAAG,MAAM,CAChC,CAAA,yBAAA,EAA4B,0BAA0B,CAAC,MAAM,EAAE,CAAA,CAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAClE;AAEQ,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;AAChC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;AAChC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;AAChC,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAoC,EAAE,6EAAC;;;;AAIrD,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAM,SAAS,4EAAC;AAC7B,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAA2B,EAAE,8EAAC;;QAG7C,IAAA,CAAA,WAAW,GAAG,MAAM,EAAO;;AAGjB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAS,EAAE,6EAAC;AAE9C;;;;AAIG;AACgB,QAAA,IAAA,CAAA,eAAe,GAAG,QAAQ,CAAe,MAAK;AAC/D,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;YAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE;AAChC,YAAA,IAAI,CAA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CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,oFAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,oBAAoB,wIAAE,mBAAmB,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAUxD,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAZtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,0BAA0B,WAC3B,CAAC,cAAc,EAAE,oBAAoB,EAAE,mBAAmB,CAAC,EAAA,eAAA,EAGnD,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EACnC;AACJ,wBAAA,OAAO,EAAE,0BAA0B;AACnC,wBAAA,MAAM,EAAE,UAAU;AACnB,qBAAA,EAAA,QAAA,EAAA,6sBAAA,EAAA,MAAA,EAAA,CAAA,4HAAA,CAAA,EAAA;;;;;"}
@@ -0,0 +1,211 @@
1
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { NgControl } from '@angular/forms';
5
+ import { MatFormFieldControl } from '@angular/material/form-field';
6
+ import * as i1 from '@angular/material/slider';
7
+ import { MatSliderModule } from '@angular/material/slider';
8
+ import { Subject } from 'rxjs';
9
+
10
+ /**
11
+ * Internal Material slider editor implementing `MatFormFieldControl<number>`
12
+ * for the dynamic-data-edit configuration surface.
13
+ *
14
+ * Rendered by `t-dynamic-data-edit`, which supplies the surrounding field label,
15
+ * hint, and validation errors — so this component owns only the slider track,
16
+ * the live value readout, and the min/max bound labels.
17
+ *
18
+ * NOTE: `MatFormFieldControl<T>` mandates plain mutable `value` / `disabled` /
19
+ * `required` / `placeholder` / `id` members, `@Input()` decorators, the
20
+ * `focused` / `touched` / `stateChanges` members, and the `useExisting`
21
+ * provider. These are framework wiring, not defects — the CLAUDE.md bans on
22
+ * `@Input()` / `useExisting` do not apply to MatFormFieldControl integration.
23
+ */
24
+ class MatSliderEditorComponent {
25
+ constructor() {
26
+ /** Emits whenever a piece of `MatFormFieldControl` state changes. */
27
+ this.stateChanges = new Subject();
28
+ this.controlType = 'lib-mat-slider-editor';
29
+ this.id = `lib-mat-slider-editor-${MatSliderEditorComponent.nextId++}`;
30
+ this.placeholder = '';
31
+ this.focused = false;
32
+ this.touched = false;
33
+ this.describedBy = '';
34
+ this.autofilled = false;
35
+ this.userAriaDescribedBy = undefined;
36
+ this.disableAutomaticLabeling = undefined;
37
+ this.ngControl = inject(NgControl, { self: true, optional: true });
38
+ /** Validation errors surfaced by the parent for error-state derivation. */
39
+ this.errors = [];
40
+ /** Accessible label for the slider thumb. */
41
+ this.label = '';
42
+ /** Thumb-tooltip formatter (Material `displayWith`). Optional — the parent's editor config may supply `undefined`. */
43
+ this.format = (value) => value;
44
+ /** Fallback formatter used by the value readout when `format` is absent. */
45
+ this.formatLabel = (value) => value;
46
+ this.#min = 0;
47
+ this.#max = 100;
48
+ this.#step = 1;
49
+ this.#disabled = false;
50
+ this.#value = 0;
51
+ this.#required = false;
52
+ /** Emits the new slider value when the user drags the thumb. */
53
+ this.valueChange = output();
54
+ /**
55
+ * Adapter for Material's `displayWith`, which requires a `string` return.
56
+ * Wraps the `format` thumb-tooltip formatter.
57
+ */
58
+ this.displayWith = (value) => String(this.format ? this.format(value) : value);
59
+ this.onTouched = () => { };
60
+ }
61
+ static { this.nextId = 0; }
62
+ #min;
63
+ /** Lower bound of the slider. */
64
+ get min() {
65
+ return this.#min;
66
+ }
67
+ set min(value) {
68
+ this.#min = this.#toNumber(value, 0);
69
+ this.stateChanges.next();
70
+ }
71
+ #max;
72
+ /** Upper bound of the slider. */
73
+ get max() {
74
+ return this.#max;
75
+ }
76
+ set max(value) {
77
+ this.#max = this.#toNumber(value, 100);
78
+ this.stateChanges.next();
79
+ }
80
+ #step;
81
+ /** Increment between selectable values; also drives tick-mark spacing. */
82
+ get step() {
83
+ return this.#step;
84
+ }
85
+ set step(value) {
86
+ this.#step = this.#toNumber(value, 1);
87
+ this.stateChanges.next();
88
+ }
89
+ #disabled;
90
+ /** Whether the slider is inert. */
91
+ get disabled() {
92
+ return this.#disabled;
93
+ }
94
+ set disabled(value) {
95
+ this.#disabled = coerceBooleanProperty(value);
96
+ this.stateChanges.next();
97
+ }
98
+ #value;
99
+ /** Current numeric value of the slider. */
100
+ get value() {
101
+ return this.#value;
102
+ }
103
+ set value(value) {
104
+ this.#value = this.#toNumber(value, 0);
105
+ this.stateChanges.next();
106
+ }
107
+ #required;
108
+ /** Whether a value is required. */
109
+ get required() {
110
+ return this.#required;
111
+ }
112
+ set required(value) {
113
+ this.#required = coerceBooleanProperty(value);
114
+ this.stateChanges.next();
115
+ }
116
+ // MatFormFieldControl reads these as plain getters during its own change
117
+ // detection, so they stay getters rather than `computed()` signals.
118
+ /**
119
+ * Whether the control holds no user selection.
120
+ *
121
+ * BEHAVIOUR FLAG: a value of `0` is a real selection, so it is NOT empty.
122
+ * The control is only "empty" when no numeric value is set at all.
123
+ */
124
+ get empty() {
125
+ return Number.isNaN(this.#value);
126
+ }
127
+ get shouldLabelFloat() {
128
+ return this.focused || !this.empty;
129
+ }
130
+ get errorState() {
131
+ const requiredUnset = this.empty && this.#required && this.touched;
132
+ const ngControlError = this.ngControl?.errors != null;
133
+ const externalError = (this.errors?.length ?? 0) > 0 && this.touched;
134
+ return requiredUnset || ngControlError || externalError;
135
+ }
136
+ /** Resolved display value shown in the live readout. */
137
+ get displayValue() {
138
+ return String(this.formatLabel(this.#value));
139
+ }
140
+ setDescribedByIds(ids) {
141
+ this.describedBy = ids.join(' ');
142
+ this.stateChanges.next();
143
+ }
144
+ onContainerClick() {
145
+ this.markAsTouched();
146
+ if (!this.focused) {
147
+ this.focused = true;
148
+ }
149
+ this.stateChanges.next();
150
+ }
151
+ markAsTouched() {
152
+ if (!this.touched) {
153
+ this.touched = true;
154
+ this.onTouched();
155
+ this.stateChanges.next();
156
+ }
157
+ }
158
+ valueChangedSlider(event) {
159
+ const target = event.target;
160
+ if (!(target instanceof HTMLInputElement)) {
161
+ return;
162
+ }
163
+ const next = Number(target.value);
164
+ if (Number.isNaN(next)) {
165
+ return;
166
+ }
167
+ this.value = next;
168
+ this.markAsTouched();
169
+ this.valueChange.emit(next);
170
+ }
171
+ /** Coerce an incoming binding to a finite number, falling back when invalid. */
172
+ #toNumber(value, fallback) {
173
+ const parsed = Number(value);
174
+ return Number.isFinite(parsed) ? parsed : fallback;
175
+ }
176
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MatSliderEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
177
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.12", type: MatSliderEditorComponent, isStandalone: true, selector: "lib-mat-slider-editor", inputs: { errors: "errors", label: "label", format: "format", formatLabel: "formatLabel", min: "min", max: "max", step: "step", disabled: "disabled", value: "value", required: "required" }, outputs: { valueChange: "valueChange" }, host: { properties: { "id": "id", "attr.aria-describedby": "describedBy", "class.lib-mat-slider-editor--focused": "focused", "class.lib-mat-slider-editor--disabled": "disabled" }, classAttribute: "lib-mat-slider-editor" }, providers: [{ provide: MatFormFieldControl, useExisting: MatSliderEditorComponent }], ngImport: i0, template: "<div class=\"lib-mat-slider-editor__row\">\n <span class=\"lib-mat-slider-editor__bound\">{{ min }}</span>\n\n <mat-slider\n class=\"lib-mat-slider-editor__slider\"\n discrete\n showTickMarks\n [disabled]=\"disabled\"\n [min]=\"min\"\n [max]=\"max\"\n [step]=\"step\"\n [displayWith]=\"displayWith\"\n >\n <input\n matSliderThumb\n [value]=\"value\"\n [attr.aria-label]=\"label || null\"\n (input)=\"valueChangedSlider($event)\"\n (blur)=\"markAsTouched()\"\n />\n </mat-slider>\n\n <span class=\"lib-mat-slider-editor__bound\">{{ max }}</span>\n</div>\n\n<output class=\"lib-mat-slider-editor__value\">{{ displayValue }}</output>\n", styles: [":host{display:block}.lib-mat-slider-editor__row{display:flex;align-items:center;gap:.75rem}.lib-mat-slider-editor__slider{flex:1 1 auto;min-width:0}.lib-mat-slider-editor__bound{flex:0 0 auto;font-size:.8125rem;color:var(--lib-forms-on-surface-variant);font-variant-numeric:tabular-nums}.lib-mat-slider-editor__value{display:block;margin-top:.5rem;font-size:.9375rem;font-weight:500;color:var(--lib-forms-on-surface);font-variant-numeric:tabular-nums;transition:color var(--lib-forms-duration-hover) var(--lib-forms-easing)}:host(.lib-mat-slider-editor--focused) .lib-mat-slider-editor__value{color:var(--lib-forms-primary)}:host(.lib-mat-slider-editor--disabled){opacity:.55;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: MatSliderModule }, { kind: "component", type: i1.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i1.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
178
+ }
179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MatSliderEditorComponent, decorators: [{
180
+ type: Component,
181
+ args: [{ selector: 'lib-mat-slider-editor', providers: [{ provide: MatFormFieldControl, useExisting: MatSliderEditorComponent }], imports: [MatSliderModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
182
+ 'class': 'lib-mat-slider-editor',
183
+ '[id]': 'id',
184
+ '[attr.aria-describedby]': 'describedBy',
185
+ '[class.lib-mat-slider-editor--focused]': 'focused',
186
+ '[class.lib-mat-slider-editor--disabled]': 'disabled',
187
+ }, template: "<div class=\"lib-mat-slider-editor__row\">\n <span class=\"lib-mat-slider-editor__bound\">{{ min }}</span>\n\n <mat-slider\n class=\"lib-mat-slider-editor__slider\"\n discrete\n showTickMarks\n [disabled]=\"disabled\"\n [min]=\"min\"\n [max]=\"max\"\n [step]=\"step\"\n [displayWith]=\"displayWith\"\n >\n <input\n matSliderThumb\n [value]=\"value\"\n [attr.aria-label]=\"label || null\"\n (input)=\"valueChangedSlider($event)\"\n (blur)=\"markAsTouched()\"\n />\n </mat-slider>\n\n <span class=\"lib-mat-slider-editor__bound\">{{ max }}</span>\n</div>\n\n<output class=\"lib-mat-slider-editor__value\">{{ displayValue }}</output>\n", styles: [":host{display:block}.lib-mat-slider-editor__row{display:flex;align-items:center;gap:.75rem}.lib-mat-slider-editor__slider{flex:1 1 auto;min-width:0}.lib-mat-slider-editor__bound{flex:0 0 auto;font-size:.8125rem;color:var(--lib-forms-on-surface-variant);font-variant-numeric:tabular-nums}.lib-mat-slider-editor__value{display:block;margin-top:.5rem;font-size:.9375rem;font-weight:500;color:var(--lib-forms-on-surface);font-variant-numeric:tabular-nums;transition:color var(--lib-forms-duration-hover) var(--lib-forms-easing)}:host(.lib-mat-slider-editor--focused) .lib-mat-slider-editor__value{color:var(--lib-forms-primary)}:host(.lib-mat-slider-editor--disabled){opacity:.55;pointer-events:none}\n"] }]
188
+ }], propDecorators: { errors: [{
189
+ type: Input
190
+ }], label: [{
191
+ type: Input
192
+ }], format: [{
193
+ type: Input
194
+ }], formatLabel: [{
195
+ type: Input
196
+ }], min: [{
197
+ type: Input
198
+ }], max: [{
199
+ type: Input
200
+ }], step: [{
201
+ type: Input
202
+ }], disabled: [{
203
+ type: Input
204
+ }], value: [{
205
+ type: Input
206
+ }], required: [{
207
+ type: Input
208
+ }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
209
+
210
+ export { MatSliderEditorComponent };
211
+ //# sourceMappingURL=ngx-t-forms-mat-slider-editor.component-CTSBrM-j.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-mat-slider-editor.component-CTSBrM-j.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-slider-editor/mat-slider-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-slider-editor/mat-slider-editor.component.html"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n Input,\n ViewEncapsulation,\n inject,\n output,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { Subject } from 'rxjs';\nimport type { IConfigElementError } from '../../t-dynamic-data-edit.component';\n\n/** Display formatter for a slider value (thumb tooltip / value readout). */\nexport type SliderValueFormatter = (value: number) => string | number;\n\n/**\n * Internal Material slider editor implementing `MatFormFieldControl<number>`\n * for the dynamic-data-edit configuration surface.\n *\n * Rendered by `t-dynamic-data-edit`, which supplies the surrounding field label,\n * hint, and validation errors — so this component owns only the slider track,\n * the live value readout, and the min/max bound labels.\n *\n * NOTE: `MatFormFieldControl<T>` mandates plain mutable `value` / `disabled` /\n * `required` / `placeholder` / `id` members, `@Input()` decorators, the\n * `focused` / `touched` / `stateChanges` members, and the `useExisting`\n * provider. These are framework wiring, not defects — the CLAUDE.md bans on\n * `@Input()` / `useExisting` do not apply to MatFormFieldControl integration.\n */\n@Component({\n selector: 'lib-mat-slider-editor',\n providers: [{ provide: MatFormFieldControl, useExisting: MatSliderEditorComponent }],\n imports: [MatSliderModule],\n templateUrl: './mat-slider-editor.component.html',\n styleUrl: './mat-slider-editor.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n 'class': 'lib-mat-slider-editor',\n '[id]': 'id',\n '[attr.aria-describedby]': 'describedBy',\n '[class.lib-mat-slider-editor--focused]': 'focused',\n '[class.lib-mat-slider-editor--disabled]': 'disabled',\n },\n})\nexport class MatSliderEditorComponent implements MatFormFieldControl<number> {\n static nextId = 0;\n\n /** Emits whenever a piece of `MatFormFieldControl` state changes. */\n readonly stateChanges = new Subject<void>();\n readonly controlType = 'lib-mat-slider-editor';\n\n id = `lib-mat-slider-editor-${MatSliderEditorComponent.nextId++}`;\n placeholder = '';\n focused = false;\n touched = false;\n describedBy = '';\n autofilled = false;\n userAriaDescribedBy: string | undefined = undefined;\n disableAutomaticLabeling: boolean | undefined = undefined;\n\n readonly ngControl = inject(NgControl, { self: true, optional: true });\n\n /** Validation errors surfaced by the parent for error-state derivation. */\n @Input() errors: IConfigElementError[] | undefined = [];\n /** Accessible label for the slider thumb. */\n @Input() label = '';\n /** Thumb-tooltip formatter (Material `displayWith`). Optional — the parent's editor config may supply `undefined`. */\n @Input() format: SliderValueFormatter | undefined = (value: number) => value;\n /** Fallback formatter used by the value readout when `format` is absent. */\n @Input() formatLabel: SliderValueFormatter = (value: number) => value;\n\n #min = 0;\n /** Lower bound of the slider. */\n @Input()\n get min(): number {\n return this.#min;\n }\n set min(value: number) {\n this.#min = this.#toNumber(value, 0);\n this.stateChanges.next();\n }\n\n #max = 100;\n /** Upper bound of the slider. */\n @Input()\n get max(): number {\n return this.#max;\n }\n set max(value: number) {\n this.#max = this.#toNumber(value, 100);\n this.stateChanges.next();\n }\n\n #step = 1;\n /** Increment between selectable values; also drives tick-mark spacing. */\n @Input()\n get step(): number {\n return this.#step;\n }\n set step(value: number) {\n this.#step = this.#toNumber(value, 1);\n this.stateChanges.next();\n }\n\n #disabled = false;\n /** Whether the slider is inert. */\n @Input()\n get disabled(): boolean {\n return this.#disabled;\n }\n set disabled(value: boolean) {\n this.#disabled = coerceBooleanProperty(value);\n this.stateChanges.next();\n }\n\n #value = 0;\n /** Current numeric value of the slider. */\n @Input()\n get value(): number {\n return this.#value;\n }\n set value(value: number) {\n this.#value = this.#toNumber(value, 0);\n this.stateChanges.next();\n }\n\n #required = false;\n /** Whether a value is required. */\n @Input()\n get required(): boolean {\n return this.#required;\n }\n set required(value: boolean) {\n this.#required = coerceBooleanProperty(value);\n this.stateChanges.next();\n }\n\n /** Emits the new slider value when the user drags the thumb. */\n readonly valueChange = output<number>();\n\n // MatFormFieldControl reads these as plain getters during its own change\n // detection, so they stay getters rather than `computed()` signals.\n\n /**\n * Whether the control holds no user selection.\n *\n * BEHAVIOUR FLAG: a value of `0` is a real selection, so it is NOT empty.\n * The control is only \"empty\" when no numeric value is set at all.\n */\n get empty(): boolean {\n return Number.isNaN(this.#value);\n }\n\n get shouldLabelFloat(): boolean {\n return this.focused || !this.empty;\n }\n\n get errorState(): boolean {\n const requiredUnset = this.empty && this.#required && this.touched;\n const ngControlError = this.ngControl?.errors != null;\n const externalError = (this.errors?.length ?? 0) > 0 && this.touched;\n return requiredUnset || ngControlError || externalError;\n }\n\n /** Resolved display value shown in the live readout. */\n get displayValue(): string {\n return String(this.formatLabel(this.#value));\n }\n\n /**\n * Adapter for Material's `displayWith`, which requires a `string` return.\n * Wraps the `format` thumb-tooltip formatter.\n */\n readonly displayWith = (value: number): string =>\n String(this.format ? this.format(value) : value);\n\n setDescribedByIds(ids: string[]): void {\n this.describedBy = ids.join(' ');\n this.stateChanges.next();\n }\n\n onContainerClick(): void {\n this.markAsTouched();\n if (!this.focused) {\n this.focused = true;\n }\n this.stateChanges.next();\n }\n\n onTouched: () => void = () => {};\n\n markAsTouched(): void {\n if (!this.touched) {\n this.touched = true;\n this.onTouched();\n this.stateChanges.next();\n }\n }\n\n valueChangedSlider(event: Event): void {\n const target = event.target;\n if (!(target instanceof HTMLInputElement)) {\n return;\n }\n const next = Number(target.value);\n if (Number.isNaN(next)) {\n return;\n }\n this.value = next;\n this.markAsTouched();\n this.valueChange.emit(next);\n }\n\n /** Coerce an incoming binding to a finite number, falling back when invalid. */\n #toNumber(value: number, fallback: number): number {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : fallback;\n }\n}\n","<div class=\"lib-mat-slider-editor__row\">\n <span class=\"lib-mat-slider-editor__bound\">{{ min }}</span>\n\n <mat-slider\n class=\"lib-mat-slider-editor__slider\"\n discrete\n showTickMarks\n [disabled]=\"disabled\"\n [min]=\"min\"\n [max]=\"max\"\n [step]=\"step\"\n [displayWith]=\"displayWith\"\n >\n <input\n matSliderThumb\n [value]=\"value\"\n [attr.aria-label]=\"label || null\"\n (input)=\"valueChangedSlider($event)\"\n (blur)=\"markAsTouched()\"\n />\n </mat-slider>\n\n <span class=\"lib-mat-slider-editor__bound\">{{ max }}</span>\n</div>\n\n<output class=\"lib-mat-slider-editor__value\">{{ displayValue }}</output>\n"],"names":[],"mappings":";;;;;;;;;AAkBA;;;;;;;;;;;;;AAaG;MAiBU,wBAAwB,CAAA;AAhBrC,IAAA,WAAA,GAAA;;AAoBW,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;QAClC,IAAA,CAAA,WAAW,GAAG,uBAAuB;AAE9C,QAAA,IAAA,CAAA,EAAE,GAAG,CAAA,sBAAA,EAAyB,wBAAwB,CAAC,MAAM,EAAE,EAAE;QACjE,IAAA,CAAA,WAAW,GAAG,EAAE;QAChB,IAAA,CAAA,OAAO,GAAG,KAAK;QACf,IAAA,CAAA,OAAO,GAAG,KAAK;QACf,IAAA,CAAA,WAAW,GAAG,EAAE;QAChB,IAAA,CAAA,UAAU,GAAG,KAAK;QAClB,IAAA,CAAA,mBAAmB,GAAuB,SAAS;QACnD,IAAA,CAAA,wBAAwB,GAAwB,SAAS;AAEhD,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAA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A,EAAA;;sBAqBA;;sBAEA;;sBAEA;;sBAEA;;sBAIA;;sBAWA;;sBAWA;;sBAWA;;sBAWA;;sBAWA;;;;;"}
@@ -0,0 +1,165 @@
1
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { NgControl } from '@angular/forms';
5
+ import { MatFormFieldControl } from '@angular/material/form-field';
6
+ import * as i1 from '@angular/material/slide-toggle';
7
+ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
8
+ import { Subject } from 'rxjs';
9
+
10
+ /**
11
+ * Internal Material slide-toggle editor implementing
12
+ * `MatFormFieldControl<boolean>` and `ControlValueAccessor`.
13
+ *
14
+ * Rendered by `t-dynamic-data-edit`, which supplies the surrounding field label,
15
+ * hint, and validation errors — so this component owns only the toggle itself
16
+ * (and the inline caption the toggle carries).
17
+ *
18
+ * NOTE: `MatFormFieldControl<T>` and `ControlValueAccessor` mandate plain
19
+ * mutable `value` / `placeholder` / `required` / `disabled` / `id` members,
20
+ * `@Input()` decorators, the `focused` / `touched` / `stateChanges` /
21
+ * `onChange` / `onTouched` members, and the `useExisting` provider. These are
22
+ * framework wiring, not defects — the CLAUDE.md bans on `@Input()` / `useExisting`
23
+ * do not apply to MatFormFieldControl integration.
24
+ */
25
+ class MatSliderToggleEditorComponent {
26
+ static { this.nextId = 0; }
27
+ #required;
28
+ get required() {
29
+ return this.#required;
30
+ }
31
+ set required(value) {
32
+ this.#required = coerceBooleanProperty(value);
33
+ this.stateChanges.next();
34
+ }
35
+ #value;
36
+ get value() {
37
+ return this.#value;
38
+ }
39
+ set value(val) {
40
+ this.#value = val;
41
+ this.onChange(val);
42
+ this.stateChanges.next();
43
+ }
44
+ #placeholder;
45
+ get placeholder() {
46
+ return this.#placeholder;
47
+ }
48
+ set placeholder(value) {
49
+ this.#placeholder = value;
50
+ this.stateChanges.next();
51
+ }
52
+ constructor() {
53
+ /** Emits whenever a piece of `MatFormFieldControl` state changes. */
54
+ this.stateChanges = new Subject();
55
+ this.controlType = 'lib-mat-slider-toggle-editor';
56
+ this.focused = false;
57
+ this.touched = false;
58
+ this.autofilled = false;
59
+ this.id = `lib-mat-slider-toggle-editor-${MatSliderToggleEditorComponent.nextId++}`;
60
+ this.describedBy = '';
61
+ this.ngControl = inject(NgControl, { self: true, optional: true });
62
+ this.name = undefined;
63
+ this.label = '';
64
+ this.errors = [];
65
+ this.disabled = false;
66
+ /** Emits the new toggle state when the user flips it. */
67
+ this.valueChange = output();
68
+ this.#required = false;
69
+ this.#value = false;
70
+ this.#placeholder = '';
71
+ // ControlValueAccessor — Angular registers an untyped change callback.
72
+ this.onChange = () => { };
73
+ this.onTouched = () => { };
74
+ if (this.ngControl != null) {
75
+ this.ngControl.valueAccessor = this;
76
+ }
77
+ }
78
+ // MatFormFieldControl reads these as plain getters during its own change
79
+ // detection, so they stay getters rather than `computed()` signals.
80
+ get shouldLabelFloat() {
81
+ return this.focused || !this.empty;
82
+ }
83
+ get empty() {
84
+ return this.#value === false;
85
+ }
86
+ get errorState() {
87
+ return ((!this.#value && this.#required && this.touched) ||
88
+ this.ngControl?.errors != null ||
89
+ (this.errors?.length ?? 0) > 0);
90
+ }
91
+ writeValue(value) {
92
+ this.#value = value;
93
+ this.stateChanges.next();
94
+ }
95
+ registerOnChange(fn) {
96
+ this.onChange = fn;
97
+ }
98
+ registerOnTouched(fn) {
99
+ this.onTouched = fn;
100
+ }
101
+ setDisabledState(isDisabled) {
102
+ this.disabled = isDisabled;
103
+ this.stateChanges.next();
104
+ }
105
+ setDescribedByIds(ids) {
106
+ this.describedBy = ids.join(' ');
107
+ this.stateChanges.next();
108
+ }
109
+ onContainerClick() {
110
+ if (!this.focused) {
111
+ this.focused = true;
112
+ this.stateChanges.next();
113
+ }
114
+ }
115
+ markAsTouched() {
116
+ if (!this.touched) {
117
+ this.touched = true;
118
+ this.onTouched();
119
+ this.stateChanges.next();
120
+ }
121
+ }
122
+ valueToggleChanged(value) {
123
+ this.value = value;
124
+ this.valueChange.emit(value);
125
+ this.markAsTouched();
126
+ }
127
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MatSliderToggleEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
128
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.12", type: MatSliderToggleEditorComponent, isStandalone: true, selector: "lib-mat-slider-toggle-editor", inputs: { name: "name", label: "label", errors: "errors", disabled: "disabled", required: "required", value: "value", placeholder: "placeholder" }, outputs: { valueChange: "valueChange" }, host: { properties: { "id": "id", "attr.aria-describedby": "describedBy", "class.floating": "shouldLabelFloat" }, classAttribute: "lib-mat-slider-toggle-editor" }, providers: [
129
+ {
130
+ provide: MatFormFieldControl,
131
+ useExisting: MatSliderToggleEditorComponent,
132
+ },
133
+ ], ngImport: i0, template: "<mat-slide-toggle\n class=\"lib-mat-slider-toggle-editor__toggle\"\n [disabled]=\"disabled\"\n [checked]=\"!!value\"\n [required]=\"required\"\n [aria-label]=\"label || name || 'Toggle'\"\n (change)=\"valueToggleChanged($event.checked)\"\n (blur)=\"markAsTouched()\"\n>\n {{ label }}\n</mat-slide-toggle>\n", styles: [":host{display:flex;align-items:center;min-height:2.25rem}.lib-mat-slider-toggle-editor__toggle{--mdc-form-field-label-text-color: var(--lib-forms-on-surface);color:var(--lib-forms-on-surface);font-size:.9375rem}\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
134
+ }
135
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MatSliderToggleEditorComponent, decorators: [{
136
+ type: Component,
137
+ args: [{ selector: 'lib-mat-slider-toggle-editor', imports: [MatSlideToggleModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, providers: [
138
+ {
139
+ provide: MatFormFieldControl,
140
+ useExisting: MatSliderToggleEditorComponent,
141
+ },
142
+ ], host: {
143
+ 'class': 'lib-mat-slider-toggle-editor',
144
+ '[id]': 'id',
145
+ '[attr.aria-describedby]': 'describedBy',
146
+ '[class.floating]': 'shouldLabelFloat',
147
+ }, template: "<mat-slide-toggle\n class=\"lib-mat-slider-toggle-editor__toggle\"\n [disabled]=\"disabled\"\n [checked]=\"!!value\"\n [required]=\"required\"\n [aria-label]=\"label || name || 'Toggle'\"\n (change)=\"valueToggleChanged($event.checked)\"\n (blur)=\"markAsTouched()\"\n>\n {{ label }}\n</mat-slide-toggle>\n", styles: [":host{display:flex;align-items:center;min-height:2.25rem}.lib-mat-slider-toggle-editor__toggle{--mdc-form-field-label-text-color: var(--lib-forms-on-surface);color:var(--lib-forms-on-surface);font-size:.9375rem}\n"] }]
148
+ }], ctorParameters: () => [], propDecorators: { name: [{
149
+ type: Input
150
+ }], label: [{
151
+ type: Input
152
+ }], errors: [{
153
+ type: Input
154
+ }], disabled: [{
155
+ type: Input
156
+ }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], required: [{
157
+ type: Input
158
+ }], value: [{
159
+ type: Input
160
+ }], placeholder: [{
161
+ type: Input
162
+ }] } });
163
+
164
+ export { MatSliderToggleEditorComponent };
165
+ //# sourceMappingURL=ngx-t-forms-mat-slider-toggle-editor.component-CcYiwx-8.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-mat-slider-toggle-editor.component-CcYiwx-8.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-slider-toggle-editor/mat-slider-toggle-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/mat-slider-toggle-editor/mat-slider-toggle-editor.component.html"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n Input,\n ViewEncapsulation,\n inject,\n output,\n} from '@angular/core';\nimport { ControlValueAccessor, NgControl } from '@angular/forms';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { Subject } from 'rxjs';\nimport type { IConfigElementError } from '../../t-dynamic-data-edit.component';\n\n// CVA write callback. Angular's ControlValueAccessor types the registered\n// change handler as `(value: any) => void`; the alias keeps the `any` contained\n// to one place instead of repeating an eslint-disable on every reference.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Angular CVA mandates an untyped change callback.\ntype CvaChange = (value: any) => void;\n\n/**\n * Internal Material slide-toggle editor implementing\n * `MatFormFieldControl<boolean>` and `ControlValueAccessor`.\n *\n * Rendered by `t-dynamic-data-edit`, which supplies the surrounding field label,\n * hint, and validation errors — so this component owns only the toggle itself\n * (and the inline caption the toggle carries).\n *\n * NOTE: `MatFormFieldControl<T>` and `ControlValueAccessor` mandate plain\n * mutable `value` / `placeholder` / `required` / `disabled` / `id` members,\n * `@Input()` decorators, the `focused` / `touched` / `stateChanges` /\n * `onChange` / `onTouched` members, and the `useExisting` provider. These are\n * framework wiring, not defects — the CLAUDE.md bans on `@Input()` / `useExisting`\n * do not apply to MatFormFieldControl integration.\n */\n@Component({\n selector: 'lib-mat-slider-toggle-editor',\n imports: [MatSlideToggleModule],\n templateUrl: './mat-slider-toggle-editor.component.html',\n styleUrl: './mat-slider-toggle-editor.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n providers: [\n {\n provide: MatFormFieldControl,\n useExisting: MatSliderToggleEditorComponent,\n },\n ],\n host: {\n 'class': 'lib-mat-slider-toggle-editor',\n '[id]': 'id',\n '[attr.aria-describedby]': 'describedBy',\n '[class.floating]': 'shouldLabelFloat',\n },\n})\nexport class MatSliderToggleEditorComponent\n implements MatFormFieldControl<boolean>, ControlValueAccessor\n{\n static nextId = 0;\n\n /** Emits whenever a piece of `MatFormFieldControl` state changes. */\n readonly stateChanges = new Subject<void>();\n readonly controlType = 'lib-mat-slider-toggle-editor';\n\n focused = false;\n touched = false;\n autofilled = false;\n\n id = `lib-mat-slider-toggle-editor-${MatSliderToggleEditorComponent.nextId++}`;\n describedBy = '';\n\n readonly ngControl = inject(NgControl, { self: true, optional: true });\n\n @Input() name: string | undefined = undefined;\n @Input() label = '';\n @Input() errors: IConfigElementError[] | undefined = [];\n @Input() disabled = false;\n\n /** Emits the new toggle state when the user flips it. */\n readonly valueChange = output<boolean>();\n\n #required = false;\n @Input()\n get required(): boolean {\n return this.#required;\n }\n set required(value: boolean) {\n this.#required = coerceBooleanProperty(value);\n this.stateChanges.next();\n }\n\n #value = false;\n @Input()\n get value(): boolean {\n return this.#value;\n }\n set value(val: boolean) {\n this.#value = val;\n this.onChange(val);\n this.stateChanges.next();\n }\n\n #placeholder = '';\n @Input()\n get placeholder(): string {\n return this.#placeholder;\n }\n set placeholder(value: string) {\n this.#placeholder = value;\n this.stateChanges.next();\n }\n\n constructor() {\n if (this.ngControl != null) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n // MatFormFieldControl reads these as plain getters during its own change\n // detection, so they stay getters rather than `computed()` signals.\n get shouldLabelFloat(): boolean {\n return this.focused || !this.empty;\n }\n\n get empty(): boolean {\n return this.#value === false;\n }\n\n get errorState(): boolean {\n return (\n (!this.#value && this.#required && this.touched) ||\n this.ngControl?.errors != null ||\n (this.errors?.length ?? 0) > 0\n );\n }\n\n // ControlValueAccessor — Angular registers an untyped change callback.\n onChange: CvaChange = () => {};\n onTouched: () => void = () => {};\n\n writeValue(value: boolean): void {\n this.#value = value;\n this.stateChanges.next();\n }\n\n registerOnChange(fn: CvaChange): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.stateChanges.next();\n }\n\n setDescribedByIds(ids: string[]): void {\n this.describedBy = ids.join(' ');\n this.stateChanges.next();\n }\n\n onContainerClick(): void {\n if (!this.focused) {\n this.focused = true;\n this.stateChanges.next();\n }\n }\n\n markAsTouched(): void {\n if (!this.touched) {\n this.touched = true;\n this.onTouched();\n this.stateChanges.next();\n }\n }\n\n valueToggleChanged(value: boolean): void {\n this.value = value;\n this.valueChange.emit(value);\n this.markAsTouched();\n }\n}\n","<mat-slide-toggle\n class=\"lib-mat-slider-toggle-editor__toggle\"\n [disabled]=\"disabled\"\n [checked]=\"!!value\"\n [required]=\"required\"\n [aria-label]=\"label || name || 'Toggle'\"\n (change)=\"valueToggleChanged($event.checked)\"\n (blur)=\"markAsTouched()\"\n>\n {{ label }}\n</mat-slide-toggle>\n"],"names":[],"mappings":";;;;;;;;;AAqBA;;;;;;;;;;;;;;AAcG;MAqBU,8BAA8B,CAAA;aAGlC,IAAA,CAAA,MAAM,GAAG,CAAH,CAAK;AAuBlB,IAAA,SAAS;AACT,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;AAEA,IAAA,MAAM;AACN,IAAA,IACI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,MAAM;IACpB;IACA,IAAI,KAAK,CAAC,GAAY,EAAA;AACpB,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,Y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,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,cAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,eAAA,EAAA,YAAA,EAAA,iBAAA,EAAA,kBAAA,EAAA,UAAA,EAAA,OAAA,EAAA,UAAA,EAAA,eAAA,EAAA,UAAA,EAAA,SAAA,EAAA,UAAA,EAAA,qBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,EAAA,cAAA,CAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAkBnB,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBApB1C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,8BAA8B,EAAA,OAAA,EAC/B,CAAC,oBAAoB,CAAC,EAAA,eAAA,EAGd,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,QAAQ,EAAA,SAAA,EAC9B;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,mBAAmB;AAC5B,4BAAA,WAAW,EAAA,8BAAgC;AAC5C,yBAAA;qBACF,EAAA,IAAA,EACK;AACJ,wBAAA,OAAO,EAAE,8BAA8B;AACvC,wBAAA,MAAM,EAAE,IAAI;AACZ,wBAAA,yBAAyB,EAAE,aAAa;AACxC,wBAAA,kBAAkB,EAAE,kBAAkB;AACvC,qBAAA,EAAA,QAAA,EAAA,4TAAA,EAAA,MAAA,EAAA,CAAA,uNAAA,CAAA,EAAA;;sBAoBA;;sBACA;;sBACA;;sBACA;;sBAMA;;sBAUA;;sBAWA;;;;;"}
@@ -0,0 +1,38 @@
1
+ import { AsyncPipe } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, signal, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import * as i1 from '@angular/material/button';
5
+ import { MatButtonModule } from '@angular/material/button';
6
+ import * as i3 from '@angular/material/icon';
7
+ import { MatIconModule } from '@angular/material/icon';
8
+ import * as i5 from '@angular/material/toolbar';
9
+ import { MatToolbarModule } from '@angular/material/toolbar';
10
+ import * as i5$1 from '@angular/material/tooltip';
11
+ import { MatTooltipModule } from '@angular/material/tooltip';
12
+ import { F as FormsStoreService } from './ngx-t-forms-ngx-t-forms-u_kigDid.mjs';
13
+
14
+ class MissingFormConfigsComponent {
15
+ constructor() {
16
+ this.#store = inject(FormsStoreService);
17
+ this.errors$ = this.#store.formBuilderSelectors.formValidationErrorsMessages$;
18
+ this.missingConfigs$ = this.#store.formBuilderSelectors.missingConfig$;
19
+ this.hideDetails = signal(true, ...(ngDevMode ? [{ debugName: "hideDetails" }] : /* istanbul ignore next */ []));
20
+ this.showAllErrors = signal(false, ...(ngDevMode ? [{ debugName: "showAllErrors" }] : /* istanbul ignore next */ []));
21
+ }
22
+ #store;
23
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MissingFormConfigsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
24
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MissingFormConfigsComponent, isStandalone: true, selector: "lib-missing-form-configs", ngImport: i0, template: "@if (hideDetails()) {\r\n<button\r\nmatTooltip=\"Click to view form configuration issues and validation errors\"\r\nstyle=\"margin: 16px;\" (click)=\"hideDetails.set(false)\" mat-fab color=\"warn\" aria-label=\"Error icon\">\r\n <mat-icon>error</mat-icon>\r\n</button>\r\n}@else {\r\n<div style=\"margin: 8px;position:relative\" class=\"content \">\r\n <mat-toolbar color=\"warn\">\r\n <button (click)=\"hideDetails.set(true)\" mat-icon-button>\r\n <mat-icon>\r\n close\r\n </mat-icon>\r\n </button>\r\n Missing configurations:\r\n <span class=\"spacer\"></span>\r\n <button [matTooltip]=\"showAllErrors() ? 'Hide all errors' : 'Show all errors'\"\r\n (click)=\"showAllErrors.set(!showAllErrors())\" mat-icon-button>\r\n\r\n <mat-icon>\r\n unfold_more\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n <section style=\"padding: 16px;\" >\r\n <h5>\r\n <strong>\r\n Overall form issues:\r\n </strong>\r\n </h5>\r\n <ul>\r\n @for (issue of (missingConfigs$|async);track issue) {\r\n <li>\r\n {{issue}}\r\n </li>\r\n }\r\n </ul>\r\n\r\n @if(showAllErrors()){\r\n <h5>\r\n <strong>\r\n\r\n Form validationErrors :\r\n\r\n </strong>\r\n\r\n\r\n </h5>\r\n <ul>\r\n @for (error of errors$|async; track error) {\r\n\r\n <li>\r\n\r\n {{error}}\r\n\r\n </li>\r\n\r\n }\r\n </ul>\r\n }\r\n\r\n\r\n\r\n\r\n </section>\r\n\r\n</div>\r\n}\r\n", styles: [".content{width:400px;background:var(--mat-sys-surface-container, var(--mat-app-surface));border:solid var(--mat-form-field-error-text-color, var(--mat-app-error)) 1px}ul{margin-top:0}h5{padding-left:16px;padding-right:16px;padding-top:8px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], 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: MatToolbarModule }, { kind: "component", type: i5.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
25
+ }
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MissingFormConfigsComponent, decorators: [{
27
+ type: Component,
28
+ args: [{ selector: 'lib-missing-form-configs', imports: [
29
+ AsyncPipe,
30
+ MatButtonModule,
31
+ MatIconModule,
32
+ MatToolbarModule,
33
+ MatTooltipModule,
34
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (hideDetails()) {\r\n<button\r\nmatTooltip=\"Click to view form configuration issues and validation errors\"\r\nstyle=\"margin: 16px;\" (click)=\"hideDetails.set(false)\" mat-fab color=\"warn\" aria-label=\"Error icon\">\r\n <mat-icon>error</mat-icon>\r\n</button>\r\n}@else {\r\n<div style=\"margin: 8px;position:relative\" class=\"content \">\r\n <mat-toolbar color=\"warn\">\r\n <button (click)=\"hideDetails.set(true)\" mat-icon-button>\r\n <mat-icon>\r\n close\r\n </mat-icon>\r\n </button>\r\n Missing configurations:\r\n <span class=\"spacer\"></span>\r\n <button [matTooltip]=\"showAllErrors() ? 'Hide all errors' : 'Show all errors'\"\r\n (click)=\"showAllErrors.set(!showAllErrors())\" mat-icon-button>\r\n\r\n <mat-icon>\r\n unfold_more\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n <section style=\"padding: 16px;\" >\r\n <h5>\r\n <strong>\r\n Overall form issues:\r\n </strong>\r\n </h5>\r\n <ul>\r\n @for (issue of (missingConfigs$|async);track issue) {\r\n <li>\r\n {{issue}}\r\n </li>\r\n }\r\n </ul>\r\n\r\n @if(showAllErrors()){\r\n <h5>\r\n <strong>\r\n\r\n Form validationErrors :\r\n\r\n </strong>\r\n\r\n\r\n </h5>\r\n <ul>\r\n @for (error of errors$|async; track error) {\r\n\r\n <li>\r\n\r\n {{error}}\r\n\r\n </li>\r\n\r\n }\r\n </ul>\r\n }\r\n\r\n\r\n\r\n\r\n </section>\r\n\r\n</div>\r\n}\r\n", styles: [".content{width:400px;background:var(--mat-sys-surface-container, var(--mat-app-surface));border:solid var(--mat-form-field-error-text-color, var(--mat-app-error)) 1px}ul{margin-top:0}h5{padding-left:16px;padding-right:16px;padding-top:8px}\n"] }]
35
+ }] });
36
+
37
+ export { MissingFormConfigsComponent };
38
+ //# sourceMappingURL=ngx-t-forms-missing-form-configs.component-DrnH8qdG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-missing-form-configs.component-DrnH8qdG.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/missing-form-configs/missing-form-configs.component.ts","../../../projects/ngx-t-forms/src/lib/components/form-builder/elements/missing-form-configs/missing-form-configs.component.html"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatToolbarModule } from '@angular/material/toolbar';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\n\r\nimport { FormsStoreService } from '../../../forms/store/forms-store.service';\r\n\r\n@Component({\r\n selector: 'lib-missing-form-configs',\r\n imports: [\r\n AsyncPipe,\r\n MatButtonModule,\r\n MatIconModule,\r\n MatToolbarModule,\r\n MatTooltipModule,\r\n ],\r\n templateUrl: './missing-form-configs.component.html',\r\n styleUrl: './missing-form-configs.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class MissingFormConfigsComponent {\r\n readonly #store = inject(FormsStoreService);\r\n\r\n protected readonly errors$ = this.#store.formBuilderSelectors.formValidationErrorsMessages$;\r\n protected readonly missingConfigs$ = this.#store.formBuilderSelectors.missingConfig$;\r\n protected readonly hideDetails = signal<boolean>(true);\r\n protected readonly showAllErrors = signal<boolean>(false);\r\n}\r\n","@if (hideDetails()) {\r\n<button\r\nmatTooltip=\"Click to view form configuration issues and validation errors\"\r\nstyle=\"margin: 16px;\" (click)=\"hideDetails.set(false)\" mat-fab color=\"warn\" aria-label=\"Error icon\">\r\n <mat-icon>error</mat-icon>\r\n</button>\r\n}@else {\r\n<div style=\"margin: 8px;position:relative\" class=\"content \">\r\n <mat-toolbar color=\"warn\">\r\n <button (click)=\"hideDetails.set(true)\" mat-icon-button>\r\n <mat-icon>\r\n close\r\n </mat-icon>\r\n </button>\r\n Missing configurations:\r\n <span class=\"spacer\"></span>\r\n <button [matTooltip]=\"showAllErrors() ? 'Hide all errors' : 'Show all errors'\"\r\n (click)=\"showAllErrors.set(!showAllErrors())\" mat-icon-button>\r\n\r\n <mat-icon>\r\n unfold_more\r\n </mat-icon>\r\n </button>\r\n </mat-toolbar>\r\n <section style=\"padding: 16px;\" >\r\n <h5>\r\n <strong>\r\n Overall form issues:\r\n </strong>\r\n </h5>\r\n <ul>\r\n @for (issue of (missingConfigs$|async);track issue) {\r\n <li>\r\n {{issue}}\r\n </li>\r\n }\r\n </ul>\r\n\r\n @if(showAllErrors()){\r\n <h5>\r\n <strong>\r\n\r\n Form validationErrors :\r\n\r\n </strong>\r\n\r\n\r\n </h5>\r\n <ul>\r\n @for (error of errors$|async; track error) {\r\n\r\n <li>\r\n\r\n {{error}}\r\n\r\n </li>\r\n\r\n }\r\n </ul>\r\n }\r\n\r\n\r\n\r\n\r\n </section>\r\n\r\n</div>\r\n}\r\n"],"names":["i2","i3","i4"],"mappings":";;;;;;;;;;;;;MAsBa,2BAA2B,CAAA;AAbxC,IAAA,WAAA,GAAA;AAcW,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAExB,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,6BAA6B;QACxE,IAAA,CAAA,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,o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