@sdcorejs/angular 20.1.3 → 20.1.5

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 (168) hide show
  1. package/README.md +19 -14
  2. package/components/audit-diff/index.d.ts +74 -0
  3. package/components/badge/index.d.ts +1 -1
  4. package/components/breadcrumb/index.d.ts +53 -0
  5. package/components/data-state/index.d.ts +44 -0
  6. package/components/document-builder/index.d.ts +5 -5
  7. package/components/form-generic/index.d.ts +67 -104
  8. package/components/import-excel/index.d.ts +4 -14
  9. package/components/index.d.ts +4 -0
  10. package/components/job-progress/index.d.ts +38 -0
  11. package/components/mini-editor/index.d.ts +9 -9
  12. package/components/modal/index.d.ts +7 -1
  13. package/components/preview/index.d.ts +181 -28
  14. package/components/side-drawer/index.d.ts +7 -1
  15. package/components/tab/index.d.ts +9 -2
  16. package/components/table/index.d.ts +8 -7
  17. package/components/tree/index.d.ts +24 -2
  18. package/components/upload-file/index.d.ts +5 -4
  19. package/directives/index.d.ts +10 -8
  20. package/fesm2022/sdcorejs-angular-components-anchor.mjs +14 -14
  21. package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
  22. package/fesm2022/sdcorejs-angular-components-audit-diff.mjs +332 -0
  23. package/fesm2022/sdcorejs-angular-components-audit-diff.mjs.map +1 -0
  24. package/fesm2022/sdcorejs-angular-components-badge.mjs +1 -0
  25. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  26. package/fesm2022/sdcorejs-angular-components-breadcrumb.mjs +121 -0
  27. package/fesm2022/sdcorejs-angular-components-breadcrumb.mjs.map +1 -0
  28. package/fesm2022/sdcorejs-angular-components-data-state.mjs +68 -0
  29. package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -0
  30. package/fesm2022/sdcorejs-angular-components-document-builder.mjs +18 -23
  31. package/fesm2022/sdcorejs-angular-components-document-builder.mjs.map +1 -1
  32. package/fesm2022/sdcorejs-angular-components-editor.mjs +6 -4
  33. package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
  34. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +495 -838
  35. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  36. package/fesm2022/sdcorejs-angular-components-import-excel.mjs +24 -34
  37. package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
  38. package/fesm2022/sdcorejs-angular-components-job-progress.mjs +97 -0
  39. package/fesm2022/sdcorejs-angular-components-job-progress.mjs.map +1 -0
  40. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +10 -20
  41. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
  42. package/fesm2022/sdcorejs-angular-components-modal.mjs +61 -4
  43. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  44. package/fesm2022/sdcorejs-angular-components-preview.mjs +1438 -218
  45. package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
  46. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +4 -4
  47. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  48. package/fesm2022/sdcorejs-angular-components-query-builder.mjs +1 -1
  49. package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
  50. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +39 -2
  51. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  52. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +16 -22
  53. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  54. package/fesm2022/sdcorejs-angular-components-tab.mjs +48 -4
  55. package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
  56. package/fesm2022/sdcorejs-angular-components-table.mjs +96 -63
  57. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  58. package/fesm2022/sdcorejs-angular-components-tree.mjs +186 -17
  59. package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
  60. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +15 -22
  61. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  62. package/fesm2022/sdcorejs-angular-components.mjs +4 -0
  63. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  64. package/fesm2022/sdcorejs-angular-directives.mjs +29 -41
  65. package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
  66. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +7 -7
  67. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  68. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +20 -83
  69. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
  70. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +6 -3
  71. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  72. package/fesm2022/sdcorejs-angular-forms-chip.mjs +6 -3
  73. package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
  74. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +16 -13
  75. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  76. package/fesm2022/sdcorejs-angular-forms-date.mjs +42 -65
  77. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  78. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +51 -66
  79. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  80. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +384 -0
  81. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -0
  82. package/fesm2022/sdcorejs-angular-forms-input-color.mjs +1 -1
  83. package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
  84. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +7 -5
  85. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  86. package/fesm2022/sdcorejs-angular-forms-input.mjs +290 -56
  87. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  88. package/fesm2022/sdcorejs-angular-forms-models.mjs +155 -2
  89. package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
  90. package/fesm2022/sdcorejs-angular-forms-radio.mjs +44 -78
  91. package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
  92. package/fesm2022/sdcorejs-angular-forms-select.mjs +6 -20
  93. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  94. package/fesm2022/sdcorejs-angular-forms-switch.mjs +19 -76
  95. package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
  96. package/fesm2022/sdcorejs-angular-forms-textarea.mjs +6 -5
  97. package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
  98. package/fesm2022/sdcorejs-angular-forms-time-range.mjs +280 -0
  99. package/fesm2022/sdcorejs-angular-forms-time-range.mjs.map +1 -0
  100. package/fesm2022/sdcorejs-angular-forms-time.mjs +310 -0
  101. package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -0
  102. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +210 -0
  103. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -0
  104. package/fesm2022/sdcorejs-angular-forms.mjs +73 -4
  105. package/fesm2022/sdcorejs-angular-forms.mjs.map +1 -1
  106. package/fesm2022/sdcorejs-angular-i18n.mjs +375 -10
  107. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  108. package/fesm2022/sdcorejs-angular-interceptors.mjs +12 -17
  109. package/fesm2022/sdcorejs-angular-interceptors.mjs.map +1 -1
  110. package/fesm2022/sdcorejs-angular-modules-layout.mjs +994 -168
  111. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  112. package/fesm2022/sdcorejs-angular-pipes.mjs +5 -7
  113. package/fesm2022/sdcorejs-angular-pipes.mjs.map +1 -1
  114. package/fesm2022/sdcorejs-angular-services-api.mjs +407 -137
  115. package/fesm2022/sdcorejs-angular-services-api.mjs.map +1 -1
  116. package/fesm2022/sdcorejs-angular-services-cache.mjs +515 -105
  117. package/fesm2022/sdcorejs-angular-services-cache.mjs.map +1 -1
  118. package/fesm2022/sdcorejs-angular-services-confirm.mjs +5 -7
  119. package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
  120. package/fesm2022/sdcorejs-angular-services-docx.mjs +7 -10
  121. package/fesm2022/sdcorejs-angular-services-docx.mjs.map +1 -1
  122. package/fesm2022/sdcorejs-angular-services-loading.mjs +339 -74
  123. package/fesm2022/sdcorejs-angular-services-loading.mjs.map +1 -1
  124. package/fesm2022/sdcorejs-angular-services-notify.mjs +7 -10
  125. package/fesm2022/sdcorejs-angular-services-notify.mjs.map +1 -1
  126. package/fesm2022/sdcorejs-angular-services-persistence.mjs +899 -0
  127. package/fesm2022/sdcorejs-angular-services-persistence.mjs.map +1 -0
  128. package/fesm2022/sdcorejs-angular-services-storage.mjs +324 -122
  129. package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
  130. package/fesm2022/sdcorejs-angular-services-task.mjs +389 -0
  131. package/fesm2022/sdcorejs-angular-services-task.mjs.map +1 -0
  132. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs +255 -0
  133. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs.map +1 -0
  134. package/fesm2022/sdcorejs-angular-services-viewport.mjs +76 -0
  135. package/fesm2022/sdcorejs-angular-services-viewport.mjs.map +1 -0
  136. package/fesm2022/sdcorejs-angular-services.mjs +4 -0
  137. package/fesm2022/sdcorejs-angular-services.mjs.map +1 -1
  138. package/forms/autocomplete/index.d.ts +3 -4
  139. package/forms/checkbox/index.d.ts +4 -8
  140. package/forms/date/index.d.ts +2 -2
  141. package/forms/date-range/index.d.ts +6 -7
  142. package/forms/datetime/index.d.ts +2 -2
  143. package/forms/entity-picker/index.d.ts +128 -0
  144. package/forms/index.d.ts +15 -5
  145. package/forms/input/index.d.ts +74 -11
  146. package/forms/input-number/index.d.ts +1 -1
  147. package/forms/models/index.d.ts +86 -3
  148. package/forms/radio/index.d.ts +12 -8
  149. package/forms/switch/index.d.ts +4 -7
  150. package/forms/time/index.d.ts +117 -0
  151. package/forms/time-range/index.d.ts +98 -0
  152. package/forms/tree-select/index.d.ts +76 -0
  153. package/i18n/index.d.ts +72 -2
  154. package/interceptors/index.d.ts +5 -6
  155. package/modules/layout/index.d.ts +354 -17
  156. package/package.json +49 -1
  157. package/pipes/index.d.ts +2 -2
  158. package/services/api/index.d.ts +68 -24
  159. package/services/cache/index.d.ts +52 -16
  160. package/services/confirm/index.d.ts +3 -2
  161. package/services/docx/index.d.ts +2 -3
  162. package/services/index.d.ts +4 -0
  163. package/services/loading/index.d.ts +16 -8
  164. package/services/persistence/index.d.ts +159 -0
  165. package/services/storage/index.d.ts +26 -8
  166. package/services/task/index.d.ts +104 -0
  167. package/services/unsaved-changes/index.d.ts +83 -0
  168. package/services/viewport/index.d.ts +42 -0
@@ -2,9 +2,9 @@ import { Utilities } from '@sdcorejs/utils/fns';
2
2
  import * as i1 from '@angular/common';
3
3
  import { CommonModule } from '@angular/common';
4
4
  import * as i0 from '@angular/core';
5
- import { inject, ChangeDetectorRef, input, booleanAttribute, model, contentChild, output, computed, effect, ChangeDetectionStrategy, Component } from '@angular/core';
5
+ import { inject, ChangeDetectorRef, input, booleanAttribute, model, contentChild, output, computed, ChangeDetectionStrategy, Component } from '@angular/core';
6
6
  import * as i2 from '@angular/forms';
7
- import { NgForm, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
7
+ import { Validators, ReactiveFormsModule } from '@angular/forms';
8
8
  import * as i3 from '@angular/material/form-field';
9
9
  import { MatFormFieldModule } from '@angular/material/form-field';
10
10
  import * as i4 from '@angular/material/radio';
@@ -12,7 +12,7 @@ import { MatRadioModule } from '@angular/material/radio';
12
12
  import { MatTooltipModule } from '@angular/material/tooltip';
13
13
  import { Subscription } from 'rxjs';
14
14
  import { SdSuffixDefDirective, SdLabelDefDirective, SdViewDefDirective } from '@sdcorejs/angular/forms/directives';
15
- import { SdFormControl, sdViewedTransform, sdViewedInline, sdFormControlState, SdInlineErrorValidator } from '@sdcorejs/angular/forms/models';
15
+ import { SdFormControl, sdViewedTransform, sdViewedInline, sdFormControlState, ɵsdFormControlConnector as _sdFormControlConnector, SdInlineErrorValidator } from '@sdcorejs/angular/forms/models';
16
16
  import { sdIsEmpty, sdSerializeDataValue } from '@sdcorejs/angular/utilities/data-state';
17
17
  import { TranslatePipe } from '@sdcorejs/angular/i18n';
18
18
  import { SdEmptyPipe } from '@sdcorejs/angular/pipes';
@@ -22,7 +22,9 @@ import { SdHrefDirective } from '@sdcorejs/angular/directives';
22
22
  class SdRadio {
23
23
  #ref = inject(ChangeDetectorRef);
24
24
  id = `I${Utilities.generateUuid()}`;
25
- #name = Utilities.generateUuid();
25
+ labelId = `${this.id}-label`;
26
+ errorId = `${this.id}-error`;
27
+ #defaultName = Utilities.generateUuid();
26
28
  formControl = new SdFormControl();
27
29
  #subscription = new Subscription();
28
30
  // Inputs — accept null|undefined at boundary, transform to canonical
@@ -34,31 +36,7 @@ class SdRadio {
34
36
  name = input(undefined, ...(ngDevMode ? [{ debugName: "name", transform: (v) => v ?? undefined }] : [{
35
37
  transform: (v) => v ?? undefined,
36
38
  }]));
37
- // why: parent may bind NgForm (template-driven), FormGroup (reactive), or a wrapper with `.form`.
38
- // Transform once at the input boundary so the rest of the component only deals with FormGroup.
39
- form = input(undefined, ...(ngDevMode ? [{ debugName: "form", transform: (val) => {
40
- if (!val)
41
- return undefined;
42
- if (val instanceof NgForm)
43
- return val.form;
44
- if (val instanceof FormGroup)
45
- return val;
46
- if (val?.form instanceof FormGroup)
47
- return val.form;
48
- return undefined;
49
- } }] : [{
50
- transform: (val) => {
51
- if (!val)
52
- return undefined;
53
- if (val instanceof NgForm)
54
- return val.form;
55
- if (val instanceof FormGroup)
56
- return val;
57
- if (val?.form instanceof FormGroup)
58
- return val.form;
59
- return undefined;
60
- },
61
- }]));
39
+ form = input(undefined, ...(ngDevMode ? [{ debugName: "form" }] : []));
62
40
  label = input(undefined, ...(ngDevMode ? [{ debugName: "label", transform: (v) => v ?? undefined }] : [{
63
41
  transform: (v) => v ?? undefined,
64
42
  }]));
@@ -110,6 +88,19 @@ class SdRadio {
110
88
  dataEmpty = computed(() => (sdIsEmpty(this.#state().value) ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "dataEmpty" }] : []));
111
89
  dataValue = computed(() => sdSerializeDataValue(this.#state().value), ...(ngDevMode ? [{ debugName: "dataValue" }] : []));
112
90
  dataRequired = computed(() => (this.required() ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "dataRequired" }] : []));
91
+ visibleError = computed(() => {
92
+ if (!this.#state().touched)
93
+ return undefined;
94
+ if (this.formControl.hasError('required'))
95
+ return 'required';
96
+ if (this.formControl.hasError('inlineError'))
97
+ return 'inlineError';
98
+ return undefined;
99
+ }, ...(ngDevMode ? [{ debugName: "visibleError" }] : []));
100
+ ariaLabelledBy = computed(() => (this.sdLabelDef()?.templateRef || this.label() ? this.labelId : undefined), ...(ngDevMode ? [{ debugName: "ariaLabelledBy" }] : []));
101
+ ariaLabel = computed(() => (this.ariaLabelledBy() ? undefined : this.placeholder() || undefined), ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
102
+ ariaDescribedBy = computed(() => (this.visibleError() ? this.errorId : undefined), ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : []));
103
+ ariaInvalid = computed(() => (this.#state().invalid ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "ariaInvalid" }] : []));
113
104
  viewedText = computed(() => {
114
105
  const items = this.items();
115
106
  const vField = this.valueField();
@@ -118,68 +109,43 @@ class SdRadio {
118
109
  const match = items.find(e => this.formControl?.value?.toString() === e?.[vField]?.toString());
119
110
  return match?.[dField] ?? '';
120
111
  }, ...(ngDevMode ? [{ debugName: "viewedText" }] : []));
121
- constructor() {
122
- effect(() => {
123
- const val = this.name();
124
- if (val)
125
- this.#name = val;
126
- });
127
- effect(() => {
128
- const value = this.model();
129
- if (value !== this.formControl.value) {
130
- this.formControl.setValue(value, { emitEvent: false });
131
- }
132
- });
133
- effect(() => {
134
- if (this.disabled())
135
- this.formControl.disable();
136
- else
137
- this.formControl.enable();
138
- });
139
- effect(() => {
140
- this.required();
141
- this.inlineError();
142
- this.#updateValidator();
143
- });
144
- }
145
- ngOnInit() {
146
- this.#subscription.add(this.formControl.sdChanges.subscribe(() => {
147
- this.#ref.markForCheck();
148
- }));
149
- }
150
- ngAfterViewInit() {
151
- this.#subscription.add(this.formControl.valueChanges.subscribe(value => {
112
+ #formConnector = _sdFormControlConnector({
113
+ form: this.form,
114
+ name: computed(() => this.name() || this.#defaultName),
115
+ control: computed(() => this.formControl),
116
+ model: this.model,
117
+ writeModel: value => {
152
118
  const vField = this.valueField();
153
119
  this.model.set(value);
154
120
  this.sdChange.emit(value);
155
121
  this.sdSelection.emit({
156
122
  value,
157
- item: this.items().find(e => value?.toString() === e?.[vField]?.toString()),
123
+ item: this.items().find(item => value?.toString() === item?.[vField]?.toString()),
158
124
  });
125
+ },
126
+ validators: computed(() => {
127
+ const validators = [];
128
+ if (this.required())
129
+ validators.push(Validators.required);
130
+ if (this.inlineError())
131
+ validators.push(SdInlineErrorValidator);
132
+ return validators;
133
+ }),
134
+ disabled: this.disabled,
135
+ });
136
+ ngOnInit() {
137
+ this.#subscription.add(this.formControl.sdChanges.subscribe(() => {
138
+ this.#ref.markForCheck();
159
139
  }));
160
- this.form()?.addControl(this.#name, this.formControl);
161
140
  }
162
141
  ngOnDestroy() {
163
142
  this.#subscription.unsubscribe();
164
- this.form()?.removeControl(this.#name);
165
143
  }
166
- #updateValidator = () => {
167
- this.formControl.clearValidators();
168
- const validators = [];
169
- if (this.required()) {
170
- validators.push(Validators.required);
171
- }
172
- if (this.inlineError()) {
173
- validators.push(SdInlineErrorValidator);
174
- }
175
- this.formControl.setValidators(validators);
176
- this.formControl.updateValueAndValidity();
177
- };
178
144
  reValidate = () => {
179
145
  this.formControl.updateValueAndValidity({ emitEvent: true });
180
146
  };
181
147
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdRadio, deps: [], target: i0.ɵɵFactoryTarget.Component });
182
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdRadio, isStandalone: true, selector: "sd-radio", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: true, transformFunction: null }, displayField: { classPropertyName: "displayField", publicName: "displayField", isSignal: true, isRequired: true, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, inlineError: { classPropertyName: "inlineError", publicName: "inlineError", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, viewed: { classPropertyName: "viewed", publicName: "viewed", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, hyperlink: { classPropertyName: "hyperlink", publicName: "hyperlink", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange", sdChange: "sdChange", sdSelection: "sdSelection" }, host: { properties: { "class.sd-c-primary": "color() === 'primary'", "class.sd-c-secondary": "color() === 'secondary'", "class.sd-c-info": "color() === 'info'", "class.sd-c-success": "color() === 'success'", "class.sd-c-warning": "color() === 'warning'", "class.sd-c-error": "color() === 'error'" } }, queries: [{ propertyName: "sdSuffixDef", first: true, predicate: SdSuffixDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true, isSignal: true }, { propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }], ngImport: i0, template: "@let _sdLabelDef = sdLabelDef();\n@let _label = label();\n@let _display = display();\n@let _valueField = valueField();\n@let _hyperlink = hyperlink();\n\n@if (isViewed()) {\n @if (_sdLabelDef?.templateRef) {\n <ng-container *ngTemplateOutlet=\"_sdLabelDef!.templateRef\"> </ng-container>\n } @else if (_label) {\n <div class=\"T14R text-secondary\">{{ _label }}</div>\n }\n @if (_hyperlink) {\n <!-- N\u1EBFu c\u00F3 hyperlink th\u00EC d\u00F9ng th\u1EBB a -->\n <a [sdHref]=\"_hyperlink!\">{{ viewedText() }}</a>\n } @else {\n <!-- Ngo\u00E0i ra d\u00F9ng th\u1EBB m\u1EB7c \u0111\u1ECBnh -->\n <div class=\"T14M\">{{ viewedText() | sdEmpty }}</div>\n }\n} @else {\n <section [ngClass]=\"{ 'c-section': _display === 'row' }\">\n @if (_sdLabelDef?.templateRef) {\n <ng-container *ngTemplateOutlet=\"_sdLabelDef!.templateRef\"> </ng-container>\n } @else if (_label) {\n <sd-label [label]=\"_label!\" [required]=\"required()\"></sd-label>\n }\n <mat-radio-group\n [class.c-radio-group-column]=\"_display === 'column'\"\n [class.c-radio-group-row]=\"_display === 'row'\"\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\">\n @for (item of normalizedItems(); track item[valueField()]) {\n <mat-radio-button [class.m-0]=\"_display === 'column'\" [class.mr-16]=\"_display === 'row'\" [value]=\"item[_valueField]\">\n {{ item[displayField()] }}\n </mat-radio-button>\n }\n </mat-radio-group>\n\n @if (formControl.errors?.['required'] && formControl.touched) {\n <mat-error>\n {{ 'core.form.radio.required' | translate }}\n </mat-error>\n } @else if (formControl.errors?.['inlineError'] && formControl.touched) {\n <mat-error>\n {{ inlineError() }}\n </mat-error>\n }\n </section>\n}\n", styles: [":host{height:100%;display:flex;flex-direction:column}:host ::ng-deep label.mdc-label{margin-bottom:0}:host{--sd-c: var(--sd-primary)}:host(.sd-c-secondary){--sd-c: var(--sd-secondary)}:host(.sd-c-info){--sd-c: var(--sd-info)}:host(.sd-c-success){--sd-c: var(--sd-success)}:host(.sd-c-warning){--sd-c: var(--sd-warning)}:host(.sd-c-error){--sd-c: var(--sd-error)}:host ::ng-deep .mat-mdc-radio-button,:host ::ng-deep .mat-mdc-radio-group,:host ::ng-deep .mdc-radio{--mdc-radio-selected-icon-color: var(--sd-c) !important;--mdc-radio-selected-focus-icon-color: var(--sd-c) !important;--mdc-radio-selected-hover-icon-color: var(--sd-c) !important;--mdc-radio-selected-pressed-icon-color: var(--sd-c) !important;--mdc-radio-selected-focus-state-layer-color: var(--sd-c) !important;--mdc-radio-selected-hover-state-layer-color: var(--sd-c) !important;--mat-radio-selected-icon-color: var(--sd-c) !important;--mat-radio-selected-focus-icon-color: var(--sd-c) !important;--mat-radio-selected-hover-icon-color: var(--sd-c) !important;--mat-radio-selected-pressed-icon-color: var(--sd-c) !important;--mat-radio-checked-ripple-color: var(--sd-c) !important;--mat-radio-checked-state-layer-color: var(--sd-c) !important}.c-section{align-content:center;align-items:center}.c-radio-group-column{flex:1;display:flex;flex-direction:column;align-items:flex-start}.c-radio-group-row{flex:1;display:flex;flex-direction:row;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i4.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i4.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "directive", type: SdHrefDirective, selector: "a[sdHref]", inputs: ["sdHref"] }, { kind: "pipe", type: SdEmptyPipe, name: "sdEmpty" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
148
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdRadio, isStandalone: true, selector: "sd-radio", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: true, transformFunction: null }, displayField: { classPropertyName: "displayField", publicName: "displayField", isSignal: true, isRequired: true, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, inlineError: { classPropertyName: "inlineError", publicName: "inlineError", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, viewed: { classPropertyName: "viewed", publicName: "viewed", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, hyperlink: { classPropertyName: "hyperlink", publicName: "hyperlink", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange", sdChange: "sdChange", sdSelection: "sdSelection" }, host: { properties: { "class.sd-c-primary": "color() === 'primary'", "class.sd-c-secondary": "color() === 'secondary'", "class.sd-c-info": "color() === 'info'", "class.sd-c-success": "color() === 'success'", "class.sd-c-warning": "color() === 'warning'", "class.sd-c-error": "color() === 'error'" } }, queries: [{ propertyName: "sdSuffixDef", first: true, predicate: SdSuffixDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true, isSignal: true }, { propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }], ngImport: i0, template: "@let _sdLabelDef = sdLabelDef();\n@let _sdSuffixDef = sdSuffixDef();\n@let _label = label();\n@let _display = display();\n@let _valueField = valueField();\n@let _hyperlink = hyperlink();\n\n@if (isViewed()) {\n @if (_sdLabelDef?.templateRef) {\n <ng-container *ngTemplateOutlet=\"_sdLabelDef!.templateRef\"> </ng-container>\n } @else if (_label) {\n <div class=\"T14R text-secondary\">{{ _label }}</div>\n }\n @if (_hyperlink) {\n <!-- N\u1EBFu c\u00F3 hyperlink th\u00EC d\u00F9ng th\u1EBB a -->\n <a [sdHref]=\"_hyperlink!\">{{ viewedText() || placeholder() }}</a>\n } @else {\n <!-- Ngo\u00E0i ra d\u00F9ng th\u1EBB m\u1EB7c \u0111\u1ECBnh -->\n <div class=\"T14M\">{{ viewedText() || placeholder() | sdEmpty }}</div>\n }\n} @else {\n <section [ngClass]=\"{ 'c-section': _display === 'row' }\">\n @if (_sdLabelDef?.templateRef) {\n <div [id]=\"labelId\"><ng-container *ngTemplateOutlet=\"_sdLabelDef!.templateRef\"> </ng-container></div>\n } @else if (_label) {\n <sd-label [attr.id]=\"labelId\" [label]=\"_label!\" [required]=\"required()\"></sd-label>\n }\n <mat-radio-group\n [class.c-radio-group-column]=\"_display === 'column'\"\n [class.c-radio-group-row]=\"_display === 'row'\"\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [attr.aria-required]=\"dataRequired()\">\n @for (item of normalizedItems(); track item[valueField()]) {\n <mat-radio-button [class.m-0]=\"_display === 'column'\" [class.mr-16]=\"_display === 'row'\" [value]=\"item[_valueField]\">\n {{ item[displayField()] }}\n </mat-radio-button>\n }\n </mat-radio-group>\n\n @if (_sdSuffixDef?.templateRef) {\n <ng-container *ngTemplateOutlet=\"_sdSuffixDef!.templateRef\"> </ng-container>\n }\n\n @if (visibleError() === 'required') {\n <mat-error [id]=\"errorId\">\n {{ 'core.form.radio.required' | translate }}\n </mat-error>\n } @else if (visibleError() === 'inlineError') {\n <mat-error [id]=\"errorId\">\n {{ inlineError() }}\n </mat-error>\n }\n </section>\n}\n", styles: [":host{height:100%;display:flex;flex-direction:column}:host ::ng-deep label.mdc-label{margin-bottom:0}:host{--sd-c: var(--sd-primary)}:host(.sd-c-secondary){--sd-c: var(--sd-secondary)}:host(.sd-c-info){--sd-c: var(--sd-info)}:host(.sd-c-success){--sd-c: var(--sd-success)}:host(.sd-c-warning){--sd-c: var(--sd-warning)}:host(.sd-c-error){--sd-c: var(--sd-error)}:host ::ng-deep .mat-mdc-radio-button,:host ::ng-deep .mat-mdc-radio-group,:host ::ng-deep .mdc-radio{--mdc-radio-selected-icon-color: var(--sd-c) !important;--mdc-radio-selected-focus-icon-color: var(--sd-c) !important;--mdc-radio-selected-hover-icon-color: var(--sd-c) !important;--mdc-radio-selected-pressed-icon-color: var(--sd-c) !important;--mdc-radio-selected-focus-state-layer-color: var(--sd-c) !important;--mdc-radio-selected-hover-state-layer-color: var(--sd-c) !important;--mat-radio-selected-icon-color: var(--sd-c) !important;--mat-radio-selected-focus-icon-color: var(--sd-c) !important;--mat-radio-selected-hover-icon-color: var(--sd-c) !important;--mat-radio-selected-pressed-icon-color: var(--sd-c) !important;--mat-radio-checked-ripple-color: var(--sd-c) !important;--mat-radio-checked-state-layer-color: var(--sd-c) !important}.c-section{align-content:center;align-items:center}.c-radio-group-column{flex:1;display:flex;flex-direction:column;align-items:flex-start}.c-radio-group-row{flex:1;display:flex;flex-direction:row;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i4.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i4.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "directive", type: SdHrefDirective, selector: "a[sdHref]", inputs: ["sdHref"] }, { kind: "pipe", type: SdEmptyPipe, name: "sdEmpty" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
183
149
  }
184
150
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdRadio, decorators: [{
185
151
  type: Component,
@@ -202,8 +168,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
202
168
  SdEmptyPipe,
203
169
  SdHrefDirective,
204
170
  TranslatePipe,
205
- ], template: "@let _sdLabelDef = sdLabelDef();\n@let _label = label();\n@let _display = display();\n@let _valueField = valueField();\n@let _hyperlink = hyperlink();\n\n@if (isViewed()) {\n @if (_sdLabelDef?.templateRef) {\n <ng-container *ngTemplateOutlet=\"_sdLabelDef!.templateRef\"> </ng-container>\n } @else if (_label) {\n <div class=\"T14R text-secondary\">{{ _label }}</div>\n }\n @if (_hyperlink) {\n <!-- N\u1EBFu c\u00F3 hyperlink th\u00EC d\u00F9ng th\u1EBB a -->\n <a [sdHref]=\"_hyperlink!\">{{ viewedText() }}</a>\n } @else {\n <!-- Ngo\u00E0i ra d\u00F9ng th\u1EBB m\u1EB7c \u0111\u1ECBnh -->\n <div class=\"T14M\">{{ viewedText() | sdEmpty }}</div>\n }\n} @else {\n <section [ngClass]=\"{ 'c-section': _display === 'row' }\">\n @if (_sdLabelDef?.templateRef) {\n <ng-container *ngTemplateOutlet=\"_sdLabelDef!.templateRef\"> </ng-container>\n } @else if (_label) {\n <sd-label [label]=\"_label!\" [required]=\"required()\"></sd-label>\n }\n <mat-radio-group\n [class.c-radio-group-column]=\"_display === 'column'\"\n [class.c-radio-group-row]=\"_display === 'row'\"\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\">\n @for (item of normalizedItems(); track item[valueField()]) {\n <mat-radio-button [class.m-0]=\"_display === 'column'\" [class.mr-16]=\"_display === 'row'\" [value]=\"item[_valueField]\">\n {{ item[displayField()] }}\n </mat-radio-button>\n }\n </mat-radio-group>\n\n @if (formControl.errors?.['required'] && formControl.touched) {\n <mat-error>\n {{ 'core.form.radio.required' | translate }}\n </mat-error>\n } @else if (formControl.errors?.['inlineError'] && formControl.touched) {\n <mat-error>\n {{ inlineError() }}\n </mat-error>\n }\n </section>\n}\n", styles: [":host{height:100%;display:flex;flex-direction:column}:host ::ng-deep label.mdc-label{margin-bottom:0}:host{--sd-c: var(--sd-primary)}:host(.sd-c-secondary){--sd-c: var(--sd-secondary)}:host(.sd-c-info){--sd-c: var(--sd-info)}:host(.sd-c-success){--sd-c: var(--sd-success)}:host(.sd-c-warning){--sd-c: var(--sd-warning)}:host(.sd-c-error){--sd-c: var(--sd-error)}:host ::ng-deep .mat-mdc-radio-button,:host ::ng-deep .mat-mdc-radio-group,:host ::ng-deep .mdc-radio{--mdc-radio-selected-icon-color: var(--sd-c) !important;--mdc-radio-selected-focus-icon-color: var(--sd-c) !important;--mdc-radio-selected-hover-icon-color: var(--sd-c) !important;--mdc-radio-selected-pressed-icon-color: var(--sd-c) !important;--mdc-radio-selected-focus-state-layer-color: var(--sd-c) !important;--mdc-radio-selected-hover-state-layer-color: var(--sd-c) !important;--mat-radio-selected-icon-color: var(--sd-c) !important;--mat-radio-selected-focus-icon-color: var(--sd-c) !important;--mat-radio-selected-hover-icon-color: var(--sd-c) !important;--mat-radio-selected-pressed-icon-color: var(--sd-c) !important;--mat-radio-checked-ripple-color: var(--sd-c) !important;--mat-radio-checked-state-layer-color: var(--sd-c) !important}.c-section{align-content:center;align-items:center}.c-radio-group-column{flex:1;display:flex;flex-direction:column;align-items:flex-start}.c-radio-group-row{flex:1;display:flex;flex-direction:row;align-items:center}\n"] }]
206
- }], ctorParameters: () => [], propDecorators: { autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], display: [{ type: i0.Input, args: [{ isSignal: true, alias: "display", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: true }] }], displayField: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayField", required: true }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], inlineError: [{ type: i0.Input, args: [{ isSignal: true, alias: "inlineError", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], viewed: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewed", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], hyperlink: [{ type: i0.Input, args: [{ isSignal: true, alias: "hyperlink", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }], sdSuffixDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdSuffixDefDirective), { isSignal: true }] }], sdLabelDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdLabelDefDirective), { isSignal: true }] }], sdViewDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdViewDefDirective), { isSignal: true }] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }], sdSelection: [{ type: i0.Output, args: ["sdSelection"] }] } });
171
+ ], template: "@let _sdLabelDef = sdLabelDef();\n@let _sdSuffixDef = sdSuffixDef();\n@let _label = label();\n@let _display = display();\n@let _valueField = valueField();\n@let _hyperlink = hyperlink();\n\n@if (isViewed()) {\n @if (_sdLabelDef?.templateRef) {\n <ng-container *ngTemplateOutlet=\"_sdLabelDef!.templateRef\"> </ng-container>\n } @else if (_label) {\n <div class=\"T14R text-secondary\">{{ _label }}</div>\n }\n @if (_hyperlink) {\n <!-- N\u1EBFu c\u00F3 hyperlink th\u00EC d\u00F9ng th\u1EBB a -->\n <a [sdHref]=\"_hyperlink!\">{{ viewedText() || placeholder() }}</a>\n } @else {\n <!-- Ngo\u00E0i ra d\u00F9ng th\u1EBB m\u1EB7c \u0111\u1ECBnh -->\n <div class=\"T14M\">{{ viewedText() || placeholder() | sdEmpty }}</div>\n }\n} @else {\n <section [ngClass]=\"{ 'c-section': _display === 'row' }\">\n @if (_sdLabelDef?.templateRef) {\n <div [id]=\"labelId\"><ng-container *ngTemplateOutlet=\"_sdLabelDef!.templateRef\"> </ng-container></div>\n } @else if (_label) {\n <sd-label [attr.id]=\"labelId\" [label]=\"_label!\" [required]=\"required()\"></sd-label>\n }\n <mat-radio-group\n [class.c-radio-group-column]=\"_display === 'column'\"\n [class.c-radio-group-row]=\"_display === 'row'\"\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [attr.aria-required]=\"dataRequired()\">\n @for (item of normalizedItems(); track item[valueField()]) {\n <mat-radio-button [class.m-0]=\"_display === 'column'\" [class.mr-16]=\"_display === 'row'\" [value]=\"item[_valueField]\">\n {{ item[displayField()] }}\n </mat-radio-button>\n }\n </mat-radio-group>\n\n @if (_sdSuffixDef?.templateRef) {\n <ng-container *ngTemplateOutlet=\"_sdSuffixDef!.templateRef\"> </ng-container>\n }\n\n @if (visibleError() === 'required') {\n <mat-error [id]=\"errorId\">\n {{ 'core.form.radio.required' | translate }}\n </mat-error>\n } @else if (visibleError() === 'inlineError') {\n <mat-error [id]=\"errorId\">\n {{ inlineError() }}\n </mat-error>\n }\n </section>\n}\n", styles: [":host{height:100%;display:flex;flex-direction:column}:host ::ng-deep label.mdc-label{margin-bottom:0}:host{--sd-c: var(--sd-primary)}:host(.sd-c-secondary){--sd-c: var(--sd-secondary)}:host(.sd-c-info){--sd-c: var(--sd-info)}:host(.sd-c-success){--sd-c: var(--sd-success)}:host(.sd-c-warning){--sd-c: var(--sd-warning)}:host(.sd-c-error){--sd-c: var(--sd-error)}:host ::ng-deep .mat-mdc-radio-button,:host ::ng-deep .mat-mdc-radio-group,:host ::ng-deep .mdc-radio{--mdc-radio-selected-icon-color: var(--sd-c) !important;--mdc-radio-selected-focus-icon-color: var(--sd-c) !important;--mdc-radio-selected-hover-icon-color: var(--sd-c) !important;--mdc-radio-selected-pressed-icon-color: var(--sd-c) !important;--mdc-radio-selected-focus-state-layer-color: var(--sd-c) !important;--mdc-radio-selected-hover-state-layer-color: var(--sd-c) !important;--mat-radio-selected-icon-color: var(--sd-c) !important;--mat-radio-selected-focus-icon-color: var(--sd-c) !important;--mat-radio-selected-hover-icon-color: var(--sd-c) !important;--mat-radio-selected-pressed-icon-color: var(--sd-c) !important;--mat-radio-checked-ripple-color: var(--sd-c) !important;--mat-radio-checked-state-layer-color: var(--sd-c) !important}.c-section{align-content:center;align-items:center}.c-radio-group-column{flex:1;display:flex;flex-direction:column;align-items:flex-start}.c-radio-group-row{flex:1;display:flex;flex-direction:row;align-items:center}\n"] }]
172
+ }], propDecorators: { autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], display: [{ type: i0.Input, args: [{ isSignal: true, alias: "display", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: true }] }], displayField: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayField", required: true }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], inlineError: [{ type: i0.Input, args: [{ isSignal: true, alias: "inlineError", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], viewed: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewed", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], hyperlink: [{ type: i0.Input, args: [{ isSignal: true, alias: "hyperlink", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }], sdSuffixDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdSuffixDefDirective), { isSignal: true }] }], sdLabelDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdLabelDefDirective), { isSignal: true }] }], sdViewDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdViewDefDirective), { isSignal: true }] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }], sdSelection: [{ type: i0.Output, args: ["sdSelection"] }] } });
207
173
 
208
174
  /**
209
175
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"sdcorejs-angular-forms-radio.mjs","sources":["../../../projects/sdcorejs-angular/forms/radio/src/radio.component.ts","../../../projects/sdcorejs-angular/forms/radio/src/radio.component.html","../../../projects/sdcorejs-angular/forms/radio/sdcorejs-angular-forms-radio.ts"],"sourcesContent":["import { Utilities } from '@sdcorejs/utils/fns';\n\nimport { CommonModule } from '@angular/common';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n contentChild,\n effect,\n inject,\n input,\n model,\n OnDestroy,\n OnInit,\n output,\n} from '@angular/core';\nimport { FormGroup, NgForm, ReactiveFormsModule, ValidatorFn, Validators } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { Subscription } from 'rxjs';\n\nimport { SdLabelDefDirective, SdSuffixDefDirective, SdViewDefDirective } from '@sdcorejs/angular/forms/directives';\n\nimport {\n SdFormControl,\n SdInlineErrorValidator,\n sdFormControlState,\n SdViewed,\n SdViewedInput,\n sdViewedInline,\n sdViewedTransform,\n} from '@sdcorejs/angular/forms/models';\nimport { sdIsEmpty, sdSerializeDataValue } from '@sdcorejs/angular/utilities/data-state';\nimport { Color } from '@sdcorejs/utils/models';\nimport { TranslatePipe } from '@sdcorejs/angular/i18n';\nimport { SdEmptyPipe } from '@sdcorejs/angular/pipes';\nimport { SdLabel } from '@sdcorejs/angular/forms/label';\nimport { SdHrefDirective } from '@sdcorejs/angular/directives';\n\n@Component({\n selector: 'sd-radio',\n templateUrl: './radio.component.html',\n styleUrl: './radio.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n host: {\n // why: host class .sd-c-<x> + default sd-c-primary cho fallback. Thay data-sd-color\n // để tránh edge case host-attr-binding không reactive trong vài cảnh build pipeline.\n '[class.sd-c-primary]': \"color() === 'primary'\",\n '[class.sd-c-secondary]': \"color() === 'secondary'\",\n '[class.sd-c-info]': \"color() === 'info'\",\n '[class.sd-c-success]': \"color() === 'success'\",\n '[class.sd-c-warning]': \"color() === 'warning'\",\n '[class.sd-c-error]': \"color() === 'error'\",\n },\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatTooltipModule,\n MatFormFieldModule,\n MatRadioModule,\n SdLabel,\n SdEmptyPipe,\n SdHrefDirective,\n TranslatePipe,\n ],\n})\nexport class SdRadio implements OnInit, AfterViewInit, OnDestroy {\n readonly #ref = inject(ChangeDetectorRef);\n\n id = `I${Utilities.generateUuid()}`;\n #name = Utilities.generateUuid();\n formControl = new SdFormControl();\n #subscription = new Subscription();\n\n // Inputs — accept null|undefined at boundary, transform to canonical\n readonly autoIdInput = input<string | undefined, string | null | undefined>(undefined, {\n alias: 'autoId',\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly name = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n // why: parent may bind NgForm (template-driven), FormGroup (reactive), or a wrapper with `.form`.\n // Transform once at the input boundary so the rest of the component only deals with FormGroup.\n readonly form = input<FormGroup | undefined, any>(undefined, {\n transform: (val: any): FormGroup | undefined => {\n if (!val) return undefined;\n if (val instanceof NgForm) return val.form;\n if (val instanceof FormGroup) return val;\n if (val?.form instanceof FormGroup) return val.form;\n return undefined;\n },\n });\n readonly label = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly placeholder = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly display = input<'row' | 'column', 'row' | 'column' | null | undefined>('row', {\n transform: (v): 'row' | 'column' => v || 'row',\n });\n readonly items = input<any[], any[] | null | undefined>([], {\n transform: (v): any[] => (Array.isArray(v) ? v : []),\n });\n readonly valueField = input.required<string>();\n readonly displayField = input.required<string>();\n readonly required = input(false, { transform: booleanAttribute });\n readonly inlineError = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Display mode: `false` edit · `true` static view · `'inline'` interactive (disabled `'inline'` → static). */\n readonly viewed = input<SdViewed, SdViewedInput>(false, { transform: sdViewedTransform });\n\n // why: tri-state viewed — `'inline'` keeps the radio group interactive; disabled `'inline'` → static.\n readonly #viewedState = sdViewedInline(this.viewed, undefined, this.disabled);\n /** `true` when the static read-only view should render. */\n readonly isViewed = this.#viewedState.isViewed;\n // why: legacy callers pass `null` → fallback to 'primary'. Color enum mở rộng hơn ThemePalette,\n // áp dụng qua host attr [data-sd-color] + SCSS override MDC token vars (mat [color] không nhận 'success'/'info'/...).\n readonly color = input<Color, Color | null | undefined>('primary', {\n transform: (v): Color => v || 'primary',\n });\n readonly hyperlink = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n\n // Two-way model\n readonly model = model<number | string | boolean | undefined | null>(undefined);\n\n // Content children\n readonly sdSuffixDef = contentChild(SdSuffixDefDirective);\n readonly sdLabelDef = contentChild(SdLabelDefDirective);\n readonly sdViewDef = contentChild(SdViewDefDirective);\n\n // Outputs (modelChange auto-generated by model() signal)\n readonly sdChange = output<unknown>();\n readonly sdSelection = output<{ value: any | any[]; item?: any }>();\n\n // Computed (template bindings)\n readonly autoId = computed(() => (this.autoIdInput() ? `forms-radio-${this.autoIdInput()}` : undefined));\n // Kept for back-compat with templates that read `normalizedItems()` — alias of items()\n readonly normalizedItems = computed(() => this.items());\n readonly #state = sdFormControlState(computed(() => this.formControl));\n readonly dataDisabled = computed(() => (this.#state().disabled ? 'true' : 'false'));\n readonly dataEmpty = computed(() => (sdIsEmpty(this.#state().value) ? 'true' : 'false'));\n readonly dataValue = computed(() => sdSerializeDataValue(this.#state().value));\n readonly dataRequired = computed(() => (this.required() ? 'true' : 'false'));\n\n readonly viewedText = computed(() => {\n const items = this.items();\n const vField = this.valueField();\n const dField = this.displayField();\n // why: tìm item match value rồi trả về string ở `displayField`, không trả nguyên object (sẽ in [object Object]).\n const match = items.find(e => this.formControl?.value?.toString() === e?.[vField]?.toString());\n return match?.[dField] ?? '';\n });\n\n constructor() {\n effect(() => {\n const val = this.name();\n if (val) this.#name = val;\n });\n\n effect(() => {\n const value = this.model();\n if (value !== this.formControl.value) {\n this.formControl.setValue(value, { emitEvent: false });\n }\n });\n\n effect(() => {\n if (this.disabled()) this.formControl.disable();\n else this.formControl.enable();\n });\n\n effect(() => {\n this.required();\n this.inlineError();\n this.#updateValidator();\n });\n }\n\n ngOnInit() {\n this.#subscription.add(\n this.formControl.sdChanges.subscribe(() => {\n this.#ref.markForCheck();\n })\n );\n }\n\n ngAfterViewInit() {\n this.#subscription.add(\n this.formControl.valueChanges.subscribe(value => {\n const vField = this.valueField();\n this.model.set(value);\n this.sdChange.emit(value);\n this.sdSelection.emit({\n value,\n item: this.items().find(e => value?.toString() === e?.[vField]?.toString()),\n });\n })\n );\n this.form()?.addControl(this.#name, this.formControl);\n }\n\n ngOnDestroy() {\n this.#subscription.unsubscribe();\n this.form()?.removeControl(this.#name);\n }\n\n #updateValidator = () => {\n this.formControl.clearValidators();\n const validators: ValidatorFn[] = [];\n if (this.required()) {\n validators.push(Validators.required);\n }\n if (this.inlineError()) {\n validators.push(SdInlineErrorValidator);\n }\n this.formControl.setValidators(validators);\n this.formControl.updateValueAndValidity();\n };\n\n reValidate = () => {\n this.formControl.updateValueAndValidity({ emitEvent: true });\n };\n}\n","@let _sdLabelDef = sdLabelDef();\n@let _label = label();\n@let _display = display();\n@let _valueField = valueField();\n@let _hyperlink = hyperlink();\n\n@if (isViewed()) {\n @if (_sdLabelDef?.templateRef) {\n <ng-container *ngTemplateOutlet=\"_sdLabelDef!.templateRef\"> </ng-container>\n } @else if (_label) {\n <div class=\"T14R text-secondary\">{{ _label }}</div>\n }\n @if (_hyperlink) {\n <!-- Nếu có hyperlink thì dùng thẻ a -->\n <a [sdHref]=\"_hyperlink!\">{{ viewedText() }}</a>\n } @else {\n <!-- Ngoài ra dùng thẻ mặc định -->\n <div class=\"T14M\">{{ viewedText() | sdEmpty }}</div>\n }\n} @else {\n <section [ngClass]=\"{ 'c-section': _display === 'row' }\">\n @if (_sdLabelDef?.templateRef) {\n <ng-container *ngTemplateOutlet=\"_sdLabelDef!.templateRef\"> </ng-container>\n } @else if (_label) {\n <sd-label [label]=\"_label!\" [required]=\"required()\"></sd-label>\n }\n <mat-radio-group\n [class.c-radio-group-column]=\"_display === 'column'\"\n [class.c-radio-group-row]=\"_display === 'row'\"\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\">\n @for (item of normalizedItems(); track item[valueField()]) {\n <mat-radio-button [class.m-0]=\"_display === 'column'\" [class.mr-16]=\"_display === 'row'\" [value]=\"item[_valueField]\">\n {{ item[displayField()] }}\n </mat-radio-button>\n }\n </mat-radio-group>\n\n @if (formControl.errors?.['required'] && formControl.touched) {\n <mat-error>\n {{ 'core.form.radio.required' | translate }}\n </mat-error>\n } @else if (formControl.errors?.['inlineError'] && formControl.touched) {\n <mat-error>\n {{ inlineError() }}\n </mat-error>\n }\n </section>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;MAuEa,OAAO,CAAA;AACT,IAAA,I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-forms-radio.mjs","sources":["../../../projects/sdcorejs-angular/forms/radio/src/radio.component.ts","../../../projects/sdcorejs-angular/forms/radio/src/radio.component.html","../../../projects/sdcorejs-angular/forms/radio/sdcorejs-angular-forms-radio.ts"],"sourcesContent":["import { Utilities } from '@sdcorejs/utils/fns';\n\nimport { CommonModule } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n contentChild,\n inject,\n input,\n model,\n OnDestroy,\n OnInit,\n output,\n} from '@angular/core';\nimport { ReactiveFormsModule, ValidatorFn, Validators } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { Subscription } from 'rxjs';\n\nimport { SdLabelDefDirective, SdSuffixDefDirective, SdViewDefDirective } from '@sdcorejs/angular/forms/directives';\n\nimport {\n SdFormControl,\n SdInlineErrorValidator,\n sdFormControlState,\n SdViewed,\n SdViewedInput,\n sdViewedInline,\n sdViewedTransform,\n ɵsdFormControlConnector,\n ɵSdFormControlParent,\n} from '@sdcorejs/angular/forms/models';\nimport { sdIsEmpty, sdSerializeDataValue } from '@sdcorejs/angular/utilities/data-state';\nimport { Color } from '@sdcorejs/utils/models';\nimport { TranslatePipe } from '@sdcorejs/angular/i18n';\nimport { SdEmptyPipe } from '@sdcorejs/angular/pipes';\nimport { SdLabel } from '@sdcorejs/angular/forms/label';\nimport { SdHrefDirective } from '@sdcorejs/angular/directives';\n\n@Component({\n selector: 'sd-radio',\n templateUrl: './radio.component.html',\n styleUrl: './radio.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n host: {\n // why: host class .sd-c-<x> + default sd-c-primary cho fallback. Thay data-sd-color\n // để tránh edge case host-attr-binding không reactive trong vài cảnh build pipeline.\n '[class.sd-c-primary]': \"color() === 'primary'\",\n '[class.sd-c-secondary]': \"color() === 'secondary'\",\n '[class.sd-c-info]': \"color() === 'info'\",\n '[class.sd-c-success]': \"color() === 'success'\",\n '[class.sd-c-warning]': \"color() === 'warning'\",\n '[class.sd-c-error]': \"color() === 'error'\",\n },\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatTooltipModule,\n MatFormFieldModule,\n MatRadioModule,\n SdLabel,\n SdEmptyPipe,\n SdHrefDirective,\n TranslatePipe,\n ],\n})\nexport class SdRadio implements OnInit, OnDestroy {\n readonly #ref = inject(ChangeDetectorRef);\n\n readonly id = `I${Utilities.generateUuid()}`;\n readonly labelId = `${this.id}-label`;\n readonly errorId = `${this.id}-error`;\n readonly #defaultName = Utilities.generateUuid();\n formControl = new SdFormControl();\n #subscription = new Subscription();\n\n // Inputs — accept null|undefined at boundary, transform to canonical\n readonly autoIdInput = input<string | undefined, string | null | undefined>(undefined, {\n alias: 'autoId',\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly name = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly form = input<ɵSdFormControlParent>(undefined);\n readonly label = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly placeholder = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly display = input<'row' | 'column', 'row' | 'column' | null | undefined>('row', {\n transform: (v): 'row' | 'column' => v || 'row',\n });\n readonly items = input<any[], any[] | null | undefined>([], {\n transform: (v): any[] => (Array.isArray(v) ? v : []),\n });\n readonly valueField = input.required<string>();\n readonly displayField = input.required<string>();\n readonly required = input(false, { transform: booleanAttribute });\n readonly inlineError = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Display mode: `false` edit · `true` static view · `'inline'` interactive (disabled `'inline'` → static). */\n readonly viewed = input<SdViewed, SdViewedInput>(false, { transform: sdViewedTransform });\n\n // why: tri-state viewed — `'inline'` keeps the radio group interactive; disabled `'inline'` → static.\n readonly #viewedState = sdViewedInline(this.viewed, undefined, this.disabled);\n /** `true` when the static read-only view should render. */\n readonly isViewed = this.#viewedState.isViewed;\n // why: legacy callers pass `null` → fallback to 'primary'. Color enum mở rộng hơn ThemePalette,\n // áp dụng qua host attr [data-sd-color] + SCSS override MDC token vars (mat [color] không nhận 'success'/'info'/...).\n readonly color = input<Color, Color | null | undefined>('primary', {\n transform: (v): Color => v || 'primary',\n });\n readonly hyperlink = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n\n // Two-way model\n readonly model = model<number | string | boolean | undefined | null>(undefined);\n\n // Content children\n readonly sdSuffixDef = contentChild(SdSuffixDefDirective);\n readonly sdLabelDef = contentChild(SdLabelDefDirective);\n readonly sdViewDef = contentChild(SdViewDefDirective);\n\n // Outputs (modelChange auto-generated by model() signal)\n readonly sdChange = output<unknown>();\n readonly sdSelection = output<{ value: any | any[]; item?: any }>();\n\n // Computed (template bindings)\n readonly autoId = computed(() => (this.autoIdInput() ? `forms-radio-${this.autoIdInput()}` : undefined));\n // Kept for back-compat with templates that read `normalizedItems()` — alias of items()\n readonly normalizedItems = computed(() => this.items());\n readonly #state = sdFormControlState(computed(() => this.formControl));\n readonly dataDisabled = computed(() => (this.#state().disabled ? 'true' : 'false'));\n readonly dataEmpty = computed(() => (sdIsEmpty(this.#state().value) ? 'true' : 'false'));\n readonly dataValue = computed(() => sdSerializeDataValue(this.#state().value));\n readonly dataRequired = computed(() => (this.required() ? 'true' : 'false'));\n readonly visibleError = computed<'required' | 'inlineError' | undefined>(() => {\n if (!this.#state().touched) return undefined;\n if (this.formControl.hasError('required')) return 'required';\n if (this.formControl.hasError('inlineError')) return 'inlineError';\n return undefined;\n });\n readonly ariaLabelledBy = computed(() => (this.sdLabelDef()?.templateRef || this.label() ? this.labelId : undefined));\n readonly ariaLabel = computed(() => (this.ariaLabelledBy() ? undefined : this.placeholder() || undefined));\n readonly ariaDescribedBy = computed(() => (this.visibleError() ? this.errorId : undefined));\n readonly ariaInvalid = computed(() => (this.#state().invalid ? 'true' : 'false'));\n\n readonly viewedText = computed(() => {\n const items = this.items();\n const vField = this.valueField();\n const dField = this.displayField();\n // why: tìm item match value rồi trả về string ở `displayField`, không trả nguyên object (sẽ in [object Object]).\n const match = items.find(e => this.formControl?.value?.toString() === e?.[vField]?.toString());\n return match?.[dField] ?? '';\n });\n\n readonly #formConnector = ɵsdFormControlConnector<\n number | string | boolean | undefined | null,\n number | string | boolean | undefined | null\n >({\n form: this.form,\n name: computed(() => this.name() || this.#defaultName),\n control: computed(() => this.formControl),\n model: this.model,\n writeModel: value => {\n const vField = this.valueField();\n this.model.set(value);\n this.sdChange.emit(value);\n this.sdSelection.emit({\n value,\n item: this.items().find(item => value?.toString() === item?.[vField]?.toString()),\n });\n },\n validators: computed(() => {\n const validators: ValidatorFn[] = [];\n if (this.required()) validators.push(Validators.required);\n if (this.inlineError()) validators.push(SdInlineErrorValidator);\n return validators;\n }),\n disabled: this.disabled,\n });\n\n ngOnInit() {\n this.#subscription.add(\n this.formControl.sdChanges.subscribe(() => {\n this.#ref.markForCheck();\n })\n );\n }\n\n ngOnDestroy() {\n this.#subscription.unsubscribe();\n }\n\n reValidate = () => {\n this.formControl.updateValueAndValidity({ emitEvent: true });\n };\n}\n","@let _sdLabelDef = sdLabelDef();\n@let _sdSuffixDef = sdSuffixDef();\n@let _label = label();\n@let _display = display();\n@let _valueField = valueField();\n@let _hyperlink = hyperlink();\n\n@if (isViewed()) {\n @if (_sdLabelDef?.templateRef) {\n <ng-container *ngTemplateOutlet=\"_sdLabelDef!.templateRef\"> </ng-container>\n } @else if (_label) {\n <div class=\"T14R text-secondary\">{{ _label }}</div>\n }\n @if (_hyperlink) {\n <!-- Nếu có hyperlink thì dùng thẻ a -->\n <a [sdHref]=\"_hyperlink!\">{{ viewedText() || placeholder() }}</a>\n } @else {\n <!-- Ngoài ra dùng thẻ mặc định -->\n <div class=\"T14M\">{{ viewedText() || placeholder() | sdEmpty }}</div>\n }\n} @else {\n <section [ngClass]=\"{ 'c-section': _display === 'row' }\">\n @if (_sdLabelDef?.templateRef) {\n <div [id]=\"labelId\"><ng-container *ngTemplateOutlet=\"_sdLabelDef!.templateRef\"> </ng-container></div>\n } @else if (_label) {\n <sd-label [attr.id]=\"labelId\" [label]=\"_label!\" [required]=\"required()\"></sd-label>\n }\n <mat-radio-group\n [class.c-radio-group-column]=\"_display === 'column'\"\n [class.c-radio-group-row]=\"_display === 'row'\"\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [attr.aria-required]=\"dataRequired()\">\n @for (item of normalizedItems(); track item[valueField()]) {\n <mat-radio-button [class.m-0]=\"_display === 'column'\" [class.mr-16]=\"_display === 'row'\" [value]=\"item[_valueField]\">\n {{ item[displayField()] }}\n </mat-radio-button>\n }\n </mat-radio-group>\n\n @if (_sdSuffixDef?.templateRef) {\n <ng-container *ngTemplateOutlet=\"_sdSuffixDef!.templateRef\"> </ng-container>\n }\n\n @if (visibleError() === 'required') {\n <mat-error [id]=\"errorId\">\n {{ 'core.form.radio.required' | translate }}\n </mat-error>\n } @else if (visibleError() === 'inlineError') {\n <mat-error [id]=\"errorId\">\n {{ inlineError() }}\n </mat-error>\n }\n </section>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ɵsdFormControlConnector"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAuEa,OAAO,CAAA;AACT,IAAA,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAEhC,IAAA,EAAE,GAAG,CAAA,CAAA,EAAI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CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MACrB,mBAAmB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MACpB,kBAAkB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnItD;;AAEG;;;;"}
@@ -18,7 +18,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
18
18
  import { SdView } from '@sdcorejs/angular/components/view';
19
19
  import { SdItemDefDefDirective, SdViewDefDirective } from '@sdcorejs/angular/forms/directives';
20
20
  import { SdLabel } from '@sdcorejs/angular/forms/label';
21
- import { SD_FORM_CONFIGURATION, sdFormControlState, sdViewedTransform, sdViewedInline, SdFormControl, HandleSdCustomValidator, SdInlineErrorValidator } from '@sdcorejs/angular/forms/models';
21
+ import { SD_FORM_CONFIGURATION, sdFormControlState, sdViewedTransform, sdViewedInline, SdFormControl, ɵsdFormControlConnector as _sdFormControlConnector, HandleSdCustomValidator, SdInlineErrorValidator } from '@sdcorejs/angular/forms/models';
22
22
  import { I18nService } from '@sdcorejs/angular/i18n';
23
23
  import { sdIsEmpty, sdSerializeDataValue } from '@sdcorejs/angular/utilities/data-state';
24
24
  import { Utilities, StringUtilities, ArrayUtilities } from '@sdcorejs/angular/utilities/extensions';
@@ -187,6 +187,11 @@ class SdSelect {
187
187
  // 4. INTERNAL STATE & STREAMS
188
188
  // ==========================================
189
189
  formControl = new SdFormControl();
190
+ #formConnector = _sdFormControlConnector({
191
+ form: this.form,
192
+ name: this.name,
193
+ control: computed(() => this.formControl),
194
+ });
190
195
  inputControl = new FormControl('');
191
196
  loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
192
197
  focused = signal(false, ...(ngDevMode ? [{ debugName: "focused" }] : []));
@@ -345,25 +350,6 @@ class SdSelect {
345
350
  const inl = this.inlineError();
346
351
  untracked(() => this.#updateValidator(req, val, inl));
347
352
  });
348
- // ==========================================
349
- // EFFECT: QUẢN LÝ FORM GROUP & CONTROL
350
- // ==========================================
351
- effect(onCleanup => {
352
- // 1. Lấy giá trị mới nhất của form và name
353
- const formGroup = this.form();
354
- const controlName = this.name();
355
- if (formGroup && controlName) {
356
- // 2. Thêm control vào form
357
- formGroup.addControl(controlName, this.formControl);
358
- // 3. Đăng ký hàm dọn dẹp (Cleanup)
359
- onCleanup(() => {
360
- // Hàm này sẽ tự động chạy trong 2 trường hợp:
361
- // - Khi Component bị Destroy (thay thế ngOnDestroy)
362
- // - Khi form() hoặc name() thay đổi giá trị (nó sẽ gỡ control cũ ra trước khi add cái mới vào)
363
- formGroup.removeControl(controlName);
364
- });
365
- }
366
- });
367
353
  effect(() => {
368
354
  const actions = this.footerActions();
369
355
  const context = this.footerActionContext();