@molecule/app-ui-angular 1.0.6 → 1.1.1

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 (308) hide show
  1. package/README.md +11740 -1143
  2. package/dist/components/accordion.component.d.ts +114 -0
  3. package/dist/components/accordion.component.d.ts.map +1 -0
  4. package/dist/components/accordion.component.js +286 -0
  5. package/dist/components/accordion.component.js.map +1 -0
  6. package/dist/components/alert.component.d.ts +81 -37
  7. package/dist/components/alert.component.d.ts.map +1 -1
  8. package/dist/components/alert.component.js +232 -146
  9. package/dist/components/alert.component.js.map +1 -1
  10. package/dist/components/auth-guard.component.d.ts +94 -0
  11. package/dist/components/auth-guard.component.d.ts.map +1 -0
  12. package/dist/components/auth-guard.component.js +212 -0
  13. package/dist/components/auth-guard.component.js.map +1 -0
  14. package/dist/components/avatar.component.d.ts +97 -0
  15. package/dist/components/avatar.component.d.ts.map +1 -0
  16. package/dist/components/avatar.component.js +216 -0
  17. package/dist/components/avatar.component.js.map +1 -0
  18. package/dist/components/badge.component.d.ts +27 -12
  19. package/dist/components/badge.component.d.ts.map +1 -1
  20. package/dist/components/badge.component.js +47 -47
  21. package/dist/components/badge.component.js.map +1 -1
  22. package/dist/components/button.component.d.ts +96 -14
  23. package/dist/components/button.component.d.ts.map +1 -1
  24. package/dist/components/button.component.js +232 -87
  25. package/dist/components/button.component.js.map +1 -1
  26. package/dist/components/card.component.d.ts +135 -0
  27. package/dist/components/card.component.d.ts.map +1 -0
  28. package/dist/components/card.component.js +291 -0
  29. package/dist/components/card.component.js.map +1 -0
  30. package/dist/components/checkbox.component.d.ts +102 -29
  31. package/dist/components/checkbox.component.d.ts.map +1 -1
  32. package/dist/components/checkbox.component.js +222 -113
  33. package/dist/components/checkbox.component.js.map +1 -1
  34. package/dist/components/confirm-button.component.d.ts +130 -0
  35. package/dist/components/confirm-button.component.d.ts.map +1 -0
  36. package/dist/components/confirm-button.component.js +322 -0
  37. package/dist/components/confirm-button.component.js.map +1 -0
  38. package/dist/components/confirm-dialog.component.d.ts +60 -0
  39. package/dist/components/confirm-dialog.component.d.ts.map +1 -0
  40. package/dist/components/confirm-dialog.component.js +152 -0
  41. package/dist/components/confirm-dialog.component.js.map +1 -0
  42. package/dist/components/dropdown.component.d.ts +313 -0
  43. package/dist/components/dropdown.component.d.ts.map +1 -0
  44. package/dist/components/dropdown.component.js +919 -0
  45. package/dist/components/dropdown.component.js.map +1 -0
  46. package/dist/components/empty-state.component.d.ts +73 -0
  47. package/dist/components/empty-state.component.d.ts.map +1 -0
  48. package/dist/components/empty-state.component.js +180 -0
  49. package/dist/components/empty-state.component.js.map +1 -0
  50. package/dist/components/floating-input.component.d.ts +86 -0
  51. package/dist/components/floating-input.component.d.ts.map +1 -0
  52. package/dist/components/floating-input.component.js +167 -0
  53. package/dist/components/floating-input.component.js.map +1 -0
  54. package/dist/components/form-field.component.d.ts +111 -0
  55. package/dist/components/form-field.component.d.ts.map +1 -0
  56. package/dist/components/form-field.component.js +300 -0
  57. package/dist/components/form-field.component.js.map +1 -0
  58. package/dist/components/form.component.d.ts +77 -0
  59. package/dist/components/form.component.d.ts.map +1 -0
  60. package/dist/components/form.component.js +222 -0
  61. package/dist/components/form.component.js.map +1 -0
  62. package/dist/components/icon.component.d.ts +85 -0
  63. package/dist/components/icon.component.d.ts.map +1 -0
  64. package/dist/components/icon.component.js +187 -0
  65. package/dist/components/icon.component.js.map +1 -0
  66. package/dist/components/index.d.ts +49 -0
  67. package/dist/components/index.d.ts.map +1 -1
  68. package/dist/components/index.js +49 -0
  69. package/dist/components/index.js.map +1 -1
  70. package/dist/components/input.component.d.ts +157 -54
  71. package/dist/components/input.component.d.ts.map +1 -1
  72. package/dist/components/input.component.js +437 -222
  73. package/dist/components/input.component.js.map +1 -1
  74. package/dist/components/label.component.d.ts +29 -0
  75. package/dist/components/label.component.d.ts.map +1 -0
  76. package/dist/components/label.component.js +60 -0
  77. package/dist/components/label.component.js.map +1 -0
  78. package/dist/components/language-picker.component.d.ts +124 -0
  79. package/dist/components/language-picker.component.d.ts.map +1 -0
  80. package/dist/components/language-picker.component.js +305 -0
  81. package/dist/components/language-picker.component.js.map +1 -0
  82. package/dist/components/layout.component.d.ts +167 -0
  83. package/dist/components/layout.component.d.ts.map +1 -0
  84. package/dist/components/layout.component.js +364 -0
  85. package/dist/components/layout.component.js.map +1 -0
  86. package/dist/components/load-error-banner.component.d.ts +103 -0
  87. package/dist/components/load-error-banner.component.d.ts.map +1 -0
  88. package/dist/components/load-error-banner.component.js +263 -0
  89. package/dist/components/load-error-banner.component.js.map +1 -0
  90. package/dist/components/modal.component.d.ts +125 -95
  91. package/dist/components/modal.component.d.ts.map +1 -1
  92. package/dist/components/modal.component.js +458 -271
  93. package/dist/components/modal.component.js.map +1 -1
  94. package/dist/components/molecule/alert.component.d.ts +77 -0
  95. package/dist/components/molecule/alert.component.d.ts.map +1 -0
  96. package/dist/components/molecule/alert.component.js +229 -0
  97. package/dist/components/molecule/alert.component.js.map +1 -0
  98. package/dist/components/molecule/badge.component.d.ts +27 -0
  99. package/dist/components/molecule/badge.component.d.ts.map +1 -0
  100. package/dist/components/molecule/badge.component.js +79 -0
  101. package/dist/components/molecule/badge.component.js.map +1 -0
  102. package/dist/components/molecule/button.component.d.ts +38 -0
  103. package/dist/components/molecule/button.component.d.ts.map +1 -0
  104. package/dist/components/molecule/button.component.js +137 -0
  105. package/dist/components/molecule/button.component.js.map +1 -0
  106. package/dist/components/molecule/checkbox.component.d.ts +53 -0
  107. package/dist/components/molecule/checkbox.component.d.ts.map +1 -0
  108. package/dist/components/molecule/checkbox.component.js +166 -0
  109. package/dist/components/molecule/checkbox.component.js.map +1 -0
  110. package/dist/components/molecule/index.d.ts +18 -0
  111. package/dist/components/molecule/index.d.ts.map +1 -0
  112. package/dist/components/molecule/index.js +18 -0
  113. package/dist/components/molecule/index.js.map +1 -0
  114. package/dist/components/molecule/input.component.d.ts +93 -0
  115. package/dist/components/molecule/input.component.d.ts.map +1 -0
  116. package/dist/components/molecule/input.component.js +314 -0
  117. package/dist/components/molecule/input.component.js.map +1 -0
  118. package/dist/components/molecule/modal.component.d.ts +148 -0
  119. package/dist/components/molecule/modal.component.d.ts.map +1 -0
  120. package/dist/components/molecule/modal.component.js +382 -0
  121. package/dist/components/molecule/modal.component.js.map +1 -0
  122. package/dist/components/molecule/radio-group.component.d.ts +63 -0
  123. package/dist/components/molecule/radio-group.component.d.ts.map +1 -0
  124. package/dist/components/molecule/radio-group.component.js +208 -0
  125. package/dist/components/molecule/radio-group.component.js.map +1 -0
  126. package/dist/components/molecule/select.component.d.ts +72 -0
  127. package/dist/components/molecule/select.component.d.ts.map +1 -0
  128. package/dist/components/molecule/select.component.js +274 -0
  129. package/dist/components/molecule/select.component.js.map +1 -0
  130. package/dist/components/molecule/spinner.component.d.ts +42 -0
  131. package/dist/components/molecule/spinner.component.d.ts.map +1 -0
  132. package/dist/components/molecule/spinner.component.js +122 -0
  133. package/dist/components/molecule/spinner.component.js.map +1 -0
  134. package/dist/components/molecule/switch.component.d.ts +54 -0
  135. package/dist/components/molecule/switch.component.d.ts.map +1 -0
  136. package/dist/components/molecule/switch.component.js +148 -0
  137. package/dist/components/molecule/switch.component.js.map +1 -0
  138. package/dist/components/molecule/toast.component.d.ts +98 -0
  139. package/dist/components/molecule/toast.component.d.ts.map +1 -0
  140. package/dist/components/molecule/toast.component.js +305 -0
  141. package/dist/components/molecule/toast.component.js.map +1 -0
  142. package/dist/components/molecule/tooltip.component.d.ts +77 -0
  143. package/dist/components/molecule/tooltip.component.d.ts.map +1 -0
  144. package/dist/components/molecule/tooltip.component.js +316 -0
  145. package/dist/components/molecule/tooltip.component.js.map +1 -0
  146. package/dist/components/optimistic-toggle-button.component.d.ts +125 -0
  147. package/dist/components/optimistic-toggle-button.component.d.ts.map +1 -0
  148. package/dist/components/optimistic-toggle-button.component.js +296 -0
  149. package/dist/components/optimistic-toggle-button.component.js.map +1 -0
  150. package/dist/components/page-header.component.d.ts +77 -0
  151. package/dist/components/page-header.component.d.ts.map +1 -0
  152. package/dist/components/page-header.component.js +225 -0
  153. package/dist/components/page-header.component.js.map +1 -0
  154. package/dist/components/page-shell.component.d.ts +101 -0
  155. package/dist/components/page-shell.component.d.ts.map +1 -0
  156. package/dist/components/page-shell.component.js +221 -0
  157. package/dist/components/page-shell.component.js.map +1 -0
  158. package/dist/components/pagination.component.d.ts +137 -0
  159. package/dist/components/pagination.component.d.ts.map +1 -0
  160. package/dist/components/pagination.component.js +419 -0
  161. package/dist/components/pagination.component.js.map +1 -0
  162. package/dist/components/panel-close.component.d.ts +43 -0
  163. package/dist/components/panel-close.component.d.ts.map +1 -0
  164. package/dist/components/panel-close.component.js +75 -0
  165. package/dist/components/panel-close.component.js.map +1 -0
  166. package/dist/components/progress.component.d.ts +84 -0
  167. package/dist/components/progress.component.d.ts.map +1 -0
  168. package/dist/components/progress.component.js +219 -0
  169. package/dist/components/progress.component.js.map +1 -0
  170. package/dist/components/prompt-dialog.component.d.ts +121 -0
  171. package/dist/components/prompt-dialog.component.d.ts.map +1 -0
  172. package/dist/components/prompt-dialog.component.js +332 -0
  173. package/dist/components/prompt-dialog.component.js.map +1 -0
  174. package/dist/components/radio-group.component.d.ts +66 -34
  175. package/dist/components/radio-group.component.d.ts.map +1 -1
  176. package/dist/components/radio-group.component.js +146 -125
  177. package/dist/components/radio-group.component.js.map +1 -1
  178. package/dist/components/responsive-app-shell.component.d.ts +408 -0
  179. package/dist/components/responsive-app-shell.component.d.ts.map +1 -0
  180. package/dist/components/responsive-app-shell.component.js +1144 -0
  181. package/dist/components/responsive-app-shell.component.js.map +1 -0
  182. package/dist/components/select.component.d.ts +135 -38
  183. package/dist/components/select.component.d.ts.map +1 -1
  184. package/dist/components/select.component.js +373 -181
  185. package/dist/components/select.component.js.map +1 -1
  186. package/dist/components/separator.component.d.ts +39 -0
  187. package/dist/components/separator.component.d.ts.map +1 -0
  188. package/dist/components/separator.component.js +73 -0
  189. package/dist/components/separator.component.js.map +1 -0
  190. package/dist/components/sidebar-user-card.component.d.ts +106 -0
  191. package/dist/components/sidebar-user-card.component.d.ts.map +1 -0
  192. package/dist/components/sidebar-user-card.component.js +277 -0
  193. package/dist/components/sidebar-user-card.component.js.map +1 -0
  194. package/dist/components/skeleton.component.d.ts +100 -0
  195. package/dist/components/skeleton.component.d.ts.map +1 -0
  196. package/dist/components/skeleton.component.js +214 -0
  197. package/dist/components/skeleton.component.js.map +1 -0
  198. package/dist/components/spinner.component.d.ts +36 -19
  199. package/dist/components/spinner.component.d.ts.map +1 -1
  200. package/dist/components/spinner.component.js +69 -71
  201. package/dist/components/spinner.component.js.map +1 -1
  202. package/dist/components/switch.component.d.ts +72 -29
  203. package/dist/components/switch.component.d.ts.map +1 -1
  204. package/dist/components/switch.component.js +163 -91
  205. package/dist/components/switch.component.js.map +1 -1
  206. package/dist/components/table.component.d.ts +193 -0
  207. package/dist/components/table.component.d.ts.map +1 -0
  208. package/dist/components/table.component.js +550 -0
  209. package/dist/components/table.component.js.map +1 -0
  210. package/dist/components/tabs.component.d.ts +140 -0
  211. package/dist/components/tabs.component.d.ts.map +1 -0
  212. package/dist/components/tabs.component.js +390 -0
  213. package/dist/components/tabs.component.js.map +1 -0
  214. package/dist/components/template-outlet.directive.d.ts +50 -0
  215. package/dist/components/template-outlet.directive.d.ts.map +1 -0
  216. package/dist/components/template-outlet.directive.js +81 -0
  217. package/dist/components/template-outlet.directive.js.map +1 -0
  218. package/dist/components/textarea.component.d.ts +151 -0
  219. package/dist/components/textarea.component.d.ts.map +1 -0
  220. package/dist/components/textarea.component.js +340 -0
  221. package/dist/components/textarea.component.js.map +1 -0
  222. package/dist/components/theme-toggle.component.d.ts +58 -0
  223. package/dist/components/theme-toggle.component.d.ts.map +1 -0
  224. package/dist/components/theme-toggle.component.js +124 -0
  225. package/dist/components/theme-toggle.component.js.map +1 -0
  226. package/dist/components/toast.component.d.ts +237 -49
  227. package/dist/components/toast.component.d.ts.map +1 -1
  228. package/dist/components/toast.component.js +636 -201
  229. package/dist/components/toast.component.js.map +1 -1
  230. package/dist/components/tooltip.component.d.ts +95 -45
  231. package/dist/components/tooltip.component.d.ts.map +1 -1
  232. package/dist/components/tooltip.component.js +372 -221
  233. package/dist/components/tooltip.component.js.map +1 -1
  234. package/dist/components/user-menu-popover.component.d.ts +283 -0
  235. package/dist/components/user-menu-popover.component.d.ts.map +1 -0
  236. package/dist/components/user-menu-popover.component.js +646 -0
  237. package/dist/components/user-menu-popover.component.js.map +1 -0
  238. package/dist/components/user-menu.component.d.ts +95 -0
  239. package/dist/components/user-menu.component.d.ts.map +1 -0
  240. package/dist/components/user-menu.component.js +218 -0
  241. package/dist/components/user-menu.component.js.map +1 -0
  242. package/dist/hooks/index.d.ts +7 -0
  243. package/dist/hooks/index.d.ts.map +1 -0
  244. package/dist/hooks/index.js +7 -0
  245. package/dist/hooks/index.js.map +1 -0
  246. package/dist/hooks/use-is-desktop.d.ts +22 -0
  247. package/dist/hooks/use-is-desktop.d.ts.map +1 -0
  248. package/dist/hooks/use-is-desktop.js +37 -0
  249. package/dist/hooks/use-is-desktop.js.map +1 -0
  250. package/dist/index.d.ts +32 -17
  251. package/dist/index.d.ts.map +1 -1
  252. package/dist/index.js +32 -17
  253. package/dist/index.js.map +1 -1
  254. package/dist/types.d.ts +1 -1
  255. package/dist/types.d.ts.map +1 -1
  256. package/dist/utilities/dom-context.d.ts +42 -0
  257. package/dist/utilities/dom-context.d.ts.map +1 -0
  258. package/dist/utilities/dom-context.js +66 -0
  259. package/dist/utilities/dom-context.js.map +1 -0
  260. package/dist/utilities/focus.d.ts +32 -0
  261. package/dist/utilities/focus.d.ts.map +1 -0
  262. package/dist/utilities/focus.js +47 -0
  263. package/dist/utilities/focus.js.map +1 -0
  264. package/dist/utilities/form-field-context.d.ts +34 -0
  265. package/dist/utilities/form-field-context.d.ts.map +1 -0
  266. package/dist/utilities/form-field-context.js +28 -0
  267. package/dist/utilities/form-field-context.js.map +1 -0
  268. package/dist/utilities/form-submit-error.d.ts +17 -0
  269. package/dist/utilities/form-submit-error.d.ts.map +1 -0
  270. package/dist/utilities/form-submit-error.js +42 -0
  271. package/dist/utilities/form-submit-error.js.map +1 -0
  272. package/dist/utilities/icon-markup.d.ts +17 -0
  273. package/dist/utilities/icon-markup.d.ts.map +1 -0
  274. package/dist/utilities/icon-markup.js +46 -0
  275. package/dist/utilities/icon-markup.js.map +1 -0
  276. package/dist/utilities/ids.d.ts +15 -0
  277. package/dist/utilities/ids.d.ts.map +1 -0
  278. package/dist/utilities/ids.js +19 -0
  279. package/dist/utilities/ids.js.map +1 -0
  280. package/dist/utilities/index.d.ts +11 -0
  281. package/dist/utilities/index.d.ts.map +1 -1
  282. package/dist/utilities/index.js +11 -0
  283. package/dist/utilities/index.js.map +1 -1
  284. package/dist/utilities/initials.d.ts +13 -0
  285. package/dist/utilities/initials.d.ts.map +1 -0
  286. package/dist/utilities/initials.js +23 -0
  287. package/dist/utilities/initials.js.map +1 -0
  288. package/dist/utilities/node-value.d.ts +31 -0
  289. package/dist/utilities/node-value.d.ts.map +1 -0
  290. package/dist/utilities/node-value.js +37 -0
  291. package/dist/utilities/node-value.js.map +1 -0
  292. package/dist/utilities/optimistic-value.d.ts +81 -0
  293. package/dist/utilities/optimistic-value.d.ts.map +1 -0
  294. package/dist/utilities/optimistic-value.js +154 -0
  295. package/dist/utilities/optimistic-value.js.map +1 -0
  296. package/dist/utilities/render-icon.d.ts +77 -7
  297. package/dist/utilities/render-icon.d.ts.map +1 -1
  298. package/dist/utilities/render-icon.js +123 -33
  299. package/dist/utilities/render-icon.js.map +1 -1
  300. package/dist/utilities/rest-attrs.d.ts +21 -0
  301. package/dist/utilities/rest-attrs.d.ts.map +1 -0
  302. package/dist/utilities/rest-attrs.js +37 -0
  303. package/dist/utilities/rest-attrs.js.map +1 -0
  304. package/dist/utilities/style.d.ts +23 -0
  305. package/dist/utilities/style.d.ts.map +1 -0
  306. package/dist/utilities/style.js +86 -0
  307. package/dist/utilities/style.js.map +1 -0
  308. package/package.json +6 -4
@@ -1,307 +1,522 @@
1
1
  /**
2
- * Angular Input UI component with UIClassMap-driven styling.
2
+ * Input component (React parity).
3
3
  *
4
4
  * @module
5
5
  */
6
- import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
7
- import { t } from '@molecule/app-i18n';
6
+ import { NgTemplateOutlet } from '@angular/common';
7
+ import { Component, ElementRef, EventEmitter, inject, Output, Renderer2, TemplateRef, ViewChild, } from '@angular/core';
8
+ import { useTranslation } from '@molecule/app-angular';
8
9
  import { getClassMap } from '@molecule/app-ui';
9
- import { getIconSvg } from '../utilities/render-icon.js';
10
+ import { fieldContext } from '../utilities/form-field-context.js';
11
+ import { MolIconSvg, resolveIcon } from '../utilities/render-icon.js';
12
+ import { moveRestAttributes } from '../utilities/rest-attrs.js';
13
+ import { styleText } from '../utilities/style.js';
14
+ import { hasNodes, SlotWrapper } from './button.component.js';
10
15
  import * as i0 from "@angular/core";
11
- function MoleculeInput_Conditional_1_Template(rf, ctx) { if (rf & 1) {
12
- i0.ɵɵdomElementStart(0, "label");
16
+ const _c0 = ["inputEl"];
17
+ const _c1 = ["leftSlot"];
18
+ const _c2 = ["rightSlot"];
19
+ const _c3 = ["rightInner"];
20
+ const _c4 = [[["", "slot", "leftelement"]], [["", "slot", "rightelement"]]];
21
+ const _c5 = ["[slot=leftElement]", "[slot=rightElement]"];
22
+ const _c6 = a0 => ({ required: a0 });
23
+ function Input_Conditional_0_Template(rf, ctx) { if (rf & 1) {
24
+ i0.ɵɵelementStart(0, "label");
13
25
  i0.ɵɵtext(1);
14
- i0.ɵɵdomElementEnd();
26
+ i0.ɵɵelementEnd();
15
27
  } if (rf & 2) {
16
28
  const ctx_r0 = i0.ɵɵnextContext();
17
- i0.ɵɵclassMap(ctx_r0.labelClasses);
18
- i0.ɵɵattribute("for", ctx_r0.inputId);
29
+ i0.ɵɵclassMap(ctx_r0.cm().cn(ctx_r0.cm().label(i0.ɵɵpureFunction1(4, _c6, !!ctx_r0.required)), ctx_r0.cm().labelBlock));
30
+ i0.ɵɵattribute("for", ctx_r0.inputId());
19
31
  i0.ɵɵadvance();
20
- i0.ɵɵtextInterpolate1(" ", ctx_r0.label, " ");
32
+ i0.ɵɵtextInterpolate(ctx_r0.label);
21
33
  } }
22
- function MoleculeInput_Conditional_4_Template(rf, ctx) { if (rf & 1) {
34
+ function Input_Conditional_5_Template(rf, ctx) { if (rf & 1) {
35
+ i0.ɵɵelementContainer(0, 5);
36
+ } if (rf & 2) {
37
+ i0.ɵɵproperty("ngTemplateOutlet", ctx);
38
+ } }
39
+ function Input_Conditional_6_Template(rf, ctx) { if (rf & 1) {
40
+ i0.ɵɵtext(0);
41
+ } if (rf & 2) {
42
+ const ctx_r0 = i0.ɵɵnextContext();
43
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.asText(ctx_r0.leftElement), " ");
44
+ } }
45
+ function Input_Conditional_11_Template(rf, ctx) { if (rf & 1) {
23
46
  const _r2 = i0.ɵɵgetCurrentView();
24
- i0.ɵɵdomElementStart(0, "div")(1, "button", 3);
25
- i0.ɵɵdomListener("click", function MoleculeInput_Conditional_4_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.handleClear.emit()); });
26
- i0.ɵɵdomElement(2, "span", 4);
27
- i0.ɵɵdomElementEnd()();
47
+ i0.ɵɵelementStart(0, "button", 8);
48
+ i0.ɵɵlistener("click", function Input_Conditional_11_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.clear.emit($event)); });
49
+ i0.ɵɵnamespaceSVG();
50
+ i0.ɵɵelement(1, "svg", 9);
51
+ i0.ɵɵelementEnd();
28
52
  } if (rf & 2) {
29
53
  const ctx_r0 = i0.ɵɵnextContext();
30
- i0.ɵɵclassMap(ctx_r0.cm.inputClearButton);
31
- i0.ɵɵadvance();
32
- i0.ɵɵclassMap(ctx_r0.cm.inputClearButton);
33
- i0.ɵɵattribute("aria-label", ctx_r0.clearAriaLabel);
54
+ i0.ɵɵclassMap(ctx_r0.cm().inputClearButton);
55
+ i0.ɵɵattribute("aria-label", ctx_r0.clearText());
34
56
  i0.ɵɵadvance();
35
- i0.ɵɵdomProperty("innerHTML", ctx_r0.clearIconSvg, i0.ɵɵsanitizeHtml);
57
+ i0.ɵɵproperty("data", ctx_r0.clearIcon());
58
+ } }
59
+ function Input_Conditional_15_Template(rf, ctx) { if (rf & 1) {
60
+ i0.ɵɵelementContainer(0, 5);
61
+ } if (rf & 2) {
62
+ i0.ɵɵproperty("ngTemplateOutlet", ctx);
63
+ } }
64
+ function Input_Conditional_16_Template(rf, ctx) { if (rf & 1) {
65
+ i0.ɵɵtext(0);
66
+ } if (rf & 2) {
67
+ const ctx_r0 = i0.ɵɵnextContext();
68
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.asText(ctx_r0.rightElement), " ");
36
69
  } }
37
- function MoleculeInput_Conditional_5_Template(rf, ctx) { if (rf & 1) {
38
- i0.ɵɵdomElementStart(0, "p", 5);
70
+ function Input_Conditional_17_Template(rf, ctx) { if (rf & 1) {
71
+ i0.ɵɵelementStart(0, "p");
39
72
  i0.ɵɵtext(1);
40
- i0.ɵɵdomElementEnd();
73
+ i0.ɵɵelementEnd();
41
74
  } if (rf & 2) {
42
75
  const ctx_r0 = i0.ɵɵnextContext();
43
- i0.ɵɵclassMap(ctx_r0.formErrorClass);
44
- i0.ɵɵdomProperty("id", ctx_r0.inputId + "-error");
76
+ i0.ɵɵclassMap(ctx_r0.cm().formError);
77
+ i0.ɵɵattribute("id", ctx_r0.inputId() + "-error");
45
78
  i0.ɵɵadvance();
46
- i0.ɵɵtextInterpolate1(" ", ctx_r0.error, " ");
79
+ i0.ɵɵtextInterpolate(ctx_r0.error);
47
80
  } }
48
- function MoleculeInput_Conditional_6_Template(rf, ctx) { if (rf & 1) {
49
- i0.ɵɵdomElementStart(0, "p", 5);
81
+ function Input_Conditional_18_Template(rf, ctx) { if (rf & 1) {
82
+ i0.ɵɵelementStart(0, "p");
50
83
  i0.ɵɵtext(1);
51
- i0.ɵɵdomElementEnd();
84
+ i0.ɵɵelementEnd();
52
85
  } if (rf & 2) {
53
86
  const ctx_r0 = i0.ɵɵnextContext();
54
- i0.ɵɵclassMap(ctx_r0.formHintClass);
55
- i0.ɵɵdomProperty("id", ctx_r0.inputId + "-hint");
87
+ i0.ɵɵclassMap(ctx_r0.cm().formHint);
88
+ i0.ɵɵattribute("id", ctx_r0.inputId() + "-hint");
56
89
  i0.ɵɵadvance();
57
- i0.ɵɵtextInterpolate1(" ", ctx_r0.hint, " ");
90
+ i0.ɵɵtextInterpolate(ctx_r0.hint);
58
91
  } }
59
92
  /**
60
- * Angular Input UI component with UIClassMap-driven styling.
61
- */
62
- /**
63
- * Molecule Input class.
93
+ * Input component.
94
+ *
95
+ * The host is the `div.inputWrapper` React renders. React's text-input
96
+ * `onChange` fires on `input` events; a controlled `value` is restored after
97
+ * user input exactly like React's controlled-input state restore.
98
+ *
99
+ * The adornment wrappers React renders conditionally
100
+ * (`{!!leftElement && <div …>}` / `{(rightElement || (clearable && value)) && …}`)
101
+ * are always-mounted `<ng-content>` capture points that are detached from the
102
+ * DOM whenever React would render nothing (see {@link SlotWrapper}).
64
103
  */
65
- export class MoleculeInput {
66
- type = 'text';
67
- size = 'md';
104
+ export class Input {
105
+ /** Input type. */
106
+ type;
107
+ /** Input size. */
108
+ size;
109
+ /** Text alignment. */
110
+ align;
111
+ /** Field label. */
68
112
  label;
113
+ /** Error message (associates via aria-describedby). */
69
114
  error;
115
+ /** Hint text (shown without an error). */
70
116
  hint;
71
- clearable = false;
117
+ /** Left adornment (a TemplateRef input, or projected `[slot=leftElement]`). */
118
+ leftElement;
119
+ /** Right adornment (a TemplateRef input, or projected `[slot=rightElement]`). */
120
+ rightElement;
121
+ /** Whether the clear button may render while a value exists. */
122
+ clearable;
123
+ /** Accessible label of the clear button. */
72
124
  clearLabel;
125
+ /** Extra classes joined onto the input classes. */
73
126
  className;
127
+ /** Inline style object (React camelCase). */
74
128
  style;
129
+ /** `data-testid` for the input. */
75
130
  testId;
76
- disabled = false;
77
- required = false;
78
- readOnly = false;
131
+ /** Disables the input. */
132
+ disabled;
133
+ /** Marks the input required (label styling). */
134
+ required;
135
+ /** Controlled value. */
79
136
  value;
137
+ /** Uncontrolled initial value. */
138
+ defaultValue;
139
+ /** Placeholder text. */
80
140
  placeholder;
141
+ /** Form field name. */
81
142
  name;
143
+ /** Explicit input id. */
82
144
  id;
83
- maxLength;
84
- minLength;
85
- pattern;
86
- autoComplete;
87
- handleInput = new EventEmitter();
88
- handleChange = new EventEmitter();
89
- handleFocus = new EventEmitter();
90
- handleBlur = new EventEmitter();
91
- handleClear = new EventEmitter();
145
+ /** Fires the raw `input` event (React's text-input onChange). */
146
+ change = new EventEmitter();
147
+ /** Fires the clear button's click event. */
148
+ clear = new EventEmitter();
149
+ /** The native input (React's `...rest` spread target). */
150
+ inputEl;
151
+ /** The left adornment wrapper. */
152
+ leftSlot;
153
+ /** The right adornment wrapper. */
154
+ rightSlot;
155
+ /** The right adornment inner span (React's ternary else branch). */
156
+ rightInner;
157
+ host = inject(ElementRef);
158
+ /**
159
+ * Reactive translation, read in the injection context. Its `t` reads the
160
+ * locale, so the view re-renders the text on a locale switch (the static `t`
161
+ * does not).
162
+ */
163
+ i18n = useTranslation();
164
+ sync = new SlotWrapper(inject(ElementRef), inject(Renderer2));
165
+ parents = new Map();
166
+ hasLeft = false;
167
+ hasRight = false;
168
+ movedRest = false;
169
+ /** The `aria-describedby` the caller spread onto the host (React's rest). */
170
+ restDescribedBy = null;
92
171
  /**
93
- * Retrieves the current UI class map.
94
- * @returns The UIClassMap instance for styling.
172
+ * The current class map.
173
+ * @returns The UIClassMap.
95
174
  */
96
- get cm() {
175
+ cm() {
97
176
  return getClassMap();
98
177
  }
99
178
  /**
100
- * Computes the accessible clear button label.
101
- * @returns The localized aria-label for the clear button.
179
+ * The input id (`id`, `name`, or a stable generated id; the DOM normalizer
180
+ * renumbers generated ids in order of appearance, like React's `useId`).
181
+ * @returns The id value.
102
182
  */
103
- get clearAriaLabel() {
104
- return this.clearLabel || t('ui.input.clear', undefined, { defaultValue: 'Clear' });
183
+ inputId() {
184
+ return this.id || this.fieldContext()?.id || this.name || 'r0';
105
185
  }
106
186
  /**
107
- * Retrieves the CSS class for form error messages.
108
- * @returns The form error class name string.
187
+ * The aria-describedby target (error or hint paragraph).
188
+ * @returns The id or null.
109
189
  */
110
- get formErrorClass() {
111
- return this.cm.formError;
190
+ describedBy() {
191
+ if (this.error)
192
+ return `${this.inputId()}-error`;
193
+ if (this.hint)
194
+ return `${this.inputId()}-hint`;
195
+ return null;
112
196
  }
113
197
  /**
114
- * Retrieves the CSS class for form hint messages.
115
- * @returns The form hint class name string.
198
+ * The nearest enclosing `FormField` context (React's cloned props).
199
+ * @returns The context, or null.
116
200
  */
117
- get formHintClass() {
118
- return this.cm.formHint;
201
+ fieldContext() {
202
+ return fieldContext(this.host.nativeElement);
119
203
  }
120
204
  /**
121
- * Resolves the input element ID.
122
- * @returns The resolved ID from the id or name input.
205
+ * The final `aria-describedby`: a rest-provided value first, then the
206
+ * enclosing FormField's error/hint target (React's cloneElement join).
207
+ * @returns The attribute value, or null.
123
208
  */
124
- get inputId() {
125
- return this.id || this.name || '';
209
+ mergedDescribedBy() {
210
+ const target = this.fieldContext()?.describedBy;
211
+ if (target)
212
+ return [this.restDescribedBy, target].filter(Boolean).join(' ');
213
+ return this.restDescribedBy ?? this.describedBy();
126
214
  }
127
215
  /**
128
- * Computes the aria-describedby attribute value.
129
- * @returns The ID of the describing element, or null if none.
216
+ * Computes the input class list.
217
+ * @returns The class string.
130
218
  */
131
- get ariaDescribedBy() {
132
- if (this.error)
133
- return `${this.inputId}-error`;
134
- if (this.hint)
135
- return `${this.inputId}-hint`;
136
- return null;
219
+ classes() {
220
+ return this.cm().cn(this.cm().input({
221
+ error: !!this.error,
222
+ size: this.size ?? 'md',
223
+ align: this.align === 'right' ? undefined : this.align,
224
+ }), this.hasLeft && this.cm().inputPadLeft, (this.hasRight || this.clearable) && this.cm().inputPadRight, this.className);
225
+ }
226
+ /**
227
+ * The clear button's accessible label.
228
+ * @returns The label text.
229
+ */
230
+ clearText() {
231
+ return this.clearLabel ?? this.i18n.t('ui.input.clear', undefined, { defaultValue: 'Clear' });
232
+ }
233
+ /**
234
+ * The clear button's X glyph.
235
+ * @returns The resolved icon.
236
+ */
237
+ clearIcon() {
238
+ return resolveIcon('x-mark', this.cm().iconSm);
239
+ }
240
+ /**
241
+ * Serializes the inline style for the input.
242
+ * @returns The style attribute text.
243
+ */
244
+ hostStyle() {
245
+ return styleText(this.style);
246
+ }
247
+ /**
248
+ * React's text-input onChange: the `input` event, with the controlled value
249
+ * restored afterwards.
250
+ *
251
+ * @param event - The native input event.
252
+ */
253
+ handleInput(event) {
254
+ event.stopPropagation();
255
+ this.change.emit(event);
256
+ const input = this.inputEl?.nativeElement;
257
+ if (this.value !== undefined && input && input.value !== String(this.value))
258
+ input.value = String(this.value);
259
+ }
260
+ /**
261
+ * The native change event never reaches the host (its `change` output
262
+ * binding would record it a second time; React's onChange already fired on
263
+ * the input event).
264
+ *
265
+ * @param event - The native change event.
266
+ */
267
+ handleChange(event) {
268
+ event.stopPropagation();
269
+ }
270
+ /**
271
+ * Reconciles the adornment wrappers every check: detects projected slot
272
+ * content (view queries resolve only at view init, so the very first pass —
273
+ * which runs before the view's bindings — falls back to structural sibling
274
+ * lookup), then attaches/detaches each wrapper exactly when React renders
275
+ * it. The input's class list depends on this detection, and `ngDoCheck`
276
+ * runs before the template bindings of the same pass, so the first render
277
+ * already carries the right padding classes.
278
+ */
279
+ ngDoCheck() {
280
+ const host = this.host.nativeElement;
281
+ const input = this.inputEl?.nativeElement ?? host.querySelector('input');
282
+ const left = this.leftSlot?.nativeElement ??
283
+ input?.previousElementSibling ??
284
+ undefined;
285
+ const right = this.rightSlot?.nativeElement ??
286
+ input?.nextElementSibling ??
287
+ undefined;
288
+ const inner = this.rightInner?.nativeElement ??
289
+ (right ? right.querySelector('span') : null) ??
290
+ undefined;
291
+ this.hasLeft = this.isGiven(this.leftElement) || hasNodes(left);
292
+ this.hasRight = this.isGiven(this.rightElement) || hasNodes(inner);
293
+ const clear = !!(this.clearable && this.value);
294
+ this.sync.sync(left, this.hasLeft, this.parentOf(left));
295
+ this.sync.sync(inner, this.hasRight && !clear, this.parentOf(inner));
296
+ this.sync.sync(right, this.hasRight || clear, this.parentOf(right));
297
+ if (!this.movedRest && input) {
298
+ this.restDescribedBy = host.getAttribute('aria-describedby');
299
+ moveRestAttributes(host, input);
300
+ this.movedRest = true;
301
+ }
302
+ // React's controlled input: the live value always follows the `value` prop
303
+ // after a re-render (the binding sets the attribute; the property is only
304
+ // moved by the browser on an uncontrolled edit).
305
+ if (this.value !== undefined && input && input.value !== String(this.value))
306
+ input.value = String(this.value);
137
307
  }
138
308
  /**
139
- * Computes the CSS classes for the input label.
140
- * @returns The label class name string.
309
+ * Remembers where an element lives while connected, so a re-attach after a
310
+ * detach lands in the original parent (never the component host).
311
+ *
312
+ * @param el - The wrapper element.
313
+ * @returns The original parent, if known.
141
314
  */
142
- get labelClasses() {
143
- return this.cm.cn(this.cm.label({ required: this.required }), this.cm.labelBlock);
315
+ parentOf(el) {
316
+ if (!el)
317
+ return undefined;
318
+ const cached = this.parents.get(el);
319
+ if (cached)
320
+ return cached;
321
+ if (el.parentElement) {
322
+ this.parents.set(el, el.parentElement);
323
+ return el.parentElement;
324
+ }
325
+ return undefined;
326
+ }
327
+ /**
328
+ * Casts a node-valued input to its TemplateRef form (the adapter projects
329
+ * node props as templates).
330
+ *
331
+ * @param value - The prop value.
332
+ * @returns The TemplateRef, or null.
333
+ */
334
+ asTemplate(value) {
335
+ return value instanceof TemplateRef ? value : null;
144
336
  }
145
337
  /**
146
- * Computes the combined CSS classes for the input element.
147
- * @returns The input class name string.
338
+ * Renders a plain-string node value (React renders strings as text).
339
+ *
340
+ * @param value - The prop value.
341
+ * @returns The text, or empty.
148
342
  */
149
- get inputClasses() {
150
- return this.cm.cn(this.cm.input({ error: !!this.error, size: this.size }), this.clearable && this.cm.inputPadRight, this.className);
343
+ asText(value) {
344
+ return typeof value === 'string' ? value : '';
151
345
  }
152
346
  /**
153
- * Generates the SVG markup for the clear button icon.
154
- * @returns The SVG string for the clear icon.
347
+ * Whether a node prop was passed (a TemplateRef or any non-null value).
348
+ *
349
+ * @param value - The prop value.
350
+ * @returns True when given.
155
351
  */
156
- get clearIconSvg() {
157
- return getIconSvg('x-mark', this.cm.iconSm);
352
+ isGiven(value) {
353
+ return value !== undefined && value !== null;
158
354
  }
159
- static ɵfac = function MoleculeInput_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MoleculeInput)(); };
160
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MoleculeInput, selectors: [["mol-input"]], inputs: { type: "type", size: "size", label: "label", error: "error", hint: "hint", clearable: "clearable", clearLabel: "clearLabel", className: "className", style: "style", testId: "testId", disabled: "disabled", required: "required", readOnly: "readOnly", value: "value", placeholder: "placeholder", name: "name", id: "id", maxLength: "maxLength", minLength: "minLength", pattern: "pattern", autoComplete: "autoComplete" }, outputs: { handleInput: "handleInput", handleChange: "handleChange", handleFocus: "handleFocus", handleBlur: "handleBlur", handleClear: "handleClear" }, decls: 7, vars: 27, consts: [[3, "class"], [3, "input", "change", "focus", "blur", "type", "id", "name", "value", "placeholder", "disabled", "required", "readOnly"], [3, "id", "class"], ["type", "button", 3, "click"], [3, "innerHTML"], [3, "id"]], template: function MoleculeInput_Template(rf, ctx) { if (rf & 1) {
161
- i0.ɵɵdomElementStart(0, "div");
162
- i0.ɵɵconditionalCreate(1, MoleculeInput_Conditional_1_Template, 2, 4, "label", 0);
163
- i0.ɵɵdomElementStart(2, "div")(3, "input", 1);
164
- i0.ɵɵdomListener("input", function MoleculeInput_Template_input_input_3_listener($event) { return ctx.handleInput.emit($event); })("change", function MoleculeInput_Template_input_change_3_listener($event) { return ctx.handleChange.emit($event); })("focus", function MoleculeInput_Template_input_focus_3_listener($event) { return ctx.handleFocus.emit($event); })("blur", function MoleculeInput_Template_input_blur_3_listener($event) { return ctx.handleBlur.emit($event); });
165
- i0.ɵɵdomElementEnd();
166
- i0.ɵɵconditionalCreate(4, MoleculeInput_Conditional_4_Template, 3, 6, "div", 0);
167
- i0.ɵɵdomElementEnd();
168
- i0.ɵɵconditionalCreate(5, MoleculeInput_Conditional_5_Template, 2, 4, "p", 2);
169
- i0.ɵɵconditionalCreate(6, MoleculeInput_Conditional_6_Template, 2, 4, "p", 2);
170
- i0.ɵɵdomElementEnd();
355
+ static ɵfac = function Input_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Input)(); };
356
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Input, selectors: [["div", "mol-input", ""]], viewQuery: function Input_Query(rf, ctx) { if (rf & 1) {
357
+ i0.ɵɵviewQuery(_c0, 5)(_c1, 5)(_c2, 5)(_c3, 5);
171
358
  } if (rf & 2) {
172
- i0.ɵɵclassMap(ctx.cm.inputWrapper);
173
- i0.ɵɵadvance();
174
- i0.ɵɵconditional(ctx.label ? 1 : -1);
175
- i0.ɵɵadvance();
176
- i0.ɵɵclassMap(ctx.cm.inputInner);
359
+ let _t;
360
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.inputEl = _t.first);
361
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.leftSlot = _t.first);
362
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.rightSlot = _t.first);
363
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.rightInner = _t.first);
364
+ } }, hostVars: 2, hostBindings: function Input_HostBindings(rf, ctx) { if (rf & 2) {
365
+ i0.ɵɵclassMap(ctx.cm().inputWrapper);
366
+ } }, inputs: { type: "type", size: "size", align: "align", label: "label", error: "error", hint: "hint", leftElement: "leftElement", rightElement: "rightElement", clearable: "clearable", clearLabel: "clearLabel", className: "className", style: "style", testId: "testId", disabled: "disabled", required: "required", value: "value", defaultValue: "defaultValue", placeholder: "placeholder", name: "name", id: "id" }, outputs: { change: "change", clear: "clear" }, ngContentSelectors: _c5, decls: 19, vars: 27, consts: [["leftSlot", ""], ["inputEl", ""], ["rightSlot", ""], ["rightInner", ""], [3, "class"], [3, "ngTemplateOutlet"], [3, "input", "change", "disabled"], ["type", "button", 3, "class"], ["type", "button", 3, "click"], ["mol-icon", "", 3, "data"]], template: function Input_Template(rf, ctx) { if (rf & 1) {
367
+ i0.ɵɵprojectionDef(_c4);
368
+ i0.ɵɵconditionalCreate(0, Input_Conditional_0_Template, 2, 6, "label", 4);
369
+ i0.ɵɵelementStart(1, "div")(2, "div", null, 0);
370
+ i0.ɵɵprojection(4);
371
+ i0.ɵɵconditionalCreate(5, Input_Conditional_5_Template, 1, 1, "ng-container", 5)(6, Input_Conditional_6_Template, 1, 1);
372
+ i0.ɵɵelementEnd();
373
+ i0.ɵɵelementStart(7, "input", 6, 1);
374
+ i0.ɵɵlistener("input", function Input_Template_input_input_7_listener($event) { return ctx.handleInput($event); })("change", function Input_Template_input_change_7_listener($event) { return ctx.handleChange($event); });
375
+ i0.ɵɵelementEnd();
376
+ i0.ɵɵelementStart(9, "div", null, 2);
377
+ i0.ɵɵconditionalCreate(11, Input_Conditional_11_Template, 2, 4, "button", 7);
378
+ i0.ɵɵelementStart(12, "span", null, 3);
379
+ i0.ɵɵprojection(14, 1);
380
+ i0.ɵɵconditionalCreate(15, Input_Conditional_15_Template, 1, 1, "ng-container", 5)(16, Input_Conditional_16_Template, 1, 1);
381
+ i0.ɵɵelementEnd()()();
382
+ i0.ɵɵconditionalCreate(17, Input_Conditional_17_Template, 2, 4, "p", 4);
383
+ i0.ɵɵconditionalCreate(18, Input_Conditional_18_Template, 2, 4, "p", 4);
384
+ } if (rf & 2) {
385
+ let tmp_7_0;
386
+ let tmp_23_0;
387
+ i0.ɵɵconditional(ctx.label ? 0 : -1);
177
388
  i0.ɵɵadvance();
178
- i0.ɵɵstyleMap(ctx.style);
179
- i0.ɵɵclassMap(ctx.inputClasses);
180
- i0.ɵɵdomProperty("type", ctx.type)("id", ctx.inputId)("name", ctx.name)("value", ctx.value)("placeholder", ctx.placeholder)("disabled", ctx.disabled)("required", ctx.required)("readOnly", ctx.readOnly);
181
- i0.ɵɵattribute("aria-invalid", !!ctx.error)("aria-describedby", ctx.ariaDescribedBy)("data-testid", ctx.testId)("maxlength", ctx.maxLength)("minlength", ctx.minLength)("pattern", ctx.pattern)("autocomplete", ctx.autoComplete);
389
+ i0.ɵɵclassMap(ctx.cm().inputInner);
182
390
  i0.ɵɵadvance();
183
- i0.ɵɵconditional(ctx.clearable && ctx.value ? 4 : -1);
391
+ i0.ɵɵclassMap(ctx.cm().inputLeftElement);
392
+ i0.ɵɵadvance(3);
393
+ i0.ɵɵconditional((tmp_7_0 = ctx.asTemplate(ctx.leftElement)) ? 5 : 6, tmp_7_0);
394
+ i0.ɵɵadvance(2);
395
+ i0.ɵɵclassMap(ctx.classes());
396
+ i0.ɵɵproperty("disabled", ctx.disabled);
397
+ i0.ɵɵattribute("type", ctx.type ?? "text")("id", ctx.inputId())("name", ctx.name)("value", ctx.value ?? ctx.defaultValue)("placeholder", ctx.placeholder)("required", ctx.required ? "" : null)("aria-invalid", ctx.error || ctx.fieldContext()?.invalid ? "true" : "false")("aria-describedby", ctx.mergedDescribedBy())("style", ctx.hostStyle(), i0.ɵɵsanitizeStyle)("data-testid", ctx.testId);
398
+ i0.ɵɵadvance(2);
399
+ i0.ɵɵclassMap(ctx.cm().inputRightElement);
400
+ i0.ɵɵadvance(2);
401
+ i0.ɵɵconditional(ctx.clearable && ctx.value ? 11 : -1);
184
402
  i0.ɵɵadvance();
185
- i0.ɵɵconditional(ctx.error ? 5 : -1);
403
+ i0.ɵɵclassMap(ctx.cm().textMuted);
404
+ i0.ɵɵadvance(3);
405
+ i0.ɵɵconditional((tmp_23_0 = ctx.asTemplate(ctx.rightElement)) ? 15 : 16, tmp_23_0);
406
+ i0.ɵɵadvance(2);
407
+ i0.ɵɵconditional(ctx.error ? 17 : -1);
186
408
  i0.ɵɵadvance();
187
- i0.ɵɵconditional(ctx.hint && !ctx.error ? 6 : -1);
188
- } }, encapsulation: 2 });
409
+ i0.ɵɵconditional(ctx.hint && !ctx.error ? 18 : -1);
410
+ } }, dependencies: [MolIconSvg, NgTemplateOutlet], encapsulation: 2 });
189
411
  }
190
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MoleculeInput, [{
412
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Input, [{
191
413
  type: Component,
192
414
  args: [{
193
- selector: 'mol-input',
415
+ selector: 'div[mol-input]',
194
416
  standalone: true,
195
- changeDetection: ChangeDetectionStrategy.OnPush,
196
- template: `
197
- <div [class]="cm.inputWrapper">
198
- @if (label) {
199
- <label [attr.for]="inputId" [class]="labelClasses">
200
- {{ label }}
201
- </label>
202
- }
203
- <div [class]="cm.inputInner">
204
- <input
205
- [type]="type"
206
- [id]="inputId"
207
- [name]="name"
208
- [value]="value"
209
- [placeholder]="placeholder"
210
- [disabled]="disabled"
211
- [required]="required"
212
- [readOnly]="readOnly"
213
- [attr.aria-invalid]="!!error"
214
- [attr.aria-describedby]="ariaDescribedBy"
215
- [class]="inputClasses"
216
- [style]="style"
217
- [attr.data-testid]="testId"
218
- [attr.maxlength]="maxLength"
219
- [attr.minlength]="minLength"
220
- [attr.pattern]="pattern"
221
- [attr.autocomplete]="autoComplete"
222
- (input)="handleInput.emit($event)"
223
- (change)="handleChange.emit($event)"
224
- (focus)="handleFocus.emit($event)"
225
- (blur)="handleBlur.emit($event)"
226
- />
417
+ imports: [MolIconSvg, NgTemplateOutlet],
418
+ inputs: [
419
+ 'type',
420
+ 'size',
421
+ 'align',
422
+ 'label',
423
+ 'error',
424
+ 'hint',
425
+ 'leftElement',
426
+ 'rightElement',
427
+ 'clearable',
428
+ 'clearLabel',
429
+ 'className',
430
+ 'style',
431
+ 'testId',
432
+ 'disabled',
433
+ 'required',
434
+ 'value',
435
+ 'defaultValue',
436
+ 'placeholder',
437
+ 'name',
438
+ 'id',
439
+ ],
440
+ host: {
441
+ '[class]': 'cm().inputWrapper',
442
+ },
443
+ template: `@if (label) {
444
+ <label
445
+ [attr.for]="inputId()"
446
+ [class]="cm().cn(cm().label({ required: !!required }), cm().labelBlock)"
447
+ >{{ label }}</label
448
+ >
449
+ }
450
+ <div [class]="cm().inputInner">
451
+ <div [class]="cm().inputLeftElement" #leftSlot>
452
+ <ng-content select="[slot=leftElement]"></ng-content>
453
+ @if (asTemplate(leftElement); as tpl) {
454
+ <ng-container [ngTemplateOutlet]="tpl" />
455
+ } @else {
456
+ {{ asText(leftElement) }}
457
+ }
458
+ </div>
459
+ <input
460
+ [attr.type]="type ?? 'text'"
461
+ [attr.id]="inputId()"
462
+ [attr.name]="name"
463
+ [attr.value]="value ?? defaultValue"
464
+ [attr.placeholder]="placeholder"
465
+ [disabled]="disabled"
466
+ [attr.required]="required ? '' : null"
467
+ [attr.aria-invalid]="error || fieldContext()?.invalid ? 'true' : 'false'"
468
+ [attr.aria-describedby]="mergedDescribedBy()"
469
+ [class]="classes()"
470
+ [attr.style]="hostStyle()"
471
+ [attr.data-testid]="testId"
472
+ (input)="handleInput($event)"
473
+ (change)="handleChange($event)"
474
+ #inputEl
475
+ />
476
+ <div [class]="cm().inputRightElement" #rightSlot>
227
477
  @if (clearable && value) {
228
- <div [class]="cm.inputClearButton">
229
- <button
230
- type="button"
231
- (click)="handleClear.emit()"
232
- [class]="cm.inputClearButton"
233
- [attr.aria-label]="clearAriaLabel"
234
- >
235
- <span [innerHTML]="clearIconSvg"></span>
236
- </button>
237
- </div>
478
+ <button
479
+ type="button"
480
+ (click)="clear.emit($event)"
481
+ [class]="cm().inputClearButton"
482
+ [attr.aria-label]="clearText()"
483
+ >
484
+ <svg mol-icon [data]="clearIcon()" />
485
+ </button>
238
486
  }
487
+ <span [class]="cm().textMuted" #rightInner
488
+ ><ng-content select="[slot=rightElement]"></ng-content>
489
+ @if (asTemplate(rightElement); as tpl) {
490
+ <ng-container [ngTemplateOutlet]="tpl" />
491
+ } @else {
492
+ {{ asText(rightElement) }}
493
+ }
494
+ </span>
239
495
  </div>
240
- @if (error) {
241
- <p [id]="inputId + '-error'" [class]="formErrorClass">
242
- {{ error }}
243
- </p>
244
- }
245
- @if (hint && !error) {
246
- <p [id]="inputId + '-hint'" [class]="formHintClass">
247
- {{ hint }}
248
- </p>
249
- }
250
496
  </div>
251
- `,
497
+ @if (error) {
498
+ <p [attr.id]="inputId() + '-error'" [class]="cm().formError">{{ error }}</p>
499
+ }
500
+ @if (hint && !error) {
501
+ <p [attr.id]="inputId() + '-hint'" [class]="cm().formHint">{{ hint }}</p>
502
+ }`,
252
503
  }]
253
- }], null, { type: [{
254
- type: Input
255
- }], size: [{
256
- type: Input
257
- }], label: [{
258
- type: Input
259
- }], error: [{
260
- type: Input
261
- }], hint: [{
262
- type: Input
263
- }], clearable: [{
264
- type: Input
265
- }], clearLabel: [{
266
- type: Input
267
- }], className: [{
268
- type: Input
269
- }], style: [{
270
- type: Input
271
- }], testId: [{
272
- type: Input
273
- }], disabled: [{
274
- type: Input
275
- }], required: [{
276
- type: Input
277
- }], readOnly: [{
278
- type: Input
279
- }], value: [{
280
- type: Input
281
- }], placeholder: [{
282
- type: Input
283
- }], name: [{
284
- type: Input
285
- }], id: [{
286
- type: Input
287
- }], maxLength: [{
288
- type: Input
289
- }], minLength: [{
290
- type: Input
291
- }], pattern: [{
292
- type: Input
293
- }], autoComplete: [{
294
- type: Input
295
- }], handleInput: [{
296
- type: Output
297
- }], handleChange: [{
298
- type: Output
299
- }], handleFocus: [{
300
- type: Output
301
- }], handleBlur: [{
504
+ }], null, { change: [{
302
505
  type: Output
303
- }], handleClear: [{
506
+ }], clear: [{
304
507
  type: Output
508
+ }], inputEl: [{
509
+ type: ViewChild,
510
+ args: ['inputEl']
511
+ }], leftSlot: [{
512
+ type: ViewChild,
513
+ args: ['leftSlot']
514
+ }], rightSlot: [{
515
+ type: ViewChild,
516
+ args: ['rightSlot']
517
+ }], rightInner: [{
518
+ type: ViewChild,
519
+ args: ['rightInner']
305
520
  }] }); })();
306
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MoleculeInput, { className: "MoleculeInput", filePath: "components/input.component.ts", lineNumber: 82 }); })();
521
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Input, { className: "Input", filePath: "components/input.component.ts", lineNumber: 133 }); })();
307
522
  //# sourceMappingURL=input.component.js.map