@raqm/ui 0.0.0-stage → 0.1.0

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 (178) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE.md +28 -0
  4. package/README.md +125 -3
  5. package/combobox/README.md +17 -0
  6. package/fesm2022/raqm-ui-accordion.mjs +414 -0
  7. package/fesm2022/raqm-ui-accordion.mjs.map +1 -0
  8. package/fesm2022/raqm-ui-alert-dialog.mjs +457 -0
  9. package/fesm2022/raqm-ui-alert-dialog.mjs.map +1 -0
  10. package/fesm2022/raqm-ui-alert.mjs +195 -0
  11. package/fesm2022/raqm-ui-alert.mjs.map +1 -0
  12. package/fesm2022/raqm-ui-aspect-ratio.mjs +66 -0
  13. package/fesm2022/raqm-ui-aspect-ratio.mjs.map +1 -0
  14. package/fesm2022/raqm-ui-attachment.mjs +435 -0
  15. package/fesm2022/raqm-ui-attachment.mjs.map +1 -0
  16. package/fesm2022/raqm-ui-avatar.mjs +337 -0
  17. package/fesm2022/raqm-ui-avatar.mjs.map +1 -0
  18. package/fesm2022/raqm-ui-badge.mjs +68 -0
  19. package/fesm2022/raqm-ui-badge.mjs.map +1 -0
  20. package/fesm2022/raqm-ui-breadcrumb.mjs +309 -0
  21. package/fesm2022/raqm-ui-breadcrumb.mjs.map +1 -0
  22. package/fesm2022/raqm-ui-button-group.mjs +138 -0
  23. package/fesm2022/raqm-ui-button-group.mjs.map +1 -0
  24. package/fesm2022/raqm-ui-button.mjs +295 -0
  25. package/fesm2022/raqm-ui-button.mjs.map +1 -0
  26. package/fesm2022/raqm-ui-calendar.mjs +1394 -0
  27. package/fesm2022/raqm-ui-calendar.mjs.map +1 -0
  28. package/fesm2022/raqm-ui-card.mjs +331 -0
  29. package/fesm2022/raqm-ui-card.mjs.map +1 -0
  30. package/fesm2022/raqm-ui-carousel.mjs +410 -0
  31. package/fesm2022/raqm-ui-carousel.mjs.map +1 -0
  32. package/fesm2022/raqm-ui-checkbox.mjs +86 -0
  33. package/fesm2022/raqm-ui-checkbox.mjs.map +1 -0
  34. package/fesm2022/raqm-ui-collapsible.mjs +266 -0
  35. package/fesm2022/raqm-ui-collapsible.mjs.map +1 -0
  36. package/fesm2022/raqm-ui-combobox.mjs +1584 -0
  37. package/fesm2022/raqm-ui-combobox.mjs.map +1 -0
  38. package/fesm2022/raqm-ui-command.mjs +1210 -0
  39. package/fesm2022/raqm-ui-command.mjs.map +1 -0
  40. package/fesm2022/raqm-ui-context-menu.mjs +723 -0
  41. package/fesm2022/raqm-ui-context-menu.mjs.map +1 -0
  42. package/fesm2022/raqm-ui-dialog.mjs +1214 -0
  43. package/fesm2022/raqm-ui-dialog.mjs.map +1 -0
  44. package/fesm2022/raqm-ui-drawer.mjs +687 -0
  45. package/fesm2022/raqm-ui-drawer.mjs.map +1 -0
  46. package/fesm2022/raqm-ui-dropdown-menu.mjs +1168 -0
  47. package/fesm2022/raqm-ui-dropdown-menu.mjs.map +1 -0
  48. package/fesm2022/raqm-ui-empty.mjs +272 -0
  49. package/fesm2022/raqm-ui-empty.mjs.map +1 -0
  50. package/fesm2022/raqm-ui-field.mjs +517 -0
  51. package/fesm2022/raqm-ui-field.mjs.map +1 -0
  52. package/fesm2022/raqm-ui-hover-card.mjs +828 -0
  53. package/fesm2022/raqm-ui-hover-card.mjs.map +1 -0
  54. package/fesm2022/raqm-ui-input-group.mjs +270 -0
  55. package/fesm2022/raqm-ui-input-group.mjs.map +1 -0
  56. package/fesm2022/raqm-ui-input-otp.mjs +788 -0
  57. package/fesm2022/raqm-ui-input-otp.mjs.map +1 -0
  58. package/fesm2022/raqm-ui-input.mjs +73 -0
  59. package/fesm2022/raqm-ui-input.mjs.map +1 -0
  60. package/fesm2022/raqm-ui-item.mjs +495 -0
  61. package/fesm2022/raqm-ui-item.mjs.map +1 -0
  62. package/fesm2022/raqm-ui-kbd.mjs +80 -0
  63. package/fesm2022/raqm-ui-kbd.mjs.map +1 -0
  64. package/fesm2022/raqm-ui-label.mjs +44 -0
  65. package/fesm2022/raqm-ui-label.mjs.map +1 -0
  66. package/fesm2022/raqm-ui-menubar.mjs +536 -0
  67. package/fesm2022/raqm-ui-menubar.mjs.map +1 -0
  68. package/fesm2022/raqm-ui-native-select.mjs +131 -0
  69. package/fesm2022/raqm-ui-native-select.mjs.map +1 -0
  70. package/fesm2022/raqm-ui-navigation-menu.mjs +1399 -0
  71. package/fesm2022/raqm-ui-navigation-menu.mjs.map +1 -0
  72. package/fesm2022/raqm-ui-overlay-internal.mjs +185 -0
  73. package/fesm2022/raqm-ui-overlay-internal.mjs.map +1 -0
  74. package/fesm2022/raqm-ui-pagination.mjs +440 -0
  75. package/fesm2022/raqm-ui-pagination.mjs.map +1 -0
  76. package/fesm2022/raqm-ui-popover.mjs +1495 -0
  77. package/fesm2022/raqm-ui-popover.mjs.map +1 -0
  78. package/fesm2022/raqm-ui-progress.mjs +369 -0
  79. package/fesm2022/raqm-ui-progress.mjs.map +1 -0
  80. package/fesm2022/raqm-ui-questionnaire.mjs +1005 -0
  81. package/fesm2022/raqm-ui-questionnaire.mjs.map +1 -0
  82. package/fesm2022/raqm-ui-radio-group.mjs +151 -0
  83. package/fesm2022/raqm-ui-radio-group.mjs.map +1 -0
  84. package/fesm2022/raqm-ui-resizable.mjs +439 -0
  85. package/fesm2022/raqm-ui-resizable.mjs.map +1 -0
  86. package/fesm2022/raqm-ui-scroll-area.mjs +510 -0
  87. package/fesm2022/raqm-ui-scroll-area.mjs.map +1 -0
  88. package/fesm2022/raqm-ui-select.mjs +1073 -0
  89. package/fesm2022/raqm-ui-select.mjs.map +1 -0
  90. package/fesm2022/raqm-ui-separator.mjs +103 -0
  91. package/fesm2022/raqm-ui-separator.mjs.map +1 -0
  92. package/fesm2022/raqm-ui-sheet.mjs +411 -0
  93. package/fesm2022/raqm-ui-sheet.mjs.map +1 -0
  94. package/fesm2022/raqm-ui-sidebar.mjs +1784 -0
  95. package/fesm2022/raqm-ui-sidebar.mjs.map +1 -0
  96. package/fesm2022/raqm-ui-skeleton.mjs +50 -0
  97. package/fesm2022/raqm-ui-skeleton.mjs.map +1 -0
  98. package/fesm2022/raqm-ui-slider.mjs +609 -0
  99. package/fesm2022/raqm-ui-slider.mjs.map +1 -0
  100. package/fesm2022/raqm-ui-spinner.mjs +137 -0
  101. package/fesm2022/raqm-ui-spinner.mjs.map +1 -0
  102. package/fesm2022/raqm-ui-switch.mjs +109 -0
  103. package/fesm2022/raqm-ui-switch.mjs.map +1 -0
  104. package/fesm2022/raqm-ui-table.mjs +271 -0
  105. package/fesm2022/raqm-ui-table.mjs.map +1 -0
  106. package/fesm2022/raqm-ui-tabs.mjs +536 -0
  107. package/fesm2022/raqm-ui-tabs.mjs.map +1 -0
  108. package/fesm2022/raqm-ui-textarea.mjs +37 -0
  109. package/fesm2022/raqm-ui-textarea.mjs.map +1 -0
  110. package/fesm2022/raqm-ui-toast.mjs +918 -0
  111. package/fesm2022/raqm-ui-toast.mjs.map +1 -0
  112. package/fesm2022/raqm-ui-toggle-group.mjs +462 -0
  113. package/fesm2022/raqm-ui-toggle-group.mjs.map +1 -0
  114. package/fesm2022/raqm-ui-toggle.mjs +158 -0
  115. package/fesm2022/raqm-ui-toggle.mjs.map +1 -0
  116. package/fesm2022/raqm-ui-tooltip.mjs +1226 -0
  117. package/fesm2022/raqm-ui-tooltip.mjs.map +1 -0
  118. package/fesm2022/raqm-ui.mjs +50 -0
  119. package/input-otp/README.md +12 -0
  120. package/package.json +275 -3
  121. package/styles/theme.css +4322 -0
  122. package/types/raqm-ui-accordion.d.ts +124 -0
  123. package/types/raqm-ui-alert-dialog.d.ts +81 -0
  124. package/types/raqm-ui-alert.d.ts +29 -0
  125. package/types/raqm-ui-aspect-ratio.d.ts +13 -0
  126. package/types/raqm-ui-attachment.d.ts +72 -0
  127. package/types/raqm-ui-avatar.d.ts +67 -0
  128. package/types/raqm-ui-badge.d.ts +20 -0
  129. package/types/raqm-ui-breadcrumb.d.ts +35 -0
  130. package/types/raqm-ui-button-group.d.ts +27 -0
  131. package/types/raqm-ui-button.d.ts +80 -0
  132. package/types/raqm-ui-calendar.d.ts +359 -0
  133. package/types/raqm-ui-card.d.ts +34 -0
  134. package/types/raqm-ui-carousel.d.ts +81 -0
  135. package/types/raqm-ui-checkbox.d.ts +24 -0
  136. package/types/raqm-ui-collapsible.d.ts +72 -0
  137. package/types/raqm-ui-combobox.d.ts +405 -0
  138. package/types/raqm-ui-command.d.ts +256 -0
  139. package/types/raqm-ui-context-menu.d.ts +196 -0
  140. package/types/raqm-ui-dialog.d.ts +232 -0
  141. package/types/raqm-ui-drawer.d.ts +121 -0
  142. package/types/raqm-ui-dropdown-menu.d.ts +319 -0
  143. package/types/raqm-ui-empty.d.ts +35 -0
  144. package/types/raqm-ui-field.d.ts +88 -0
  145. package/types/raqm-ui-hover-card.d.ts +139 -0
  146. package/types/raqm-ui-input-group.d.ts +45 -0
  147. package/types/raqm-ui-input-otp.d.ts +197 -0
  148. package/types/raqm-ui-input.d.ts +16 -0
  149. package/types/raqm-ui-item.d.ts +71 -0
  150. package/types/raqm-ui-kbd.d.ts +12 -0
  151. package/types/raqm-ui-label.d.ts +6 -0
  152. package/types/raqm-ui-menubar.d.ts +159 -0
  153. package/types/raqm-ui-native-select.d.ts +23 -0
  154. package/types/raqm-ui-navigation-menu.d.ts +230 -0
  155. package/types/raqm-ui-overlay-internal.d.ts +5 -0
  156. package/types/raqm-ui-pagination.d.ts +84 -0
  157. package/types/raqm-ui-popover.d.ts +235 -0
  158. package/types/raqm-ui-progress.d.ts +79 -0
  159. package/types/raqm-ui-questionnaire.d.ts +217 -0
  160. package/types/raqm-ui-radio-group.d.ts +48 -0
  161. package/types/raqm-ui-resizable.d.ts +98 -0
  162. package/types/raqm-ui-scroll-area.d.ts +132 -0
  163. package/types/raqm-ui-select.d.ts +205 -0
  164. package/types/raqm-ui-separator.d.ts +21 -0
  165. package/types/raqm-ui-sheet.d.ts +79 -0
  166. package/types/raqm-ui-sidebar.d.ts +285 -0
  167. package/types/raqm-ui-skeleton.d.ts +6 -0
  168. package/types/raqm-ui-slider.d.ts +129 -0
  169. package/types/raqm-ui-spinner.d.ts +32 -0
  170. package/types/raqm-ui-switch.d.ts +32 -0
  171. package/types/raqm-ui-table.d.ts +36 -0
  172. package/types/raqm-ui-tabs.d.ts +154 -0
  173. package/types/raqm-ui-textarea.d.ts +6 -0
  174. package/types/raqm-ui-toast.d.ts +190 -0
  175. package/types/raqm-ui-toggle-group.d.ts +167 -0
  176. package/types/raqm-ui-toggle.d.ts +42 -0
  177. package/types/raqm-ui-tooltip.d.ts +207 -0
  178. package/types/raqm-ui.d.ts +50 -0
@@ -0,0 +1,1005 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Directive, ElementRef, afterRenderEffect, booleanAttribute, computed, contentChild, effect, inject, input, isDevMode, linkedSignal, model, output, signal } from "@angular/core";
3
+ import { _IdGenerator } from "@angular/cdk/a11y";
4
+ var RaqmQuestionnaireComponent = class RaqmQuestionnaireComponent {
5
+ host = inject(ElementRef);
6
+ changeDetector = inject(ChangeDetectorRef);
7
+ pendingFocus = signal(null, ...ngDevMode ? [{ debugName: "pendingFocus" }] : /* istanbul ignore next */ []);
8
+ constructor() {
9
+ afterRenderEffect(() => {
10
+ const target = this.pendingFocus();
11
+ if (!target) return;
12
+ this.host.nativeElement.querySelector(target === "invalid" ? ".raqm-questionnaire-item:not([hidden]) input:not(:disabled)" : ".raqm-questionnaire-item:not([hidden])")?.focus();
13
+ this.pendingFocus.set(null);
14
+ });
15
+ effect(() => {
16
+ if (isDevMode() && !this.composed() && this.current() && !this.progressLabel()) console.error("[raqm-questionnaire] The progressbar has no accessible name. Provide `progressLabel`.");
17
+ });
18
+ }
19
+ id = inject(_IdGenerator).getId("raqm-questionnaire-");
20
+ items = input.required(...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
21
+ submitted = output();
22
+ answers = model({}, ...ngDevMode ? [{ debugName: "answers" }] : /* istanbul ignore next */ []);
23
+ currentItem = model(void 0, ...ngDevMode ? [{ debugName: "currentItem" }] : /* istanbul ignore next */ []);
24
+ shortcuts = input("none", ...ngDevMode ? [{ debugName: "shortcuts" }] : /* istanbul ignore next */ []);
25
+ composed = input(false, {
26
+ ...ngDevMode ? { debugName: "composed" } : /* istanbul ignore next */ {},
27
+ transform: booleanAttribute
28
+ });
29
+ labels = input.required(...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
30
+ requiredMessage = input(void 0, ...ngDevMode ? [{ debugName: "requiredMessage" }] : /* istanbul ignore next */ []);
31
+ progressLabel = input(void 0, ...ngDevMode ? [{ debugName: "progressLabel" }] : /* istanbul ignore next */ []);
32
+ index = signal(0, ...ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []);
33
+ freeformValues = linkedSignal(() => {
34
+ const values = {};
35
+ for (const item of this.items()) {
36
+ if (!item.input) continue;
37
+ const choices = new Set(item.choices.map((choice) => choice.value));
38
+ values[item.name] = this.answers()[item.name]?.find((answer) => !choices.has(answer)) ?? "";
39
+ }
40
+ return values;
41
+ }, ...ngDevMode ? [{ debugName: "freeformValues" }] : /* istanbul ignore next */ []);
42
+ error = signal("", ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
43
+ invalid = signal(false, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
44
+ visibleItems = computed(() => this.items().filter((item) => item.visible?.(this.answers()) !== false), ...ngDevMode ? [{ debugName: "visibleItems" }] : /* istanbul ignore next */ []);
45
+ current = computed(() => this.visibleItems().find((item) => item.name === this.currentItem()) ?? this.visibleItems()[this.index()] ?? this.visibleItems()[0], ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
46
+ position = computed(() => Math.max(0, this.visibleItems().indexOf(this.current())), ...ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []);
47
+ descriptionId(name) {
48
+ return `${this.id}-${this.items().findIndex((item) => item.name === name)}-description`;
49
+ }
50
+ errorId(name) {
51
+ return `${this.id}-${this.items().findIndex((item) => item.name === name)}-error`;
52
+ }
53
+ describedBy(name, hasDescription, hasError = false) {
54
+ const ids = [hasDescription ? this.descriptionId(name) : "", hasError ? this.errorId(name) : ""].filter(Boolean);
55
+ return ids.length ? ids.join(" ") : null;
56
+ }
57
+ selected(value) {
58
+ return this.answers()[this.current().name]?.includes(value) ?? false;
59
+ }
60
+ shortcut(index) {
61
+ return this.shortcuts() === "letters" ? String.fromCharCode(65 + index) : String(index + 1);
62
+ }
63
+ onKey(event) {
64
+ if (!this.current()) return;
65
+ if (this.shortcuts() === "none" || event.altKey || event.ctrlKey || event.metaKey || event.isComposing) return;
66
+ const target = event.target;
67
+ if (target.isContentEditable || target instanceof HTMLInputElement && target.type === "text") return;
68
+ const index = this.current().choices.findIndex((_, i) => this.shortcut(i).toLowerCase() === event.key.toLowerCase());
69
+ if (index < 0) return;
70
+ event.preventDefault();
71
+ const choice = this.current().choices[index];
72
+ this.choose(choice.value, this.current().multiple ? !this.selected(choice.value) : true);
73
+ this.host.nativeElement.querySelectorAll(".raqm-questionnaire-item:not([hidden]) .raqm-questionnaire-choices input[type=radio], .raqm-questionnaire-item:not([hidden]) .raqm-questionnaire-choices input[type=checkbox]")[index]?.focus();
74
+ }
75
+ choose(value, checked) {
76
+ const item = this.current();
77
+ const current = this.answers()[item.name] ?? [];
78
+ const next = item.multiple ? checked ? [...current, value] : current.filter((v) => v !== value) : [value];
79
+ this.answers.update((a) => ({
80
+ ...a,
81
+ [item.name]: next
82
+ }));
83
+ if (!item.multiple) this.freeformValues.update((values) => ({
84
+ ...values,
85
+ [item.name]: ""
86
+ }));
87
+ this.error.set("");
88
+ this.invalid.set(false);
89
+ }
90
+ freeform(value) {
91
+ const item = this.current();
92
+ const previous = this.freeformValues()[item.name];
93
+ this.freeformValues.update((values) => ({
94
+ ...values,
95
+ [item.name]: value
96
+ }));
97
+ this.answers.update((answers) => {
98
+ const choices = item.multiple ? (answers[item.name] ?? []).filter((answer) => answer !== previous) : [];
99
+ return {
100
+ ...answers,
101
+ [item.name]: value.trim() ? [...choices, value] : choices
102
+ };
103
+ });
104
+ this.error.set("");
105
+ this.invalid.set(false);
106
+ }
107
+ previous() {
108
+ if (!this.visibleItems().length) return;
109
+ const index = Math.max(0, this.position() - 1);
110
+ this.index.set(index);
111
+ this.currentItem.set(this.visibleItems()[index]?.name);
112
+ this.error.set("");
113
+ this.invalid.set(false);
114
+ this.focusCurrent();
115
+ }
116
+ focusCurrent(validation = false) {
117
+ this.changeDetector.detectChanges();
118
+ if (!validation) this.host.nativeElement.querySelector(".raqm-questionnaire-item:not([hidden])")?.focus();
119
+ this.pendingFocus.set(validation ? "invalid" : "item");
120
+ }
121
+ next(skip = false) {
122
+ const item = this.current();
123
+ if (!item) return;
124
+ const answer = this.answers()[item.name] ?? [];
125
+ const required = !!item.required && !answer.length;
126
+ let message;
127
+ if (!skip || item.required) {
128
+ if (required) {
129
+ message = this.requiredMessage();
130
+ if (!message && isDevMode()) console.error("[raqm-questionnaire] The required item has no error message. Provide `requiredMessage`.");
131
+ } else message = item.validate?.(answer, this.answers());
132
+ }
133
+ if (required || message) {
134
+ this.error.set(message ?? "");
135
+ this.invalid.set(true);
136
+ this.focusCurrent(true);
137
+ return;
138
+ }
139
+ const remaining = this.visibleItems().slice(this.position() + 1).map((entry) => entry.name);
140
+ if (skip && !item.required) {
141
+ this.answers.update((a) => ({
142
+ ...a,
143
+ [item.name]: []
144
+ }));
145
+ this.freeformValues.update((values) => ({
146
+ ...values,
147
+ [item.name]: ""
148
+ }));
149
+ }
150
+ const visible = this.visibleItems();
151
+ const nextName = remaining.find((name) => visible.some((entry) => entry.name === name));
152
+ const index = nextName ? visible.findIndex((entry) => entry.name === nextName) : -1;
153
+ if (index < 0) this.submitted.emit(this.answers());
154
+ else {
155
+ this.index.set(index);
156
+ this.currentItem.set(this.visibleItems()[index]?.name);
157
+ this.focusCurrent();
158
+ }
159
+ this.error.set("");
160
+ this.invalid.set(false);
161
+ }
162
+ static ɵfac = i0.ɵɵngDeclareFactory({
163
+ minVersion: "12.0.0",
164
+ version: "22.2.2",
165
+ ngImport: i0,
166
+ type: RaqmQuestionnaireComponent,
167
+ deps: [],
168
+ target: i0.ɵɵFactoryTarget.Component
169
+ });
170
+ static ɵcmp = i0.ɵɵngDeclareComponent({
171
+ minVersion: "17.0.0",
172
+ version: "22.2.2",
173
+ type: RaqmQuestionnaireComponent,
174
+ isStandalone: true,
175
+ selector: "raqm-questionnaire",
176
+ inputs: {
177
+ items: {
178
+ classPropertyName: "items",
179
+ publicName: "items",
180
+ isSignal: true,
181
+ isRequired: true,
182
+ transformFunction: null
183
+ },
184
+ answers: {
185
+ classPropertyName: "answers",
186
+ publicName: "answers",
187
+ isSignal: true,
188
+ isRequired: false,
189
+ transformFunction: null
190
+ },
191
+ currentItem: {
192
+ classPropertyName: "currentItem",
193
+ publicName: "currentItem",
194
+ isSignal: true,
195
+ isRequired: false,
196
+ transformFunction: null
197
+ },
198
+ shortcuts: {
199
+ classPropertyName: "shortcuts",
200
+ publicName: "shortcuts",
201
+ isSignal: true,
202
+ isRequired: false,
203
+ transformFunction: null
204
+ },
205
+ composed: {
206
+ classPropertyName: "composed",
207
+ publicName: "composed",
208
+ isSignal: true,
209
+ isRequired: false,
210
+ transformFunction: null
211
+ },
212
+ labels: {
213
+ classPropertyName: "labels",
214
+ publicName: "labels",
215
+ isSignal: true,
216
+ isRequired: true,
217
+ transformFunction: null
218
+ },
219
+ requiredMessage: {
220
+ classPropertyName: "requiredMessage",
221
+ publicName: "requiredMessage",
222
+ isSignal: true,
223
+ isRequired: false,
224
+ transformFunction: null
225
+ },
226
+ progressLabel: {
227
+ classPropertyName: "progressLabel",
228
+ publicName: "progressLabel",
229
+ isSignal: true,
230
+ isRequired: false,
231
+ transformFunction: null
232
+ }
233
+ },
234
+ outputs: {
235
+ submitted: "submitted",
236
+ answers: "answersChange",
237
+ currentItem: "currentItemChange"
238
+ },
239
+ host: { classAttribute: "raqm-questionnaire" },
240
+ ngImport: i0,
241
+ template: "@if (composed()) {\r\n <ng-content />\r\n} @else if (current(); as item) {\r\n <p\r\n class=\"raqm-questionnaire-progress\"\r\n role=\"progressbar\"\r\n [attr.aria-label]=\"progressLabel()\"\r\n aria-valuemin=\"0\"\r\n [attr.aria-valuemax]=\"visibleItems().length || null\"\r\n [attr.aria-valuenow]=\"visibleItems().length ? position() + 1 : 0\"\r\n >\r\n {{ visibleItems().length ? position() + 1 : 0 }} / {{ visibleItems().length }}\r\n </p>\r\n <fieldset\r\n class=\"raqm-questionnaire-item\"\r\n tabindex=\"-1\"\r\n [attr.aria-describedby]=\"describedBy(item.name, !!item.description, !!error())\"\r\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\r\n (keydown)=\"onKey($event)\"\r\n >\r\n <legend>{{ item.title }}</legend>\r\n @if (item.description) {\r\n <p [id]=\"descriptionId(item.name)\">{{ item.description }}</p>\r\n }\r\n <div class=\"raqm-questionnaire-choices\">\r\n @for (choice of item.choices; track choice.value; let index = $index) {\r\n <label\r\n ><input\r\n [type]=\"item.multiple ? 'checkbox' : 'radio'\"\r\n [name]=\"item.name\"\r\n [checked]=\"selected(choice.value)\"\r\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\r\n (change)=\"choose(choice.value, $any($event.target).checked)\"\r\n /><span\r\n >{{ choice.label }}\r\n @if (choice.description) {\r\n <small>{{ choice.description }}</small>\r\n }\r\n </span>\r\n @if (shortcuts() !== 'none') {\r\n <kbd aria-hidden=\"true\">{{ shortcut(index) }}</kbd>\r\n }\r\n </label>\r\n }\r\n @if (item.input; as field) {\r\n <input\r\n type=\"text\"\r\n [attr.aria-label]=\"field.label\"\r\n [placeholder]=\"field.placeholder ?? ''\"\r\n [value]=\"freeformValues()[item.name] ?? ''\"\r\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\r\n (input)=\"freeform($any($event.target).value)\"\r\n />\r\n }\r\n </div>\r\n @if (error()) {\r\n <p [id]=\"errorId(item.name)\" role=\"alert\">{{ error() }}</p>\r\n }\r\n </fieldset>\r\n <div class=\"raqm-questionnaire-actions\">\r\n <button\r\n type=\"button\"\r\n class=\"raqm-questionnaire-actions__previous\"\r\n (click)=\"previous()\"\r\n [disabled]=\"position() === 0\"\r\n >\r\n {{ labels().previous }}\r\n </button>\r\n @if (!item.required && position() < visibleItems().length - 1) {\r\n <button type=\"button\" (click)=\"next(true)\">{{ labels().skip }}</button>\r\n }\r\n <button type=\"button\" (click)=\"next()\">\r\n {{ position() === visibleItems().length - 1 ? labels().submit : labels().next }}\r\n </button>\r\n </div>\r\n}\r\n",
242
+ styles: [":host{display:flex;flex-direction:column;gap:calc(var(--raqm-spacing) * 4);min-inline-size:0;inline-size:100%}\n"],
243
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
244
+ });
245
+ };
246
+ i0.ɵɵngDeclareClassMetadata({
247
+ minVersion: "12.0.0",
248
+ version: "22.2.2",
249
+ ngImport: i0,
250
+ type: RaqmQuestionnaireComponent,
251
+ decorators: [{
252
+ type: Component,
253
+ args: [{
254
+ selector: "raqm-questionnaire",
255
+ changeDetection: ChangeDetectionStrategy.OnPush,
256
+ host: { class: "raqm-questionnaire" },
257
+ template: "@if (composed()) {\r\n <ng-content />\r\n} @else if (current(); as item) {\r\n <p\r\n class=\"raqm-questionnaire-progress\"\r\n role=\"progressbar\"\r\n [attr.aria-label]=\"progressLabel()\"\r\n aria-valuemin=\"0\"\r\n [attr.aria-valuemax]=\"visibleItems().length || null\"\r\n [attr.aria-valuenow]=\"visibleItems().length ? position() + 1 : 0\"\r\n >\r\n {{ visibleItems().length ? position() + 1 : 0 }} / {{ visibleItems().length }}\r\n </p>\r\n <fieldset\r\n class=\"raqm-questionnaire-item\"\r\n tabindex=\"-1\"\r\n [attr.aria-describedby]=\"describedBy(item.name, !!item.description, !!error())\"\r\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\r\n (keydown)=\"onKey($event)\"\r\n >\r\n <legend>{{ item.title }}</legend>\r\n @if (item.description) {\r\n <p [id]=\"descriptionId(item.name)\">{{ item.description }}</p>\r\n }\r\n <div class=\"raqm-questionnaire-choices\">\r\n @for (choice of item.choices; track choice.value; let index = $index) {\r\n <label\r\n ><input\r\n [type]=\"item.multiple ? 'checkbox' : 'radio'\"\r\n [name]=\"item.name\"\r\n [checked]=\"selected(choice.value)\"\r\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\r\n (change)=\"choose(choice.value, $any($event.target).checked)\"\r\n /><span\r\n >{{ choice.label }}\r\n @if (choice.description) {\r\n <small>{{ choice.description }}</small>\r\n }\r\n </span>\r\n @if (shortcuts() !== 'none') {\r\n <kbd aria-hidden=\"true\">{{ shortcut(index) }}</kbd>\r\n }\r\n </label>\r\n }\r\n @if (item.input; as field) {\r\n <input\r\n type=\"text\"\r\n [attr.aria-label]=\"field.label\"\r\n [placeholder]=\"field.placeholder ?? ''\"\r\n [value]=\"freeformValues()[item.name] ?? ''\"\r\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\r\n (input)=\"freeform($any($event.target).value)\"\r\n />\r\n }\r\n </div>\r\n @if (error()) {\r\n <p [id]=\"errorId(item.name)\" role=\"alert\">{{ error() }}</p>\r\n }\r\n </fieldset>\r\n <div class=\"raqm-questionnaire-actions\">\r\n <button\r\n type=\"button\"\r\n class=\"raqm-questionnaire-actions__previous\"\r\n (click)=\"previous()\"\r\n [disabled]=\"position() === 0\"\r\n >\r\n {{ labels().previous }}\r\n </button>\r\n @if (!item.required && position() < visibleItems().length - 1) {\r\n <button type=\"button\" (click)=\"next(true)\">{{ labels().skip }}</button>\r\n }\r\n <button type=\"button\" (click)=\"next()\">\r\n {{ position() === visibleItems().length - 1 ? labels().submit : labels().next }}\r\n </button>\r\n </div>\r\n}\r\n",
258
+ styles: [":host{display:flex;flex-direction:column;gap:calc(var(--raqm-spacing) * 4);min-inline-size:0;inline-size:100%}\n"]
259
+ }]
260
+ }],
261
+ ctorParameters: () => [],
262
+ propDecorators: {
263
+ items: [{
264
+ type: i0.Input,
265
+ args: [{
266
+ isSignal: true,
267
+ alias: "items",
268
+ required: true
269
+ }]
270
+ }],
271
+ submitted: [{
272
+ type: i0.Output,
273
+ args: ["submitted"]
274
+ }],
275
+ answers: [{
276
+ type: i0.Input,
277
+ args: [{
278
+ isSignal: true,
279
+ alias: "answers",
280
+ required: false
281
+ }]
282
+ }, {
283
+ type: i0.Output,
284
+ args: ["answersChange"]
285
+ }],
286
+ currentItem: [{
287
+ type: i0.Input,
288
+ args: [{
289
+ isSignal: true,
290
+ alias: "currentItem",
291
+ required: false
292
+ }]
293
+ }, {
294
+ type: i0.Output,
295
+ args: ["currentItemChange"]
296
+ }],
297
+ shortcuts: [{
298
+ type: i0.Input,
299
+ args: [{
300
+ isSignal: true,
301
+ alias: "shortcuts",
302
+ required: false
303
+ }]
304
+ }],
305
+ composed: [{
306
+ type: i0.Input,
307
+ args: [{
308
+ isSignal: true,
309
+ alias: "composed",
310
+ required: false
311
+ }]
312
+ }],
313
+ labels: [{
314
+ type: i0.Input,
315
+ args: [{
316
+ isSignal: true,
317
+ alias: "labels",
318
+ required: true
319
+ }]
320
+ }],
321
+ requiredMessage: [{
322
+ type: i0.Input,
323
+ args: [{
324
+ isSignal: true,
325
+ alias: "requiredMessage",
326
+ required: false
327
+ }]
328
+ }],
329
+ progressLabel: [{
330
+ type: i0.Input,
331
+ args: [{
332
+ isSignal: true,
333
+ alias: "progressLabel",
334
+ required: false
335
+ }]
336
+ }]
337
+ }
338
+ });
339
+ var RaqmQuestionnaireProgressComponent = class RaqmQuestionnaireProgressComponent {
340
+ root = inject(RaqmQuestionnaireComponent);
341
+ static ɵfac = i0.ɵɵngDeclareFactory({
342
+ minVersion: "12.0.0",
343
+ version: "22.2.2",
344
+ ngImport: i0,
345
+ type: RaqmQuestionnaireProgressComponent,
346
+ deps: [],
347
+ target: i0.ɵɵFactoryTarget.Component
348
+ });
349
+ static ɵcmp = i0.ɵɵngDeclareComponent({
350
+ minVersion: "14.0.0",
351
+ version: "22.2.2",
352
+ type: RaqmQuestionnaireProgressComponent,
353
+ isStandalone: true,
354
+ selector: "raqm-questionnaire-progress",
355
+ host: {
356
+ attributes: {
357
+ "role": "progressbar",
358
+ "aria-valuemin": "0"
359
+ },
360
+ properties: {
361
+ "attr.aria-valuemax": "root.visibleItems().length || null",
362
+ "attr.aria-valuenow": "root.visibleItems().length ? root.position() + 1 : 0"
363
+ },
364
+ classAttribute: "raqm-questionnaire-progress"
365
+ },
366
+ ngImport: i0,
367
+ template: "{{ root.visibleItems().length ? root.position() + 1 : 0 }} / {{ root.visibleItems().length }}",
368
+ isInline: true,
369
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
370
+ });
371
+ };
372
+ i0.ɵɵngDeclareClassMetadata({
373
+ minVersion: "12.0.0",
374
+ version: "22.2.2",
375
+ ngImport: i0,
376
+ type: RaqmQuestionnaireProgressComponent,
377
+ decorators: [{
378
+ type: Component,
379
+ args: [{
380
+ selector: "raqm-questionnaire-progress",
381
+ template: "{{ root.visibleItems().length ? root.position() + 1 : 0 }} / {{ root.visibleItems().length }}",
382
+ changeDetection: ChangeDetectionStrategy.OnPush,
383
+ host: {
384
+ class: "raqm-questionnaire-progress",
385
+ role: "progressbar",
386
+ "aria-valuemin": "0",
387
+ "[attr.aria-valuemax]": "root.visibleItems().length || null",
388
+ "[attr.aria-valuenow]": "root.visibleItems().length ? root.position() + 1 : 0"
389
+ }
390
+ }]
391
+ }]
392
+ });
393
+ var RaqmQuestionnaireItemDirective = class RaqmQuestionnaireItemDirective {
394
+ root = inject(RaqmQuestionnaireComponent);
395
+ name = input.required(...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
396
+ invalid = input(false, {
397
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
398
+ transform: booleanAttribute
399
+ });
400
+ active = computed(() => this.root.current()?.name === this.name(), ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
401
+ description = contentChild(RaqmQuestionnaireDescriptionDirective, {
402
+ ...ngDevMode ? { debugName: "description" } : /* istanbul ignore next */ {},
403
+ descendants: true
404
+ });
405
+ errorPart = contentChild(RaqmQuestionnaireErrorComponent, ...ngDevMode ? [{ debugName: "errorPart" }] : /* istanbul ignore next */ []);
406
+ errorMessage = computed(() => this.root.error() || this.errorPart()?.message(), ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
407
+ onKey(event) {
408
+ if (this.active()) this.root.onKey(event);
409
+ }
410
+ static ɵfac = i0.ɵɵngDeclareFactory({
411
+ minVersion: "12.0.0",
412
+ version: "22.2.2",
413
+ ngImport: i0,
414
+ type: RaqmQuestionnaireItemDirective,
415
+ deps: [],
416
+ target: i0.ɵɵFactoryTarget.Directive
417
+ });
418
+ static ɵdir = i0.ɵɵngDeclareDirective({
419
+ minVersion: "17.2.0",
420
+ version: "22.2.2",
421
+ type: RaqmQuestionnaireItemDirective,
422
+ isStandalone: true,
423
+ selector: "fieldset[raqm-questionnaire-item]",
424
+ inputs: {
425
+ name: {
426
+ classPropertyName: "name",
427
+ publicName: "name",
428
+ isSignal: true,
429
+ isRequired: true,
430
+ transformFunction: null
431
+ },
432
+ invalid: {
433
+ classPropertyName: "invalid",
434
+ publicName: "invalid",
435
+ isSignal: true,
436
+ isRequired: false,
437
+ transformFunction: null
438
+ }
439
+ },
440
+ host: {
441
+ attributes: { "tabindex": "-1" },
442
+ listeners: { "keydown": "onKey($event)" },
443
+ properties: {
444
+ "hidden": "!active()",
445
+ "attr.inert": "active() ? null : \"\"",
446
+ "attr.aria-invalid": "active() && (invalid() || root.invalid()) ? \"true\" : null",
447
+ "attr.aria-describedby": "root.describedBy(name(), !!description(), active() && !!errorMessage())"
448
+ },
449
+ classAttribute: "raqm-questionnaire-item"
450
+ },
451
+ queries: [{
452
+ propertyName: "description",
453
+ first: true,
454
+ predicate: RaqmQuestionnaireDescriptionDirective,
455
+ descendants: true,
456
+ isSignal: true
457
+ }, {
458
+ propertyName: "errorPart",
459
+ first: true,
460
+ predicate: RaqmQuestionnaireErrorComponent,
461
+ descendants: true,
462
+ isSignal: true
463
+ }],
464
+ ngImport: i0
465
+ });
466
+ };
467
+ i0.ɵɵngDeclareClassMetadata({
468
+ minVersion: "12.0.0",
469
+ version: "22.2.2",
470
+ ngImport: i0,
471
+ type: RaqmQuestionnaireItemDirective,
472
+ decorators: [{
473
+ type: Directive,
474
+ args: [{
475
+ selector: "fieldset[raqm-questionnaire-item]",
476
+ host: {
477
+ class: "raqm-questionnaire-item",
478
+ tabindex: "-1",
479
+ "[hidden]": "!active()",
480
+ "[attr.inert]": "active() ? null : \"\"",
481
+ "[attr.aria-invalid]": "active() && (invalid() || root.invalid()) ? \"true\" : null",
482
+ "[attr.aria-describedby]": "root.describedBy(name(), !!description(), active() && !!errorMessage())",
483
+ "(keydown)": "onKey($event)"
484
+ }
485
+ }]
486
+ }],
487
+ propDecorators: {
488
+ name: [{
489
+ type: i0.Input,
490
+ args: [{
491
+ isSignal: true,
492
+ alias: "name",
493
+ required: true
494
+ }]
495
+ }],
496
+ invalid: [{
497
+ type: i0.Input,
498
+ args: [{
499
+ isSignal: true,
500
+ alias: "invalid",
501
+ required: false
502
+ }]
503
+ }],
504
+ description: [{
505
+ type: i0.ContentChild,
506
+ args: [i0.forwardRef(() => RaqmQuestionnaireDescriptionDirective), {
507
+ descendants: true,
508
+ isSignal: true
509
+ }]
510
+ }],
511
+ errorPart: [{
512
+ type: i0.ContentChild,
513
+ args: [i0.forwardRef(() => RaqmQuestionnaireErrorComponent), { isSignal: true }]
514
+ }]
515
+ }
516
+ });
517
+ var RaqmQuestionnaireTitleDirective = class RaqmQuestionnaireTitleDirective {
518
+ static ɵfac = i0.ɵɵngDeclareFactory({
519
+ minVersion: "12.0.0",
520
+ version: "22.2.2",
521
+ ngImport: i0,
522
+ type: RaqmQuestionnaireTitleDirective,
523
+ deps: [],
524
+ target: i0.ɵɵFactoryTarget.Directive
525
+ });
526
+ static ɵdir = i0.ɵɵngDeclareDirective({
527
+ minVersion: "14.0.0",
528
+ version: "22.2.2",
529
+ type: RaqmQuestionnaireTitleDirective,
530
+ isStandalone: true,
531
+ selector: "[raqm-questionnaire-title]",
532
+ host: { classAttribute: "raqm-questionnaire-title" },
533
+ ngImport: i0
534
+ });
535
+ };
536
+ i0.ɵɵngDeclareClassMetadata({
537
+ minVersion: "12.0.0",
538
+ version: "22.2.2",
539
+ ngImport: i0,
540
+ type: RaqmQuestionnaireTitleDirective,
541
+ decorators: [{
542
+ type: Directive,
543
+ args: [{
544
+ selector: "[raqm-questionnaire-title]",
545
+ host: { class: "raqm-questionnaire-title" }
546
+ }]
547
+ }]
548
+ });
549
+ var RaqmQuestionnaireDescriptionDirective = class RaqmQuestionnaireDescriptionDirective {
550
+ item = inject(RaqmQuestionnaireItemDirective);
551
+ static ɵfac = i0.ɵɵngDeclareFactory({
552
+ minVersion: "12.0.0",
553
+ version: "22.2.2",
554
+ ngImport: i0,
555
+ type: RaqmQuestionnaireDescriptionDirective,
556
+ deps: [],
557
+ target: i0.ɵɵFactoryTarget.Directive
558
+ });
559
+ static ɵdir = i0.ɵɵngDeclareDirective({
560
+ minVersion: "14.0.0",
561
+ version: "22.2.2",
562
+ type: RaqmQuestionnaireDescriptionDirective,
563
+ isStandalone: true,
564
+ selector: "[raqm-questionnaire-description]",
565
+ host: { properties: { "id": "item.root.descriptionId(item.name())" } },
566
+ ngImport: i0
567
+ });
568
+ };
569
+ i0.ɵɵngDeclareClassMetadata({
570
+ minVersion: "12.0.0",
571
+ version: "22.2.2",
572
+ ngImport: i0,
573
+ type: RaqmQuestionnaireDescriptionDirective,
574
+ decorators: [{
575
+ type: Directive,
576
+ args: [{
577
+ selector: "[raqm-questionnaire-description]",
578
+ host: { "[id]": "item.root.descriptionId(item.name())" }
579
+ }]
580
+ }]
581
+ });
582
+ var RaqmQuestionnaireChoicesDirective = class RaqmQuestionnaireChoicesDirective {
583
+ static ɵfac = i0.ɵɵngDeclareFactory({
584
+ minVersion: "12.0.0",
585
+ version: "22.2.2",
586
+ ngImport: i0,
587
+ type: RaqmQuestionnaireChoicesDirective,
588
+ deps: [],
589
+ target: i0.ɵɵFactoryTarget.Directive
590
+ });
591
+ static ɵdir = i0.ɵɵngDeclareDirective({
592
+ minVersion: "14.0.0",
593
+ version: "22.2.2",
594
+ type: RaqmQuestionnaireChoicesDirective,
595
+ isStandalone: true,
596
+ selector: "[raqm-questionnaire-choices]",
597
+ host: { classAttribute: "raqm-questionnaire-choices" },
598
+ ngImport: i0
599
+ });
600
+ };
601
+ i0.ɵɵngDeclareClassMetadata({
602
+ minVersion: "12.0.0",
603
+ version: "22.2.2",
604
+ ngImport: i0,
605
+ type: RaqmQuestionnaireChoicesDirective,
606
+ decorators: [{
607
+ type: Directive,
608
+ args: [{
609
+ selector: "[raqm-questionnaire-choices]",
610
+ host: { class: "raqm-questionnaire-choices" }
611
+ }]
612
+ }]
613
+ });
614
+ var RaqmQuestionnaireChoiceDirective = class RaqmQuestionnaireChoiceDirective {
615
+ item = inject(RaqmQuestionnaireItemDirective);
616
+ definition = computed(() => this.item.root.items().find((entry) => entry.name === this.item.name()), ...ngDevMode ? [{ debugName: "definition" }] : /* istanbul ignore next */ []);
617
+ value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
618
+ onChange(event) {
619
+ this.item.root.choose(this.value(), event.target.checked);
620
+ }
621
+ static ɵfac = i0.ɵɵngDeclareFactory({
622
+ minVersion: "12.0.0",
623
+ version: "22.2.2",
624
+ ngImport: i0,
625
+ type: RaqmQuestionnaireChoiceDirective,
626
+ deps: [],
627
+ target: i0.ɵɵFactoryTarget.Directive
628
+ });
629
+ static ɵdir = i0.ɵɵngDeclareDirective({
630
+ minVersion: "17.1.0",
631
+ version: "22.2.2",
632
+ type: RaqmQuestionnaireChoiceDirective,
633
+ isStandalone: true,
634
+ selector: "input[raqm-questionnaire-choice]",
635
+ inputs: { value: {
636
+ classPropertyName: "value",
637
+ publicName: "value",
638
+ isSignal: true,
639
+ isRequired: true,
640
+ transformFunction: null
641
+ } },
642
+ host: {
643
+ listeners: { "change": "onChange($event)" },
644
+ properties: {
645
+ "attr.name": "item.name()",
646
+ "attr.type": "definition()?.multiple ? \"checkbox\" : \"radio\"",
647
+ "checked": "item.root.answers()[item.name()]?.includes(value()) ?? false",
648
+ "attr.aria-invalid": "item.active() && item.root.invalid() ? \"true\" : null"
649
+ }
650
+ },
651
+ ngImport: i0
652
+ });
653
+ };
654
+ i0.ɵɵngDeclareClassMetadata({
655
+ minVersion: "12.0.0",
656
+ version: "22.2.2",
657
+ ngImport: i0,
658
+ type: RaqmQuestionnaireChoiceDirective,
659
+ decorators: [{
660
+ type: Directive,
661
+ args: [{
662
+ selector: "input[raqm-questionnaire-choice]",
663
+ host: {
664
+ "[attr.name]": "item.name()",
665
+ "[attr.type]": "definition()?.multiple ? \"checkbox\" : \"radio\"",
666
+ "[checked]": "item.root.answers()[item.name()]?.includes(value()) ?? false",
667
+ "[attr.aria-invalid]": "item.active() && item.root.invalid() ? \"true\" : null",
668
+ "(change)": "onChange($event)"
669
+ }
670
+ }]
671
+ }],
672
+ propDecorators: { value: [{
673
+ type: i0.Input,
674
+ args: [{
675
+ isSignal: true,
676
+ alias: "value",
677
+ required: true
678
+ }]
679
+ }] }
680
+ });
681
+ var RaqmQuestionnaireInputDirective = class RaqmQuestionnaireInputDirective {
682
+ item = inject(RaqmQuestionnaireItemDirective);
683
+ onInput(event) {
684
+ this.item.root.freeform(event.target.value);
685
+ }
686
+ static ɵfac = i0.ɵɵngDeclareFactory({
687
+ minVersion: "12.0.0",
688
+ version: "22.2.2",
689
+ ngImport: i0,
690
+ type: RaqmQuestionnaireInputDirective,
691
+ deps: [],
692
+ target: i0.ɵɵFactoryTarget.Directive
693
+ });
694
+ static ɵdir = i0.ɵɵngDeclareDirective({
695
+ minVersion: "14.0.0",
696
+ version: "22.2.2",
697
+ type: RaqmQuestionnaireInputDirective,
698
+ isStandalone: true,
699
+ selector: "input[raqm-questionnaire-input]",
700
+ host: {
701
+ listeners: { "input": "onInput($event)" },
702
+ properties: {
703
+ "value": "item.root.freeformValues()[item.name()] ?? \"\"",
704
+ "attr.aria-invalid": "item.active() && item.root.invalid() ? \"true\" : null"
705
+ }
706
+ },
707
+ ngImport: i0
708
+ });
709
+ };
710
+ i0.ɵɵngDeclareClassMetadata({
711
+ minVersion: "12.0.0",
712
+ version: "22.2.2",
713
+ ngImport: i0,
714
+ type: RaqmQuestionnaireInputDirective,
715
+ decorators: [{
716
+ type: Directive,
717
+ args: [{
718
+ selector: "input[raqm-questionnaire-input]",
719
+ host: {
720
+ "[value]": "item.root.freeformValues()[item.name()] ?? \"\"",
721
+ "[attr.aria-invalid]": "item.active() && item.root.invalid() ? \"true\" : null",
722
+ "(input)": "onInput($event)"
723
+ }
724
+ }]
725
+ }]
726
+ });
727
+ var RaqmQuestionnaireErrorComponent = class RaqmQuestionnaireErrorComponent {
728
+ item = inject(RaqmQuestionnaireItemDirective);
729
+ message = input(...ngDevMode ? [void 0, { debugName: "message" }] : /* istanbul ignore next */ []);
730
+ static ɵfac = i0.ɵɵngDeclareFactory({
731
+ minVersion: "12.0.0",
732
+ version: "22.2.2",
733
+ ngImport: i0,
734
+ type: RaqmQuestionnaireErrorComponent,
735
+ deps: [],
736
+ target: i0.ɵɵFactoryTarget.Component
737
+ });
738
+ static ɵcmp = i0.ɵɵngDeclareComponent({
739
+ minVersion: "17.0.0",
740
+ version: "22.2.2",
741
+ type: RaqmQuestionnaireErrorComponent,
742
+ isStandalone: true,
743
+ selector: "raqm-questionnaire-error",
744
+ inputs: { message: {
745
+ classPropertyName: "message",
746
+ publicName: "message",
747
+ isSignal: true,
748
+ isRequired: false,
749
+ transformFunction: null
750
+ } },
751
+ ngImport: i0,
752
+ template: "@if (item.active() && (message() || item.root.error())) { <p [id]=\"item.root.errorId(item.name())\" role=\"alert\">{{ message() || item.root.error() }}</p> }",
753
+ isInline: true,
754
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
755
+ });
756
+ };
757
+ i0.ɵɵngDeclareClassMetadata({
758
+ minVersion: "12.0.0",
759
+ version: "22.2.2",
760
+ ngImport: i0,
761
+ type: RaqmQuestionnaireErrorComponent,
762
+ decorators: [{
763
+ type: Component,
764
+ args: [{
765
+ selector: "raqm-questionnaire-error",
766
+ template: "@if (item.active() && (message() || item.root.error())) { <p [id]=\"item.root.errorId(item.name())\" role=\"alert\">{{ message() || item.root.error() }}</p> }",
767
+ changeDetection: ChangeDetectionStrategy.OnPush
768
+ }]
769
+ }],
770
+ propDecorators: { message: [{
771
+ type: i0.Input,
772
+ args: [{
773
+ isSignal: true,
774
+ alias: "message",
775
+ required: false
776
+ }]
777
+ }] }
778
+ });
779
+ var RaqmQuestionnaireActionsDirective = class RaqmQuestionnaireActionsDirective {
780
+ static ɵfac = i0.ɵɵngDeclareFactory({
781
+ minVersion: "12.0.0",
782
+ version: "22.2.2",
783
+ ngImport: i0,
784
+ type: RaqmQuestionnaireActionsDirective,
785
+ deps: [],
786
+ target: i0.ɵɵFactoryTarget.Directive
787
+ });
788
+ static ɵdir = i0.ɵɵngDeclareDirective({
789
+ minVersion: "14.0.0",
790
+ version: "22.2.2",
791
+ type: RaqmQuestionnaireActionsDirective,
792
+ isStandalone: true,
793
+ selector: "[raqm-questionnaire-actions]",
794
+ host: { classAttribute: "raqm-questionnaire-actions" },
795
+ ngImport: i0
796
+ });
797
+ };
798
+ i0.ɵɵngDeclareClassMetadata({
799
+ minVersion: "12.0.0",
800
+ version: "22.2.2",
801
+ ngImport: i0,
802
+ type: RaqmQuestionnaireActionsDirective,
803
+ decorators: [{
804
+ type: Directive,
805
+ args: [{
806
+ selector: "[raqm-questionnaire-actions]",
807
+ host: { class: "raqm-questionnaire-actions" }
808
+ }]
809
+ }]
810
+ });
811
+ var RaqmQuestionnairePreviousDirective = class RaqmQuestionnairePreviousDirective {
812
+ root = inject(RaqmQuestionnaireComponent);
813
+ constructor() {
814
+ const host = inject(ElementRef).nativeElement;
815
+ if (!host.hasAttribute("type")) host.setAttribute("type", "button");
816
+ }
817
+ static ɵfac = i0.ɵɵngDeclareFactory({
818
+ minVersion: "12.0.0",
819
+ version: "22.2.2",
820
+ ngImport: i0,
821
+ type: RaqmQuestionnairePreviousDirective,
822
+ deps: [],
823
+ target: i0.ɵɵFactoryTarget.Directive
824
+ });
825
+ static ɵdir = i0.ɵɵngDeclareDirective({
826
+ minVersion: "14.0.0",
827
+ version: "22.2.2",
828
+ type: RaqmQuestionnairePreviousDirective,
829
+ isStandalone: true,
830
+ selector: "button[raqm-questionnaire-previous]",
831
+ host: {
832
+ listeners: { "click": "root.previous()" },
833
+ properties: { "disabled": "root.position() === 0" }
834
+ },
835
+ ngImport: i0
836
+ });
837
+ };
838
+ i0.ɵɵngDeclareClassMetadata({
839
+ minVersion: "12.0.0",
840
+ version: "22.2.2",
841
+ ngImport: i0,
842
+ type: RaqmQuestionnairePreviousDirective,
843
+ decorators: [{
844
+ type: Directive,
845
+ args: [{
846
+ selector: "button[raqm-questionnaire-previous]",
847
+ host: {
848
+ "[disabled]": "root.position() === 0",
849
+ "(click)": "root.previous()"
850
+ }
851
+ }]
852
+ }],
853
+ ctorParameters: () => []
854
+ });
855
+ var RaqmQuestionnaireSkipDirective = class RaqmQuestionnaireSkipDirective {
856
+ root = inject(RaqmQuestionnaireComponent);
857
+ constructor() {
858
+ const host = inject(ElementRef).nativeElement;
859
+ if (!host.hasAttribute("type")) host.setAttribute("type", "button");
860
+ }
861
+ static ɵfac = i0.ɵɵngDeclareFactory({
862
+ minVersion: "12.0.0",
863
+ version: "22.2.2",
864
+ ngImport: i0,
865
+ type: RaqmQuestionnaireSkipDirective,
866
+ deps: [],
867
+ target: i0.ɵɵFactoryTarget.Directive
868
+ });
869
+ static ɵdir = i0.ɵɵngDeclareDirective({
870
+ minVersion: "14.0.0",
871
+ version: "22.2.2",
872
+ type: RaqmQuestionnaireSkipDirective,
873
+ isStandalone: true,
874
+ selector: "button[raqm-questionnaire-skip]",
875
+ host: {
876
+ listeners: { "click": "root.next(true)" },
877
+ properties: { "hidden": "root.current()?.required || root.position() === root.visibleItems().length - 1" }
878
+ },
879
+ ngImport: i0
880
+ });
881
+ };
882
+ i0.ɵɵngDeclareClassMetadata({
883
+ minVersion: "12.0.0",
884
+ version: "22.2.2",
885
+ ngImport: i0,
886
+ type: RaqmQuestionnaireSkipDirective,
887
+ decorators: [{
888
+ type: Directive,
889
+ args: [{
890
+ selector: "button[raqm-questionnaire-skip]",
891
+ host: {
892
+ "[hidden]": "root.current()?.required || root.position() === root.visibleItems().length - 1",
893
+ "(click)": "root.next(true)"
894
+ }
895
+ }]
896
+ }],
897
+ ctorParameters: () => []
898
+ });
899
+ var RaqmQuestionnaireNextDirective = class RaqmQuestionnaireNextDirective {
900
+ root = inject(RaqmQuestionnaireComponent);
901
+ constructor() {
902
+ const host = inject(ElementRef).nativeElement;
903
+ if (!host.hasAttribute("type")) host.setAttribute("type", "button");
904
+ }
905
+ static ɵfac = i0.ɵɵngDeclareFactory({
906
+ minVersion: "12.0.0",
907
+ version: "22.2.2",
908
+ ngImport: i0,
909
+ type: RaqmQuestionnaireNextDirective,
910
+ deps: [],
911
+ target: i0.ɵɵFactoryTarget.Directive
912
+ });
913
+ static ɵdir = i0.ɵɵngDeclareDirective({
914
+ minVersion: "14.0.0",
915
+ version: "22.2.2",
916
+ type: RaqmQuestionnaireNextDirective,
917
+ isStandalone: true,
918
+ selector: "button[raqm-questionnaire-next]",
919
+ host: {
920
+ listeners: { "click": "root.next()" },
921
+ properties: { "hidden": "root.position() === root.visibleItems().length - 1" }
922
+ },
923
+ ngImport: i0
924
+ });
925
+ };
926
+ i0.ɵɵngDeclareClassMetadata({
927
+ minVersion: "12.0.0",
928
+ version: "22.2.2",
929
+ ngImport: i0,
930
+ type: RaqmQuestionnaireNextDirective,
931
+ decorators: [{
932
+ type: Directive,
933
+ args: [{
934
+ selector: "button[raqm-questionnaire-next]",
935
+ host: {
936
+ "[hidden]": "root.position() === root.visibleItems().length - 1",
937
+ "(click)": "root.next()"
938
+ }
939
+ }]
940
+ }],
941
+ ctorParameters: () => []
942
+ });
943
+ var RaqmQuestionnaireSubmitDirective = class RaqmQuestionnaireSubmitDirective {
944
+ root = inject(RaqmQuestionnaireComponent);
945
+ constructor() {
946
+ const host = inject(ElementRef).nativeElement;
947
+ if (!host.hasAttribute("type")) host.setAttribute("type", "button");
948
+ }
949
+ static ɵfac = i0.ɵɵngDeclareFactory({
950
+ minVersion: "12.0.0",
951
+ version: "22.2.2",
952
+ ngImport: i0,
953
+ type: RaqmQuestionnaireSubmitDirective,
954
+ deps: [],
955
+ target: i0.ɵɵFactoryTarget.Directive
956
+ });
957
+ static ɵdir = i0.ɵɵngDeclareDirective({
958
+ minVersion: "14.0.0",
959
+ version: "22.2.2",
960
+ type: RaqmQuestionnaireSubmitDirective,
961
+ isStandalone: true,
962
+ selector: "button[raqm-questionnaire-submit]",
963
+ host: {
964
+ listeners: { "click": "root.next()" },
965
+ properties: { "hidden": "root.position() !== root.visibleItems().length - 1" }
966
+ },
967
+ ngImport: i0
968
+ });
969
+ };
970
+ i0.ɵɵngDeclareClassMetadata({
971
+ minVersion: "12.0.0",
972
+ version: "22.2.2",
973
+ ngImport: i0,
974
+ type: RaqmQuestionnaireSubmitDirective,
975
+ decorators: [{
976
+ type: Directive,
977
+ args: [{
978
+ selector: "button[raqm-questionnaire-submit]",
979
+ host: {
980
+ "[hidden]": "root.position() !== root.visibleItems().length - 1",
981
+ "(click)": "root.next()"
982
+ }
983
+ }]
984
+ }],
985
+ ctorParameters: () => []
986
+ });
987
+ const RaqmQuestionnaire = [
988
+ RaqmQuestionnaireComponent,
989
+ RaqmQuestionnaireProgressComponent,
990
+ RaqmQuestionnaireItemDirective,
991
+ RaqmQuestionnaireTitleDirective,
992
+ RaqmQuestionnaireDescriptionDirective,
993
+ RaqmQuestionnaireChoicesDirective,
994
+ RaqmQuestionnaireChoiceDirective,
995
+ RaqmQuestionnaireInputDirective,
996
+ RaqmQuestionnaireErrorComponent,
997
+ RaqmQuestionnaireActionsDirective,
998
+ RaqmQuestionnairePreviousDirective,
999
+ RaqmQuestionnaireSkipDirective,
1000
+ RaqmQuestionnaireNextDirective,
1001
+ RaqmQuestionnaireSubmitDirective
1002
+ ];
1003
+ export { RaqmQuestionnaire, RaqmQuestionnaireActionsDirective, RaqmQuestionnaireChoiceDirective, RaqmQuestionnaireChoicesDirective, RaqmQuestionnaireComponent, RaqmQuestionnaireDescriptionDirective, RaqmQuestionnaireErrorComponent, RaqmQuestionnaireInputDirective, RaqmQuestionnaireItemDirective, RaqmQuestionnaireNextDirective, RaqmQuestionnairePreviousDirective, RaqmQuestionnaireProgressComponent, RaqmQuestionnaireSkipDirective, RaqmQuestionnaireSubmitDirective, RaqmQuestionnaireTitleDirective };
1004
+
1005
+ //# sourceMappingURL=raqm-ui-questionnaire.mjs.map