@molecule/app-ui-angular 1.2.0 → 1.3.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 (212) hide show
  1. package/README.md +2796 -800
  2. package/dist/components/accordion.component.d.ts +17 -2
  3. package/dist/components/accordion.component.d.ts.map +1 -1
  4. package/dist/components/accordion.component.js +31 -7
  5. package/dist/components/accordion.component.js.map +1 -1
  6. package/dist/components/alert.component.d.ts +15 -2
  7. package/dist/components/alert.component.d.ts.map +1 -1
  8. package/dist/components/alert.component.js +25 -4
  9. package/dist/components/alert.component.js.map +1 -1
  10. package/dist/components/auth-guard.component.d.ts +41 -9
  11. package/dist/components/auth-guard.component.d.ts.map +1 -1
  12. package/dist/components/auth-guard.component.js +58 -23
  13. package/dist/components/auth-guard.component.js.map +1 -1
  14. package/dist/components/avatar.component.d.ts +15 -2
  15. package/dist/components/avatar.component.d.ts.map +1 -1
  16. package/dist/components/avatar.component.js +35 -5
  17. package/dist/components/avatar.component.js.map +1 -1
  18. package/dist/components/badge.component.d.ts +15 -2
  19. package/dist/components/badge.component.d.ts.map +1 -1
  20. package/dist/components/badge.component.js +35 -6
  21. package/dist/components/badge.component.js.map +1 -1
  22. package/dist/components/button.component.d.ts +20 -2
  23. package/dist/components/button.component.d.ts.map +1 -1
  24. package/dist/components/button.component.js +30 -4
  25. package/dist/components/button.component.js.map +1 -1
  26. package/dist/components/card.component.d.ts +67 -9
  27. package/dist/components/card.component.d.ts.map +1 -1
  28. package/dist/components/card.component.js +99 -17
  29. package/dist/components/card.component.js.map +1 -1
  30. package/dist/components/checkbox.component.d.ts +35 -5
  31. package/dist/components/checkbox.component.d.ts.map +1 -1
  32. package/dist/components/checkbox.component.js +59 -9
  33. package/dist/components/checkbox.component.js.map +1 -1
  34. package/dist/components/confirm-button.component.d.ts +85 -17
  35. package/dist/components/confirm-button.component.d.ts.map +1 -1
  36. package/dist/components/confirm-button.component.js +112 -25
  37. package/dist/components/confirm-button.component.js.map +1 -1
  38. package/dist/components/confirm-dialog.component.d.ts +50 -13
  39. package/dist/components/confirm-dialog.component.d.ts.map +1 -1
  40. package/dist/components/confirm-dialog.component.js +118 -31
  41. package/dist/components/confirm-dialog.component.js.map +1 -1
  42. package/dist/components/dropdown.component.d.ts +32 -5
  43. package/dist/components/dropdown.component.d.ts.map +1 -1
  44. package/dist/components/dropdown.component.js +86 -17
  45. package/dist/components/dropdown.component.js.map +1 -1
  46. package/dist/components/empty-state.component.d.ts +5 -1
  47. package/dist/components/empty-state.component.d.ts.map +1 -1
  48. package/dist/components/empty-state.component.js +5 -1
  49. package/dist/components/empty-state.component.js.map +1 -1
  50. package/dist/components/floating-input.component.d.ts +18 -4
  51. package/dist/components/floating-input.component.d.ts.map +1 -1
  52. package/dist/components/floating-input.component.js +38 -8
  53. package/dist/components/floating-input.component.js.map +1 -1
  54. package/dist/components/form-field.component.d.ts +14 -2
  55. package/dist/components/form-field.component.d.ts.map +1 -1
  56. package/dist/components/form-field.component.js +34 -5
  57. package/dist/components/form-field.component.js.map +1 -1
  58. package/dist/components/form.component.d.ts +61 -15
  59. package/dist/components/form.component.d.ts.map +1 -1
  60. package/dist/components/form.component.js +65 -14
  61. package/dist/components/form.component.js.map +1 -1
  62. package/dist/components/icon.component.d.ts +22 -4
  63. package/dist/components/icon.component.d.ts.map +1 -1
  64. package/dist/components/icon.component.js +1 -1
  65. package/dist/components/icon.component.js.map +1 -1
  66. package/dist/components/input.component.d.ts +34 -4
  67. package/dist/components/input.component.d.ts.map +1 -1
  68. package/dist/components/input.component.js +66 -11
  69. package/dist/components/input.component.js.map +1 -1
  70. package/dist/components/label.component.d.ts +5 -1
  71. package/dist/components/label.component.d.ts.map +1 -1
  72. package/dist/components/label.component.js +6 -2
  73. package/dist/components/label.component.js.map +1 -1
  74. package/dist/components/language-picker.component.d.ts +44 -8
  75. package/dist/components/language-picker.component.d.ts.map +1 -1
  76. package/dist/components/language-picker.component.js +29 -17
  77. package/dist/components/language-picker.component.js.map +1 -1
  78. package/dist/components/layout.component.d.ts +57 -8
  79. package/dist/components/layout.component.d.ts.map +1 -1
  80. package/dist/components/layout.component.js +134 -21
  81. package/dist/components/layout.component.js.map +1 -1
  82. package/dist/components/load-error-banner.component.d.ts +39 -7
  83. package/dist/components/load-error-banner.component.d.ts.map +1 -1
  84. package/dist/components/load-error-banner.component.js +68 -21
  85. package/dist/components/load-error-banner.component.js.map +1 -1
  86. package/dist/components/modal.component.d.ts +20 -3
  87. package/dist/components/modal.component.d.ts.map +1 -1
  88. package/dist/components/modal.component.js +40 -6
  89. package/dist/components/modal.component.js.map +1 -1
  90. package/dist/components/optimistic-toggle-button.component.d.ts +80 -19
  91. package/dist/components/optimistic-toggle-button.component.d.ts.map +1 -1
  92. package/dist/components/optimistic-toggle-button.component.js +86 -25
  93. package/dist/components/optimistic-toggle-button.component.js.map +1 -1
  94. package/dist/components/page-header.component.d.ts +5 -1
  95. package/dist/components/page-header.component.d.ts.map +1 -1
  96. package/dist/components/page-header.component.js +5 -1
  97. package/dist/components/page-header.component.js.map +1 -1
  98. package/dist/components/page-shell.component.d.ts +5 -1
  99. package/dist/components/page-shell.component.d.ts.map +1 -1
  100. package/dist/components/page-shell.component.js +5 -1
  101. package/dist/components/page-shell.component.js.map +1 -1
  102. package/dist/components/pagination.component.d.ts +15 -2
  103. package/dist/components/pagination.component.d.ts.map +1 -1
  104. package/dist/components/pagination.component.js +26 -5
  105. package/dist/components/pagination.component.js.map +1 -1
  106. package/dist/components/panel-close.component.d.ts +10 -1
  107. package/dist/components/panel-close.component.d.ts.map +1 -1
  108. package/dist/components/panel-close.component.js +1 -1
  109. package/dist/components/panel-close.component.js.map +1 -1
  110. package/dist/components/progress.component.d.ts +51 -8
  111. package/dist/components/progress.component.d.ts.map +1 -1
  112. package/dist/components/progress.component.js +26 -5
  113. package/dist/components/progress.component.js.map +1 -1
  114. package/dist/components/prompt-dialog.component.d.ts +59 -16
  115. package/dist/components/prompt-dialog.component.d.ts.map +1 -1
  116. package/dist/components/prompt-dialog.component.js +129 -41
  117. package/dist/components/prompt-dialog.component.js.map +1 -1
  118. package/dist/components/radio-group.component.d.ts +16 -2
  119. package/dist/components/radio-group.component.d.ts.map +1 -1
  120. package/dist/components/radio-group.component.js +28 -5
  121. package/dist/components/radio-group.component.js.map +1 -1
  122. package/dist/components/responsive-app-shell.component.d.ts +155 -31
  123. package/dist/components/responsive-app-shell.component.d.ts.map +1 -1
  124. package/dist/components/responsive-app-shell.component.js +163 -54
  125. package/dist/components/responsive-app-shell.component.js.map +1 -1
  126. package/dist/components/select.component.d.ts +29 -4
  127. package/dist/components/select.component.d.ts.map +1 -1
  128. package/dist/components/select.component.js +55 -9
  129. package/dist/components/select.component.js.map +1 -1
  130. package/dist/components/separator.component.d.ts +37 -7
  131. package/dist/components/separator.component.d.ts.map +1 -1
  132. package/dist/components/separator.component.js +33 -6
  133. package/dist/components/separator.component.js.map +1 -1
  134. package/dist/components/sidebar-user-card.component.d.ts +28 -7
  135. package/dist/components/sidebar-user-card.component.d.ts.map +1 -1
  136. package/dist/components/sidebar-user-card.component.js +1 -1
  137. package/dist/components/sidebar-user-card.component.js.map +1 -1
  138. package/dist/components/skeleton.component.d.ts +23 -4
  139. package/dist/components/skeleton.component.d.ts.map +1 -1
  140. package/dist/components/skeleton.component.js +34 -7
  141. package/dist/components/skeleton.component.js.map +1 -1
  142. package/dist/components/spinner.component.d.ts +15 -2
  143. package/dist/components/spinner.component.d.ts.map +1 -1
  144. package/dist/components/spinner.component.js +34 -6
  145. package/dist/components/spinner.component.js.map +1 -1
  146. package/dist/components/switch.component.d.ts +30 -7
  147. package/dist/components/switch.component.d.ts.map +1 -1
  148. package/dist/components/switch.component.js +56 -11
  149. package/dist/components/switch.component.js.map +1 -1
  150. package/dist/components/table.component.d.ts +29 -3
  151. package/dist/components/table.component.d.ts.map +1 -1
  152. package/dist/components/table.component.js +63 -8
  153. package/dist/components/table.component.js.map +1 -1
  154. package/dist/components/tabs.component.d.ts +18 -3
  155. package/dist/components/tabs.component.d.ts.map +1 -1
  156. package/dist/components/tabs.component.js +74 -39
  157. package/dist/components/tabs.component.js.map +1 -1
  158. package/dist/components/textarea.component.d.ts +29 -4
  159. package/dist/components/textarea.component.d.ts.map +1 -1
  160. package/dist/components/textarea.component.js +55 -9
  161. package/dist/components/textarea.component.js.map +1 -1
  162. package/dist/components/theme-toggle.component.d.ts +25 -6
  163. package/dist/components/theme-toggle.component.d.ts.map +1 -1
  164. package/dist/components/theme-toggle.component.js +1 -1
  165. package/dist/components/theme-toggle.component.js.map +1 -1
  166. package/dist/components/toast.component.d.ts +27 -6
  167. package/dist/components/toast.component.d.ts.map +1 -1
  168. package/dist/components/toast.component.js +48 -14
  169. package/dist/components/toast.component.js.map +1 -1
  170. package/dist/components/tooltip.component.d.ts +57 -5
  171. package/dist/components/tooltip.component.d.ts.map +1 -1
  172. package/dist/components/tooltip.component.js +103 -11
  173. package/dist/components/tooltip.component.js.map +1 -1
  174. package/dist/components/user-menu-popover.component.d.ts +68 -14
  175. package/dist/components/user-menu-popover.component.d.ts.map +1 -1
  176. package/dist/components/user-menu-popover.component.js +4 -4
  177. package/dist/components/user-menu-popover.component.js.map +1 -1
  178. package/dist/components/user-menu.component.d.ts +33 -9
  179. package/dist/components/user-menu.component.d.ts.map +1 -1
  180. package/dist/components/user-menu.component.js +1 -1
  181. package/dist/components/user-menu.component.js.map +1 -1
  182. package/dist/index.d.ts +4 -0
  183. package/dist/index.d.ts.map +1 -1
  184. package/dist/index.js +4 -0
  185. package/dist/index.js.map +1 -1
  186. package/dist/types.d.ts +1 -1
  187. package/dist/types.d.ts.map +1 -1
  188. package/dist/utilities/element-props.d.ts +78 -0
  189. package/dist/utilities/element-props.d.ts.map +1 -0
  190. package/dist/utilities/element-props.js +166 -0
  191. package/dist/utilities/element-props.js.map +1 -0
  192. package/dist/utilities/element.d.ts +34 -0
  193. package/dist/utilities/element.d.ts.map +1 -0
  194. package/dist/utilities/element.js +24 -0
  195. package/dist/utilities/element.js.map +1 -0
  196. package/dist/utilities/index.d.ts +2 -0
  197. package/dist/utilities/index.d.ts.map +1 -1
  198. package/dist/utilities/index.js +2 -0
  199. package/dist/utilities/index.js.map +1 -1
  200. package/dist/utilities/node-value.d.ts +1 -1
  201. package/dist/utilities/node-value.d.ts.map +1 -1
  202. package/dist/utilities/node-value.js +6 -2
  203. package/dist/utilities/node-value.js.map +1 -1
  204. package/dist/utilities/render-icon.d.ts +3 -2
  205. package/dist/utilities/render-icon.d.ts.map +1 -1
  206. package/dist/utilities/render-icon.js +6 -3
  207. package/dist/utilities/render-icon.js.map +1 -1
  208. package/dist/utilities/rest-attrs.d.ts +26 -2
  209. package/dist/utilities/rest-attrs.d.ts.map +1 -1
  210. package/dist/utilities/rest-attrs.js +37 -0
  211. package/dist/utilities/rest-attrs.js.map +1 -1
  212. package/package.json +4 -3
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { Component, ElementRef, inject, Renderer2, ViewChild, } from '@angular/core';
7
7
  import { getClassMap } from '@molecule/app-ui';
8
+ import { hostElement } from '../utilities/element.js';
8
9
  import { styleText } from '../utilities/style.js';
9
10
  import { Spinner } from './spinner.component.js';
10
11
  import * as i0 from "@angular/core";
@@ -134,6 +135,13 @@ export class Button {
134
135
  style;
135
136
  /** `data-testid` for the button. */
136
137
  testId;
138
+ /** `data-mol-id` automation id (React's `automationId`). */
139
+ automationId;
140
+ /**
141
+ * A `data-mol-id` passed as a plain rest attribute (React spreads it onto
142
+ * the root); `automationId` wins when both are given.
143
+ */
144
+ dataMolId;
137
145
  /** Disables the button. */
138
146
  disabled = false;
139
147
  /** The button's `type` attribute. */
@@ -143,6 +151,9 @@ export class Button {
143
151
  /** The right icon wrapper. */
144
152
  rightSlot;
145
153
  sync = new SlotWrapper(inject(ElementRef), inject(Renderer2));
154
+ host = inject(ElementRef);
155
+ /** The element a caller's ref receives: the host `<button>`. */
156
+ element = hostElement(this.host);
146
157
  /**
147
158
  * The current class map.
148
159
  * @returns The UIClassMap.
@@ -150,6 +161,18 @@ export class Button {
150
161
  cm() {
151
162
  return getClassMap();
152
163
  }
164
+ /**
165
+ * The `data-mol-id` value: `automationId` when given, else a caller's own
166
+ * `data-mol-id` (the `dataMolId` prop or a `[attr.data-mol-id]` binding on
167
+ * the element), matching React's `rootProps` precedence.
168
+ * @returns The attribute value, or undefined.
169
+ */
170
+ molId() {
171
+ return (this.automationId ??
172
+ this.dataMolId ??
173
+ this.host.nativeElement.getAttribute('data-mol-id') ??
174
+ undefined);
175
+ }
153
176
  /**
154
177
  * Computes the button class list.
155
178
  * @returns The class string.
@@ -203,12 +226,12 @@ export class Button {
203
226
  let _t;
204
227
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.leftSlot = _t.first);
205
228
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.rightSlot = _t.first);
206
- } }, hostVars: 8, hostBindings: function Button_HostBindings(rf, ctx) { if (rf & 2) {
229
+ } }, hostVars: 9, hostBindings: function Button_HostBindings(rf, ctx) { if (rf & 2) {
207
230
  i0.ɵɵdomProperty("disabled", ctx.disabled || ctx.loading);
208
- i0.ɵɵattribute("data-testid", ctx.testId)("type", ctx.type)("aria-busy", ctx.loading ? "true" : "false");
231
+ i0.ɵɵattribute("data-testid", ctx.testId)("data-mol-id", ctx.molId())("type", ctx.type)("aria-busy", ctx.loading ? "true" : "false");
209
232
  i0.ɵɵstyleMap(ctx.hostStyle());
210
233
  i0.ɵɵclassMap(ctx.classes());
211
- } }, inputs: { variant: "variant", color: "color", size: "size", loading: "loading", loadingText: "loadingText", fullWidth: "fullWidth", className: "className", style: "style", testId: "testId", disabled: "disabled", type: "type" }, ngContentSelectors: _c3, decls: 9, vars: 6, consts: [["leftSlot", ""], ["rightSlot", ""], ["mol-spinner", "", 3, "size", "className"]], template: function Button_Template(rf, ctx) { if (rf & 1) {
234
+ } }, inputs: { variant: "variant", color: "color", size: "size", loading: "loading", loadingText: "loadingText", fullWidth: "fullWidth", className: "className", style: "style", testId: "testId", disabled: "disabled", type: "type", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"] }, ngContentSelectors: _c3, decls: 9, vars: 6, consts: [["leftSlot", ""], ["rightSlot", ""], ["mol-spinner", "", 3, "size", "className"]], template: function Button_Template(rf, ctx) { if (rf & 1) {
212
235
  i0.ɵɵprojectionDef(_c2);
213
236
  i0.ɵɵconditionalCreate(0, Button_Conditional_0_Template, 1, 2, "div", 2);
214
237
  i0.ɵɵelementStart(1, "span", null, 0);
@@ -246,11 +269,14 @@ export class Button {
246
269
  'testId',
247
270
  'disabled',
248
271
  'type',
272
+ 'automationId',
273
+ 'dataMolId: data-mol-id',
249
274
  ],
250
275
  host: {
251
276
  '[class]': 'classes()',
252
277
  '[style]': 'hostStyle()',
253
278
  '[attr.data-testid]': 'testId',
279
+ '[attr.data-mol-id]': 'molId()',
254
280
  '[attr.type]': 'type',
255
281
  '[disabled]': 'disabled || loading',
256
282
  '[attr.aria-busy]': 'loading ? "true" : "false"',
@@ -277,5 +303,5 @@ export class Button {
277
303
  type: ViewChild,
278
304
  args: ['rightSlot']
279
305
  }] }); })();
280
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Button, { className: "Button", filePath: "components/button.component.ts", lineNumber: 144 }); })();
306
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Button, { className: "Button", filePath: "components/button.component.ts", lineNumber: 148 }); })();
281
307
  //# sourceMappingURL=button.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.component.js","sourceRoot":"","sources":["../../src/components/button.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,SAAS,EAET,UAAU,EACV,MAAM,EACN,SAAS,EACT,SAAS,GACV,MAAM,eAAe,CAAA;AAGtB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,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B,uCAA8B;4BApC5B,OAAO;;iFAwCN,MAAM;cA3ClB,SAAS;eAAC;gBACT,QAAQ,EAAE,oBAAoB;gBAC9B,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE;oBACN,SAAS;oBACT,OAAO;oBACP,MAAM;oBACN,SAAS;oBACT,aAAa;oBACb,WAAW;oBACX,WAAW;oBACX,OAAO;oBACP,QAAQ;oBACR,UAAU;oBACV,MAAM;oBACN,cAAc;oBACd,wBAAwB;iBACzB;gBACD,IAAI,EAAE;oBACJ,SAAS,EAAE,WAAW;oBACtB,SAAS,EAAE,aAAa;oBACxB,oBAAoB,EAAE,QAAQ;oBAC9B,oBAAoB,EAAE,SAAS;oBAC/B,aAAa,EAAE,MAAM;oBACrB,YAAY,EAAE,qBAAqB;oBACnC,kBAAkB,EAAE,4BAA4B;iBACjD;gBACD,QAAQ,EAAE;;;;;;;;;;;;;aAaC;aACZ;;kBAiCE,SAAS;mBAAC,UAAU;;kBAEpB,SAAS;mBAAC,WAAW;;kFAlCX,MAAM"}
@@ -1,12 +1,27 @@
1
- import type { UIClassMap } from '@molecule/app-ui';
1
+ /**
2
+ * Card components (React parity): Card, CardHeader, CardTitle,
3
+ * CardDescription, CardContent, CardFooter.
4
+ *
5
+ * @module
6
+ */
7
+ import { type OnInit } from '@angular/core';
8
+ import type { MouseEventHandler, UIClassMap } from '@molecule/app-ui';
9
+ import { type HasElement } from '../utilities/element.js';
2
10
  import * as i0 from "@angular/core";
3
11
  /**
4
12
  * Card component.
5
13
  *
6
14
  * An interactive card renders `role="button"` and joins the keyboard tab
7
- * order; rest props (`aria-*`, `data-*`, `id`) land on the host.
15
+ * order; rest props (`id`, `title`, `aria-*`, `data-*`) and event bindings
16
+ * (`(focusin)`, `(dblclick)`, `(keydown)`, …) land on the host, and a
17
+ * caller's `(keydown)` runs before the Enter/Space activation.
8
18
  */
9
- export declare class Card {
19
+ export declare class Card implements OnInit, HasElement<HTMLDivElement> {
20
+ private readonly host;
21
+ /** The element a caller's ref receives: the host `<div>`. */
22
+ readonly element: import("@angular/core").Signal<HTMLDivElement | null>;
23
+ private readonly renderer;
24
+ private readonly destroyRef;
10
25
  /** Card variant. */
11
26
  variant: 'default' | 'elevated' | 'outlined' | 'filled' | 'ghost';
12
27
  /** Whether the card is keyboard-interactive. */
@@ -19,6 +34,14 @@ export declare class Card {
19
34
  style?: Record<string, unknown>;
20
35
  /** `data-testid`. */
21
36
  testId?: string;
37
+ /** `data-mol-id` automation id (React's `automationId`). */
38
+ automationId?: string;
39
+ /** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
40
+ dataMolId?: string;
41
+ /** A disabled card never calls `onClick` (React's `disabled`). */
42
+ disabled?: boolean;
43
+ /** React's `onClick` prop: the card's click handler (never called while disabled). */
44
+ onClick?: MouseEventHandler;
22
45
  /**
23
46
  * The current class map.
24
47
  * @returns The UIClassMap.
@@ -29,11 +52,24 @@ export declare class Card {
29
52
  * @returns The class string.
30
53
  */
31
54
  classes(): string;
55
+ /**
56
+ * The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
57
+ * @returns The attribute value.
58
+ */
59
+ molId(): string | undefined;
32
60
  /**
33
61
  * Serializes the inline style.
34
62
  * @returns The style attribute text.
35
63
  */
36
64
  hostStyle(): string | null;
65
+ /**
66
+ * Attaches the keyboard activation. A host listener would run before the
67
+ * `(keydown)` a caller binds on the card (Angular registers a component's
68
+ * host listeners first); attached here, after the template's bindings, the
69
+ * caller's handler runs first and its preventDefault() cancels the
70
+ * activation, as React's Card calls `onKeyDown` before activating.
71
+ */
72
+ ngOnInit(): void;
37
73
  /**
38
74
  * An interactive card is announced as a button and sits in the tab order, so
39
75
  * Enter and Space activate it the way they activate a native button: by
@@ -44,13 +80,23 @@ export declare class Card {
44
80
  * @param event - The key event.
45
81
  */
46
82
  handleKeyDown(event: KeyboardEvent): void;
83
+ /**
84
+ * React passes no `onClick` to a disabled card, so the consumer's handler
85
+ * never runs; an enabled card's handler is called with the click event.
86
+ *
87
+ * @param event - The click event.
88
+ */
89
+ handleClick(event: MouseEvent): void;
47
90
  static ɵfac: i0.ɵɵFactoryDeclaration<Card, never>;
48
- static ɵcmp: i0.ɵɵComponentDeclaration<Card, "div[mol-card]", never, { "variant": { "alias": "variant"; "required": false; }; "interactive": { "alias": "interactive"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, ["*"], true, never>;
91
+ static ɵcmp: i0.ɵɵComponentDeclaration<Card, "div[mol-card]", never, { "variant": { "alias": "variant"; "required": false; }; "interactive": { "alias": "interactive"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "automationId": { "alias": "automationId"; "required": false; }; "dataMolId": { "alias": "data-mol-id"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "onClick": { "alias": "onClick"; "required": false; }; }, {}, never, ["*"], true, never>;
49
92
  }
50
93
  /**
51
94
  * Card header.
52
95
  */
53
- export declare class CardHeader {
96
+ export declare class CardHeader implements HasElement<HTMLDivElement> {
97
+ private readonly host;
98
+ /** The element a caller's ref receives: the host `<div>`. */
99
+ readonly element: import("@angular/core").Signal<HTMLDivElement | null>;
54
100
  /** Extra classes. */
55
101
  className?: string;
56
102
  /**
@@ -69,7 +115,10 @@ export declare class CardHeader {
69
115
  /**
70
116
  * Card title (an `h3`).
71
117
  */
72
- export declare class CardTitle {
118
+ export declare class CardTitle implements HasElement<HTMLHeadingElement> {
119
+ private readonly host;
120
+ /** The element a caller's ref receives: the host `<h3>`. */
121
+ readonly element: import("@angular/core").Signal<HTMLHeadingElement | null>;
73
122
  /** Extra classes. */
74
123
  className?: string;
75
124
  /**
@@ -88,7 +137,10 @@ export declare class CardTitle {
88
137
  /**
89
138
  * Card description (a `p`).
90
139
  */
91
- export declare class CardDescription {
140
+ export declare class CardDescription implements HasElement<HTMLParagraphElement> {
141
+ private readonly host;
142
+ /** The element a caller's ref receives: the host `<p>`. */
143
+ readonly element: import("@angular/core").Signal<HTMLParagraphElement | null>;
92
144
  /** Extra classes. */
93
145
  className?: string;
94
146
  /**
@@ -107,7 +159,10 @@ export declare class CardDescription {
107
159
  /**
108
160
  * Card content.
109
161
  */
110
- export declare class CardContent {
162
+ export declare class CardContent implements HasElement<HTMLDivElement> {
163
+ private readonly host;
164
+ /** The element a caller's ref receives: the host `<div>`. */
165
+ readonly element: import("@angular/core").Signal<HTMLDivElement | null>;
111
166
  /** Extra classes. */
112
167
  className?: string;
113
168
  /**
@@ -126,7 +181,10 @@ export declare class CardContent {
126
181
  /**
127
182
  * Card footer.
128
183
  */
129
- export declare class CardFooter {
184
+ export declare class CardFooter implements HasElement<HTMLDivElement> {
185
+ private readonly host;
186
+ /** The element a caller's ref receives: the host `<div>`. */
187
+ readonly element: import("@angular/core").Signal<HTMLDivElement | null>;
130
188
  /** Extra classes. */
131
189
  className?: string;
132
190
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"card.component.d.ts","sourceRoot":"","sources":["../../src/components/card.component.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAYlD;;;;;GAKG;AACH,qBAca,IAAI;IACf,oBAAoB;IACpB,OAAO,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAa;IAC9E,gDAAgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oDAAoD;IACpD,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAO;IAC3C,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,qB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AO,IAAI,MAAM;yCApBN,eAAe;2CAAf,eAAe;CAuB3B;AAED;;GAEG;AACH,qBASa,WAAY,YAAW,UAAU,CAAC,cAAc,CAAC;IAC5D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAiD;IACtE,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,wDAAyB;IAEzC,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;OAGG;IACH,OAAO,IAAI,MAAM;yCApBN,WAAW;2CAAX,WAAW;CAuBvB;AAED;;GAEG;AACH,qBASa,UAAW,YAAW,UAAU,CAAC,cAAc,CAAC;IAC3D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAiD;IACtE,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,wDAAyB;IAEzC,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;OAGG;IACH,OAAO,IAAI,MAAM;yCApBN,UAAU;2CAAV,UAAU;CAuBtB"}
@@ -4,8 +4,9 @@
4
4
  *
5
5
  * @module
6
6
  */
7
- import { Component } from '@angular/core';
7
+ import { Component, DestroyRef, ElementRef, inject, Renderer2 } from '@angular/core';
8
8
  import { getClassMap } from '@molecule/app-ui';
9
+ import { hostElement } from '../utilities/element.js';
9
10
  import { styleText } from '../utilities/style.js';
10
11
  import * as i0 from "@angular/core";
11
12
  const _c0 = ["*"];
@@ -19,9 +20,16 @@ const VARIANT_MAP = {
19
20
  * Card component.
20
21
  *
21
22
  * An interactive card renders `role="button"` and joins the keyboard tab
22
- * order; rest props (`aria-*`, `data-*`, `id`) land on the host.
23
+ * order; rest props (`id`, `title`, `aria-*`, `data-*`) and event bindings
24
+ * (`(focusin)`, `(dblclick)`, `(keydown)`, …) land on the host, and a
25
+ * caller's `(keydown)` runs before the Enter/Space activation.
23
26
  */
24
27
  export class Card {
28
+ host = inject(ElementRef);
29
+ /** The element a caller's ref receives: the host `<div>`. */
30
+ element = hostElement(this.host);
31
+ renderer = inject(Renderer2);
32
+ destroyRef = inject(DestroyRef);
25
33
  /** Card variant. */
26
34
  variant = 'elevated';
27
35
  /** Whether the card is keyboard-interactive. */
@@ -34,6 +42,14 @@ export class Card {
34
42
  style;
35
43
  /** `data-testid`. */
36
44
  testId;
45
+ /** `data-mol-id` automation id (React's `automationId`). */
46
+ automationId;
47
+ /** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
48
+ dataMolId;
49
+ /** A disabled card never calls `onClick` (React's `disabled`). */
50
+ disabled;
51
+ /** React's `onClick` prop: the card's click handler (never called while disabled). */
52
+ onClick;
37
53
  /**
38
54
  * The current class map.
39
55
  * @returns The UIClassMap.
@@ -49,6 +65,16 @@ export class Card {
49
65
  const paddingClass = this.padding === 'none' ? '' : this.cm().cardPadding(this.padding);
50
66
  return this.cm().cn(this.cm().card({ variant: VARIANT_MAP[this.variant] || 'default' }), paddingClass, this.interactive && this.cm().cardInteractive, this.className);
51
67
  }
68
+ /**
69
+ * The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
70
+ * @returns The attribute value.
71
+ */
72
+ molId() {
73
+ return (this.automationId ??
74
+ this.dataMolId ??
75
+ this.host.nativeElement.getAttribute('data-mol-id') ??
76
+ undefined);
77
+ }
52
78
  /**
53
79
  * Serializes the inline style.
54
80
  * @returns The style attribute text.
@@ -56,6 +82,17 @@ export class Card {
56
82
  hostStyle() {
57
83
  return styleText(this.style);
58
84
  }
85
+ /**
86
+ * Attaches the keyboard activation. A host listener would run before the
87
+ * `(keydown)` a caller binds on the card (Angular registers a component's
88
+ * host listeners first); attached here, after the template's bindings, the
89
+ * caller's handler runs first and its preventDefault() cancels the
90
+ * activation, as React's Card calls `onKeyDown` before activating.
91
+ */
92
+ ngOnInit() {
93
+ const unlisten = this.renderer.listen(this.host.nativeElement, 'keydown', (event) => this.handleKeyDown(event));
94
+ this.destroyRef.onDestroy(unlisten);
95
+ }
59
96
  /**
60
97
  * An interactive card is announced as a button and sits in the tab order, so
61
98
  * Enter and Space activate it the way they activate a native button: by
@@ -66,21 +103,38 @@ export class Card {
66
103
  * @param event - The key event.
67
104
  */
68
105
  handleKeyDown(event) {
69
- if (!this.interactive || event.target !== event.currentTarget)
106
+ if (event.defaultPrevented || !this.interactive || this.disabled)
107
+ return;
108
+ // The element the listener is bound to (the host, whether the binding is
109
+ // the component's own or a caller's); `this.host` is the fallback when the
110
+ // handler is invoked outside a dispatch.
111
+ const target = event.currentTarget instanceof HTMLElement ? event.currentTarget : this.host.nativeElement;
112
+ if (event.target !== target)
70
113
  return;
71
114
  if (event.key !== 'Enter' && event.key !== ' ')
72
115
  return;
73
116
  event.preventDefault();
74
- event.currentTarget.click();
117
+ target.click();
118
+ }
119
+ /**
120
+ * React passes no `onClick` to a disabled card, so the consumer's handler
121
+ * never runs; an enabled card's handler is called with the click event.
122
+ *
123
+ * @param event - The click event.
124
+ */
125
+ handleClick(event) {
126
+ if (this.disabled)
127
+ return;
128
+ this.onClick?.(event);
75
129
  }
76
130
  static ɵfac = function Card_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Card)(); };
77
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Card, selectors: [["div", "mol-card", ""]], hostVars: 7, hostBindings: function Card_HostBindings(rf, ctx) { if (rf & 1) {
78
- i0.ɵɵlistener("keydown", function Card_keydown_HostBindingHandler($event) { return ctx.handleKeyDown($event); });
131
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Card, selectors: [["div", "mol-card", ""]], hostVars: 9, hostBindings: function Card_HostBindings(rf, ctx) { if (rf & 1) {
132
+ i0.ɵɵlistener("click", function Card_click_HostBindingHandler($event) { return ctx.handleClick($event); });
79
133
  } if (rf & 2) {
80
- i0.ɵɵattribute("data-testid", ctx.testId)("role", ctx.interactive ? "button" : null)("tabindex", ctx.interactive ? 0 : null);
134
+ i0.ɵɵattribute("data-testid", ctx.testId)("data-mol-id", ctx.molId())("role", ctx.interactive ? "button" : null)("tabindex", ctx.interactive ? ctx.disabled ? -1 : 0 : null)("aria-disabled", ctx.interactive && ctx.disabled ? "true" : null);
81
135
  i0.ɵɵstyleMap(ctx.hostStyle());
82
136
  i0.ɵɵclassMap(ctx.classes());
83
- } }, inputs: { variant: "variant", interactive: "interactive", padding: "padding", className: "className", style: "style", testId: "testId" }, ngContentSelectors: _c0, decls: 1, vars: 0, template: function Card_Template(rf, ctx) { if (rf & 1) {
137
+ } }, inputs: { variant: "variant", interactive: "interactive", padding: "padding", className: "className", style: "style", testId: "testId", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"], disabled: "disabled", onClick: "onClick" }, ngContentSelectors: _c0, decls: 1, vars: 0, template: function Card_Template(rf, ctx) { if (rf & 1) {
84
138
  i0.ɵɵprojectionDef();
85
139
  i0.ɵɵprojection(0);
86
140
  } }, encapsulation: 2 });
@@ -90,23 +144,39 @@ export class Card {
90
144
  args: [{
91
145
  selector: 'div[mol-card]',
92
146
  standalone: true,
93
- inputs: ['variant', 'interactive', 'padding', 'className', 'style', 'testId'],
147
+ inputs: [
148
+ 'variant',
149
+ 'interactive',
150
+ 'padding',
151
+ 'className',
152
+ 'style',
153
+ 'testId',
154
+ 'automationId',
155
+ 'dataMolId: data-mol-id',
156
+ 'disabled',
157
+ 'onClick',
158
+ ],
94
159
  host: {
95
160
  '[class]': 'classes()',
96
161
  '[style]': 'hostStyle()',
97
162
  '[attr.data-testid]': 'testId',
163
+ '[attr.data-mol-id]': 'molId()',
98
164
  '[attr.role]': 'interactive ? "button" : null',
99
- '[attr.tabindex]': 'interactive ? 0 : null',
100
- '(keydown)': 'handleKeyDown($event)',
165
+ '[attr.tabindex]': 'interactive ? (disabled ? -1 : 0) : null',
166
+ '[attr.aria-disabled]': 'interactive && disabled ? "true" : null',
167
+ '(click)': 'handleClick($event)',
101
168
  },
102
169
  template: `<ng-content></ng-content>`,
103
170
  }]
104
171
  }], null, null); })();
105
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Card, { className: "Card", filePath: "components/card.component.ts", lineNumber: 42 }); })();
172
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Card, { className: "Card", filePath: "components/card.component.ts", lineNumber: 58 }); })();
106
173
  /**
107
174
  * Card header.
108
175
  */
109
176
  export class CardHeader {
177
+ host = inject(ElementRef);
178
+ /** The element a caller's ref receives: the host `<div>`. */
179
+ element = hostElement(this.host);
110
180
  /** Extra classes. */
111
181
  className;
112
182
  /**
@@ -143,11 +213,14 @@ export class CardHeader {
143
213
  template: `<ng-content></ng-content>`,
144
214
  }]
145
215
  }], null, null); })();
146
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CardHeader, { className: "CardHeader", filePath: "components/card.component.ts", lineNumber: 115 }); })();
216
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CardHeader, { className: "CardHeader", filePath: "components/card.component.ts", lineNumber: 191 }); })();
147
217
  /**
148
218
  * Card title (an `h3`).
149
219
  */
150
220
  export class CardTitle {
221
+ host = inject(ElementRef);
222
+ /** The element a caller's ref receives: the host `<h3>`. */
223
+ element = hostElement(this.host);
151
224
  /** Extra classes. */
152
225
  className;
153
226
  /**
@@ -184,11 +257,14 @@ export class CardTitle {
184
257
  template: `<ng-content></ng-content>`,
185
258
  }]
186
259
  }], null, null); })();
187
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CardTitle, { className: "CardTitle", filePath: "components/card.component.ts", lineNumber: 148 }); })();
260
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CardTitle, { className: "CardTitle", filePath: "components/card.component.ts", lineNumber: 228 }); })();
188
261
  /**
189
262
  * Card description (a `p`).
190
263
  */
191
264
  export class CardDescription {
265
+ host = inject(ElementRef);
266
+ /** The element a caller's ref receives: the host `<p>`. */
267
+ element = hostElement(this.host);
192
268
  /** Extra classes. */
193
269
  className;
194
270
  /**
@@ -225,11 +301,14 @@ export class CardDescription {
225
301
  template: `<ng-content></ng-content>`,
226
302
  }]
227
303
  }], null, null); })();
228
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CardDescription, { className: "CardDescription", filePath: "components/card.component.ts", lineNumber: 181 }); })();
304
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CardDescription, { className: "CardDescription", filePath: "components/card.component.ts", lineNumber: 265 }); })();
229
305
  /**
230
306
  * Card content.
231
307
  */
232
308
  export class CardContent {
309
+ host = inject(ElementRef);
310
+ /** The element a caller's ref receives: the host `<div>`. */
311
+ element = hostElement(this.host);
233
312
  /** Extra classes. */
234
313
  className;
235
314
  /**
@@ -266,11 +345,14 @@ export class CardContent {
266
345
  template: `<ng-content></ng-content>`,
267
346
  }]
268
347
  }], null, null); })();
269
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CardContent, { className: "CardContent", filePath: "components/card.component.ts", lineNumber: 214 }); })();
348
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CardContent, { className: "CardContent", filePath: "components/card.component.ts", lineNumber: 302 }); })();
270
349
  /**
271
350
  * Card footer.
272
351
  */
273
352
  export class CardFooter {
353
+ host = inject(ElementRef);
354
+ /** The element a caller's ref receives: the host `<div>`. */
355
+ element = hostElement(this.host);
274
356
  /** Extra classes. */
275
357
  className;
276
358
  /**
@@ -307,5 +389,5 @@ export class CardFooter {
307
389
  template: `<ng-content></ng-content>`,
308
390
  }]
309
391
  }], null, null); })();
310
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CardFooter, { className: "CardFooter", filePath: "components/card.component.ts", lineNumber: 247 }); })();
392
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CardFooter, { className: "CardFooter", filePath: "components/card.component.ts", lineNumber: 339 }); })();
311
393
  //# sourceMappingURL=card.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.component.js","sourceRoot":"","sources":["../../src/components/card.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;;;AAEjD,sDAAsD;AACtD,MAAM,WAAW,GAAiE;IAChF,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,SAAS;CAClB,CAAA;AAED;;;;;GAKG;AAeH,MAAM,OAAO,IAAI;IACf,oBAAoB;IACpB,OAAO,GAA6D,UAAU,CAAA;IAC9E,gDAAgD;IAChD,WAAW,CAAU;IACrB,oDAAoD;IACpD,OAAO,GAAgC,IAAI,CAAA;IAC3C,qBAAqB;IACrB,SAAS,CAAS;IAClB,6CAA6C;IAC7C,KAAK,CAA0B;IAC/B,qBAAqB;IACrB,MAAM,CAAS;IAEf;;;OAGG;IACH,EAAE;QACA,OAAO,WAAW,EAAE,CAAA;IACtB,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACvF,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CACjB,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE,CAAC,EACnE,YAAY,EACZ,IAAI,CAAC,W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V,UAAU;YAAV,cAAA,aAAS,CAAC;;;YAFV,kBAAyB;;;iFAEzB,UAAU;cATtB,SAAS;eAAC;gBACT,QAAQ,EAAE,sBAAsB;gBAChC,UAAU,EAAE,IAAI;gBAChB,MAAM,EAAE,CAAC,WAAW,CAAC;gBACrB,IAAI,EAAE;oBACJ,SAAS,EAAE,WAAW;iBACvB;gBACD,QAAQ,EAAE,2BAA2B;aACtC;;kFACY,UAAU"}
@@ -4,7 +4,8 @@
4
4
  * @module
5
5
  */
6
6
  import { type AfterViewChecked, ElementRef, EventEmitter } from '@angular/core';
7
- import type { UIClassMap } from '@molecule/app-ui';
7
+ import type { FocusEventHandler, KeyboardEventHandler, MouseEventHandler, UIClassMap } from '@molecule/app-ui';
8
+ import type { HasElement } from '../utilities/element.js';
8
9
  import type { FormFieldContext } from '../utilities/form-field-context.js';
9
10
  import * as i0 from "@angular/core";
10
11
  /**
@@ -15,7 +16,7 @@ import * as i0 from "@angular/core";
15
16
  * the input is React's `...rest` spread target, so rest attributes move
16
17
  * there at view init.
17
18
  */
18
- export declare class Checkbox implements AfterViewChecked {
19
+ export declare class Checkbox implements AfterViewChecked, HasElement<HTMLInputElement> {
19
20
  /** Checkbox label (text, or projected `[slot=label]` nodes). */
20
21
  label?: unknown;
21
22
  /** Whether the checkbox is checked. */
@@ -40,17 +41,41 @@ export declare class Checkbox implements AfterViewChecked {
40
41
  id?: string;
41
42
  /** Uncontrolled initial checked state (renders as the checked attribute). */
42
43
  defaultChecked?: boolean;
44
+ /** `data-mol-id` automation id (React's `automationId`). */
45
+ automationId?: string;
46
+ /** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
47
+ dataMolId?: string;
48
+ /**
49
+ * A caller's click handler (React's `onClick`, which React spreads onto the input). Runs
50
+ * before `change`; its `preventDefault()` makes the browser restore the box.
51
+ */
52
+ onClick?: MouseEventHandler;
53
+ /** React's `onFocus`, which React spreads onto the <input>: its `currentTarget` is that element. */
54
+ onFocus?: FocusEventHandler;
55
+ /** React's `onBlur`, which React spreads onto the <input>: its `currentTarget` is that element. */
56
+ onBlur?: FocusEventHandler;
57
+ /** React's `onKeyDown`, which React spreads onto the <input>: its `currentTarget` is that element. */
58
+ onKeyDown?: KeyboardEventHandler;
43
59
  /** The genuine native `change` event. */
44
60
  readonly change: EventEmitter<Event>;
45
61
  /** The native input (React's `...rest` spread target). */
46
- input?: ElementRef<HTMLInputElement>;
62
+ private input?;
63
+ /** The native input view query; also feeds the caller's ref element. */
64
+ set inputQuery(ref: ElementRef<HTMLInputElement> | undefined);
65
+ private readonly inner;
66
+ /** The element a caller's ref receives: the native `<input>`. */
67
+ readonly element: import("@angular/core").Signal<HTMLInputElement | null>;
47
68
  /** The label text wrapper. */
48
69
  labelSlot?: ElementRef<HTMLSpanElement>;
49
70
  private readonly host;
71
+ /** The per-instance id used when the caller gives no `id` or `name` (React's `useId`). */
72
+ private readonly generatedId;
50
73
  /** The `aria-describedby` the caller spread onto the host (React's rest). */
51
74
  private restDescribedBy;
52
75
  /** Whether the rest-describedby value was captured. */
53
76
  private restDescribedByCaptured;
77
+ /** The `data-mol-id` a caller bound on the host (React spreads it onto the input). */
78
+ private externalMolId;
54
79
  private readonly sync;
55
80
  private hasLabel;
56
81
  private syncIndeterminate;
@@ -91,6 +116,11 @@ export declare class Checkbox implements AfterViewChecked {
91
116
  * @returns The style attribute text.
92
117
  */
93
118
  hostStyle(): string | null;
119
+ /**
120
+ * The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
121
+ * @returns The attribute value.
122
+ */
123
+ molId(): string | undefined;
94
124
  /**
95
125
  * React's checkbox `onChange` fires on the checkbox's CLICK event (React's
96
126
  * change-event plugin maps checkbox/radio changes to the click), so the
@@ -98,7 +128,7 @@ export declare class Checkbox implements AfterViewChecked {
98
128
  *
99
129
  * @param event - The native click event.
100
130
  */
101
- handleClick(event: Event): void;
131
+ handleClick(event: MouseEvent): void;
102
132
  /**
103
133
  * A native change that did not come from this tick's click (a synthetic
104
134
  * `dispatchEvent`) is forwarded like React would; the event never reaches
@@ -116,6 +146,6 @@ export declare class Checkbox implements AfterViewChecked {
116
146
  */
117
147
  ngAfterViewChecked(): void;
118
148
  static ɵfac: i0.ɵɵFactoryDeclaration<Checkbox, never>;
119
- static ɵcmp: i0.ɵɵComponentDeclaration<Checkbox, "div[mol-checkbox]", never, { "label": { "alias": "label"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; "size": { "alias": "size"; "required": false; }; "error": { "alias": "error"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "defaultChecked": { "alias": "defaultChecked"; "required": false; }; }, { "change": "change"; }, never, ["[slot=label]"], true, never>;
149
+ static ɵcmp: i0.ɵɵComponentDeclaration<Checkbox, "div[mol-checkbox]", never, { "label": { "alias": "label"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; "size": { "alias": "size"; "required": false; }; "error": { "alias": "error"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "defaultChecked": { "alias": "defaultChecked"; "required": false; }; "automationId": { "alias": "automationId"; "required": false; }; "dataMolId": { "alias": "data-mol-id"; "required": false; }; "onClick": { "alias": "onClick"; "required": false; }; "onFocus": { "alias": "onFocus"; "required": false; }; "onBlur": { "alias": "onBlur"; "required": false; }; "onKeyDown": { "alias": "onKeyDown"; "required": false; }; }, { "change": "change"; }, never, ["[slot=label]"], true, never>;
120
150
  }
121
151
  //# sourceMappingURL=checkbox.component.d.ts.map