@nanahoshi/mona-ui 0.24.1 → 0.24.4

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 (52) hide show
  1. package/README.md +3 -0
  2. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1 -1
  3. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +1 -1
  4. package/fesm2022/nanahoshi-mona-ui-button.mjs +122 -60
  5. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +1 -2
  6. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +1 -1
  7. package/fesm2022/nanahoshi-mona-ui-chip.mjs +1 -1
  8. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1 -1
  9. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +2 -2
  10. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +4 -2
  11. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +1 -1
  12. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +8 -4
  13. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +8 -4
  14. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1 -1
  15. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1 -1
  16. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +4 -2
  17. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +13 -3
  18. package/fesm2022/nanahoshi-mona-ui-editor.mjs +13 -13
  19. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -1
  20. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-CnPhVIr4.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DLOPRuFv.mjs} +2 -2
  21. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-DxY6bfTX.mjs → nanahoshi-mona-ui-grid-grid-list.component-Dw5U9H0a.mjs} +4 -4
  22. package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-CaO5Lae6.mjs → nanahoshi-mona-ui-grid-grid-row.component-D1kyAzD8.mjs} +4 -4
  23. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-jNYtqg5B.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-ECK1_smx.mjs} +4 -4
  24. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-9FtfCutf.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-D4lUDbfx.mjs} +14 -18
  25. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  26. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +2 -2
  27. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +1 -1
  28. package/fesm2022/nanahoshi-mona-ui-internal.mjs +15 -1
  29. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1 -1
  30. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +3 -3
  31. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1 -1
  32. package/fesm2022/nanahoshi-mona-ui-notification.mjs +1 -1
  33. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +3 -3
  34. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1 -1
  35. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1 -1
  36. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2 -2
  37. package/fesm2022/nanahoshi-mona-ui-popup.mjs +269 -182
  38. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +1 -1
  39. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1 -1
  40. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1 -1
  41. package/fesm2022/nanahoshi-mona-ui-switch.mjs +1 -1
  42. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1 -1
  43. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +95 -58
  44. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +7 -5
  45. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +2 -2
  46. package/fesm2022/nanahoshi-mona-ui-window.mjs +1 -1
  47. package/package.json +1 -1
  48. package/types/nanahoshi-mona-ui-button.d.ts +44 -20
  49. package/types/nanahoshi-mona-ui-dropdowns.d.ts +6 -0
  50. package/types/nanahoshi-mona-ui-internal.d.ts +9 -1
  51. package/types/nanahoshi-mona-ui-popup.d.ts +97 -36
  52. package/types/nanahoshi-mona-ui-text-box.d.ts +62 -14
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { ComponentRef, TemplateRef, StaticProvider, OnDestroy, AfterViewInit, InjectionToken } from '@angular/core';
2
+ import { ComponentRef, TemplateRef, Injector, StaticProvider, OnDestroy, InjectionToken } from '@angular/core';
3
3
  import { OverlayRef, ConnectionPositionPair, FlexibleConnectedPositionStrategyOrigin, ComponentType, ConnectedPosition } from '@angular/cdk/overlay';
4
4
  import { Action } from '@nanahoshi/mona-ui/internal';
5
5
  import { PreventableEvent } from '@nanahoshi/mona-ui/common';
@@ -34,8 +34,8 @@ interface PopupOffset {
34
34
  }
35
35
 
36
36
  interface PopupRefParams {
37
- close: <R>(result?: R, delay?: number) => void;
38
37
  get beforeClose$(): Observable<PopupCloseEvent>;
38
+ close: <R>(result?: R, delay?: number) => boolean;
39
39
  get closeStart$(): Observable<PopupCloseEvent>;
40
40
  get closed$(): Observable<PopupCloseEvent>;
41
41
  get component(): ComponentRef<unknown> | null;
@@ -47,7 +47,14 @@ interface PopupRefParams {
47
47
  declare class PopupRef {
48
48
  #private;
49
49
  constructor(options: PopupRefParams);
50
- close<R>(result?: R, delay?: number): void;
50
+ /**
51
+ * Requests the popup to close.
52
+ * @param result optional result passed to `beforeClose` and `closed` as the event's `result`
53
+ * @param delay optional delay in milliseconds before the popup is removed, instead of waiting for the
54
+ * leave animation
55
+ * @returns `false` when the close was prevented or the popup is already closing, `true` otherwise.
56
+ */
57
+ close<R>(result?: R, delay?: number): boolean;
51
58
  /**
52
59
  * Closes the popup after a delay.
53
60
  * When the popup is closed, the overlay element is removed from the DOM instantly.
@@ -140,19 +147,17 @@ interface PopupSettings<T = unknown, C = void> {
140
147
  * @type {boolean}
141
148
  */
142
149
  blockScroll?: boolean;
143
- /**
144
- * The content to display in the popup.
145
- * @type {TemplateRef | ComponentType}
146
- */
147
- content: TemplateRef<C> | ComponentType<C>;
148
150
  /**
149
151
  * Whether the popup will be closed when the user clicks on the backdrop.
150
152
  * Only applies if `hasBackdrop` is true.
153
+ * Default: true.
151
154
  * @type {boolean}
152
155
  */
153
156
  closeOnBackdropClick?: boolean;
154
157
  /**
155
158
  * Whether the popup will be closed when the user presses the escape key.
159
+ * Escape only reaches the topmost open popup. When that popup sets this to `false`, Escape closes nothing,
160
+ * not even the popups underneath it.
156
161
  * Default: true.
157
162
  * @type {boolean}
158
163
  */
@@ -165,22 +170,29 @@ interface PopupSettings<T = unknown, C = void> {
165
170
  closeOnMouseLeave?: boolean;
166
171
  /**
167
172
  * Whether the popup will be closed when the user clicks outside of it.
173
+ * Clicks on the backdrop are governed by `closeOnBackdropClick` instead.
174
+ * Default: true.
168
175
  * @type {boolean}
169
176
  */
170
177
  closeOnOutsideClick?: boolean;
171
178
  /**
172
- * Whether the popup will be closed when the user scrolls.
179
+ * Whether the popup will be closed when the user scrolls the page or a scrollable container around the anchor.
173
180
  * Default: false.
174
181
  * @type {boolean}
175
182
  */
176
183
  closeOnScroll?: boolean;
184
+ /**
185
+ * The content to display in the popup.
186
+ * @type {TemplateRef | ComponentType}
187
+ */
188
+ content: TemplateRef<C> | ComponentType<C>;
177
189
  /**
178
190
  * Optional data to pass to the popup context.
179
191
  */
180
192
  data?: T;
181
193
  /**
182
194
  * Whether the popup will have a backdrop.
183
- * Default: true.
195
+ * Default: false.
184
196
  */
185
197
  hasBackdrop?: boolean;
186
198
  /**
@@ -188,6 +200,14 @@ interface PopupSettings<T = unknown, C = void> {
188
200
  * @type {number | string}
189
201
  */
190
202
  height?: number | string;
203
+ /**
204
+ * Parent injector for the popup content. Component content resolves its dependencies here, after
205
+ * `providers`. Pass the injector of the component that opens the popup so its content can use services
206
+ * provided by that component, its ancestors or a lazy-loaded route.
207
+ * Default: the root injector.
208
+ * @type {Injector}
209
+ */
210
+ injector?: Injector;
191
211
  /**
192
212
  * Maximum height of the popup.
193
213
  * @type {number | string}
@@ -256,7 +276,10 @@ interface PopupSettings<T = unknown, C = void> {
256
276
  * Controls focus restoration behavior when the popup is closed.
257
277
  * - true: Always restore focus to anchor
258
278
  * - false: Never restore focus (recommended for tooltips)
259
- * - "auto": Only restore focus if the anchor was focused when the popup opened (smart behavior)
279
+ * - "auto": Only restore focus if the anchor, or an element inside it, was focused when the popup opened;
280
+ * focus returns to that element
281
+ * Focus is only restored while it is on the page itself, inside the popup or inside the anchor. If the user
282
+ * moved it elsewhere, for example by clicking another field, it stays there.
260
283
  * Default: "auto".
261
284
  * @type {boolean | "auto"}
262
285
  */
@@ -275,6 +298,7 @@ interface PopupSettings<T = unknown, C = void> {
275
298
  withPush?: boolean;
276
299
  /**
277
300
  * Whether the popup should track scroll events and reposition itself.
301
+ * Default: true.
278
302
  * @type {boolean}
279
303
  */
280
304
  withScrollTracking?: boolean;
@@ -290,7 +314,7 @@ interface PopupAnimationSettings {
290
314
  leave?: string | string[];
291
315
  }
292
316
 
293
- declare class PopupComponent<T = unknown> implements OnDestroy, AfterViewInit {
317
+ declare class PopupComponent<T = unknown> implements OnDestroy {
294
318
  #private;
295
319
  protected readonly contentTemplate: _angular_core.Signal<TemplateRef<any>>;
296
320
  protected popupRef: PopupRef | null;
@@ -318,19 +342,24 @@ declare class PopupComponent<T = unknown> implements OnDestroy, AfterViewInit {
318
342
  * @description Whether to close the popup when clicking on the backdrop.
319
343
  * Only applies when the popup has a backdrop.
320
344
  */
321
- readonly closeOnBackdropClick: _angular_core.InputSignal<boolean>;
345
+ readonly closeOnBackdropClick: _angular_core.InputSignalWithTransform<boolean, unknown>;
322
346
  /**
323
347
  * @description Whether to close the popup when the escape key is pressed.
348
+ * Escape only reaches the topmost open popup.
324
349
  */
325
- readonly closeOnEscape: _angular_core.InputSignal<boolean>;
350
+ readonly closeOnEscape: _angular_core.InputSignalWithTransform<boolean, unknown>;
326
351
  /**
327
352
  * @description Whether to close the popup when the mouse leaves the anchor element.
328
353
  */
329
- readonly closeOnMouseLeave: _angular_core.InputSignal<boolean>;
354
+ readonly closeOnMouseLeave: _angular_core.InputSignalWithTransform<boolean, unknown>;
330
355
  /**
331
356
  * @description Whether to close the popup when clicking outside of it.
332
357
  */
333
- readonly closeOnOutsideClick: _angular_core.InputSignal<boolean>;
358
+ readonly closeOnOutsideClick: _angular_core.InputSignalWithTransform<boolean, unknown>;
359
+ /**
360
+ * @description Whether to close the popup when the user scrolls the page or a scrollable container around the anchor.
361
+ */
362
+ readonly closeOnScroll: _angular_core.InputSignalWithTransform<boolean, unknown>;
334
363
  /**
335
364
  * @description Arbitrary data to pass to the popup.
336
365
  */
@@ -338,7 +367,7 @@ declare class PopupComponent<T = unknown> implements OnDestroy, AfterViewInit {
338
367
  /**
339
368
  * @description Whether the popup should have a backdrop.
340
369
  */
341
- readonly hasBackdrop: _angular_core.InputSignal<boolean>;
370
+ readonly hasBackdrop: _angular_core.InputSignalWithTransform<boolean, unknown>;
342
371
  /**
343
372
  * @description The height of the popup.
344
373
  */
@@ -400,6 +429,15 @@ declare class PopupComponent<T = unknown> implements OnDestroy, AfterViewInit {
400
429
  * @description The providers that will be injected into the popup.
401
430
  */
402
431
  readonly providers: _angular_core.InputSignal<StaticProvider[]>;
432
+ /**
433
+ * @description Controls focus restoration when the popup closes.
434
+ * - `true`: always restore focus to the anchor element.
435
+ * - `false`: never restore focus (recommended for tooltips).
436
+ * - `"auto"`: restore focus only if the anchor, or an element inside it, was focused when the popup opened.
437
+ *
438
+ * Focus is left alone if the user moved it outside the popup and the anchor before it closed.
439
+ */
440
+ readonly restoreFocus: _angular_core.InputSignalWithTransform<boolean | "auto", unknown>;
403
441
  /**
404
442
  * @description The trigger event for opening the popup.
405
443
  */
@@ -411,30 +449,18 @@ declare class PopupComponent<T = unknown> implements OnDestroy, AfterViewInit {
411
449
  /**
412
450
  * @description Whether to push the popup into the screen when it is opened.
413
451
  */
414
- readonly withPush: _angular_core.InputSignal<boolean>;
415
- /**
416
- * @description Whether to close the popup when the user scrolls within a scrollable container.
417
- */
418
- readonly closeOnScroll: _angular_core.InputSignal<boolean>;
419
- /**
420
- * @description Controls focus restoration when the popup closes.
421
- * - `true`: always restore focus to the anchor element.
422
- * - `false`: never restore focus (recommended for tooltips).
423
- * - `"auto"`: restore focus only if the anchor was focused when the popup opened.
424
- */
425
- readonly restoreFocus: _angular_core.InputSignal<boolean | "auto">;
452
+ readonly withPush: _angular_core.InputSignalWithTransform<boolean, unknown>;
426
453
  /**
427
454
  * @description Whether the popup should track scroll events and reposition itself.
428
455
  */
429
- readonly withScrollTracking: _angular_core.InputSignal<boolean>;
456
+ readonly withScrollTracking: _angular_core.InputSignalWithTransform<boolean, unknown>;
430
457
  constructor();
431
458
  closePopup(): void;
432
- ngAfterViewInit(): void;
433
459
  ngOnDestroy(): void;
434
460
  private getPopupWidth;
435
461
  private setupEventListeners;
436
462
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PopupComponent<any>, never>;
437
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<PopupComponent<any>, "mona-popup", never, { "anchor": { "alias": "anchor"; "required": true; "isSignal": true; }; "anchorConnectionPoint": { "alias": "anchorConnectionPoint"; "required": false; "isSignal": true; }; "animation": { "alias": "animation"; "required": false; "isSignal": true; }; "backdropClass": { "alias": "backdropClass"; "required": false; "isSignal": true; }; "closeOnBackdropClick": { "alias": "closeOnBackdropClick"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "closeOnMouseLeave": { "alias": "closeOnMouseLeave"; "required": false; "isSignal": true; }; "closeOnOutsideClick": { "alias": "closeOnOutsideClick"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "hasBackdrop": { "alias": "hasBackdrop"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "popupClass": { "alias": "popupClass"; "required": false; "isSignal": true; }; "popupConnectionPoint": { "alias": "popupConnectionPoint"; "required": false; "isSignal": true; }; "popupWrapperClass": { "alias": "popupWrapperClass"; "required": false; "isSignal": true; }; "positionStrategy": { "alias": "positionStrategy"; "required": false; "isSignal": true; }; "positions": { "alias": "positions"; "required": false; "isSignal": true; }; "preventClose": { "alias": "preventClose"; "required": false; "isSignal": true; }; "providers": { "alias": "providers"; "required": false; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "withPush": { "alias": "withPush"; "required": false; "isSignal": true; }; "closeOnScroll": { "alias": "closeOnScroll"; "required": false; "isSignal": true; }; "restoreFocus": { "alias": "restoreFocus"; "required": false; "isSignal": true; }; "withScrollTracking": { "alias": "withScrollTracking"; "required": false; "isSignal": true; }; }, { "close": "close"; "open": "open"; }, never, ["*"], true, never>;
463
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PopupComponent<any>, "mona-popup", never, { "anchor": { "alias": "anchor"; "required": true; "isSignal": true; }; "anchorConnectionPoint": { "alias": "anchorConnectionPoint"; "required": false; "isSignal": true; }; "animation": { "alias": "animation"; "required": false; "isSignal": true; }; "backdropClass": { "alias": "backdropClass"; "required": false; "isSignal": true; }; "closeOnBackdropClick": { "alias": "closeOnBackdropClick"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "closeOnMouseLeave": { "alias": "closeOnMouseLeave"; "required": false; "isSignal": true; }; "closeOnOutsideClick": { "alias": "closeOnOutsideClick"; "required": false; "isSignal": true; }; "closeOnScroll": { "alias": "closeOnScroll"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "hasBackdrop": { "alias": "hasBackdrop"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "popupClass": { "alias": "popupClass"; "required": false; "isSignal": true; }; "popupConnectionPoint": { "alias": "popupConnectionPoint"; "required": false; "isSignal": true; }; "popupWrapperClass": { "alias": "popupWrapperClass"; "required": false; "isSignal": true; }; "positionStrategy": { "alias": "positionStrategy"; "required": false; "isSignal": true; }; "positions": { "alias": "positions"; "required": false; "isSignal": true; }; "preventClose": { "alias": "preventClose"; "required": false; "isSignal": true; }; "providers": { "alias": "providers"; "required": false; "isSignal": true; }; "restoreFocus": { "alias": "restoreFocus"; "required": false; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "withPush": { "alias": "withPush"; "required": false; "isSignal": true; }; "withScrollTracking": { "alias": "withScrollTracking"; "required": false; "isSignal": true; }; }, { "close": "close"; "open": "open"; }, never, ["*"], true, never>;
438
464
  }
439
465
 
440
466
  declare class PopupService {
@@ -442,8 +468,11 @@ declare class PopupService {
442
468
  create(settings: PopupSettings): PopupRef;
443
469
  private attachContent;
444
470
  private buildPanelClass;
471
+ /**
472
+ * With `"auto"` (also the default), remembers the focused element when it is the anchor or inside it, such
473
+ * as the button inside a host component or the input inside a date picker, and returns focus to that element.
474
+ */
445
475
  private captureOriginalFocus;
446
- private cleanupEventDelegation;
447
476
  private createInjector;
448
477
  private createMultiElementPopup;
449
478
  private createOverlay;
@@ -454,9 +483,28 @@ declare class PopupService {
454
483
  private getPosition;
455
484
  private getScrollableAncestorElements;
456
485
  private getScrollableContainers;
486
+ private getTopmostOpenPopup;
487
+ /**
488
+ * Escape goes to the topmost open popup only, so closing a dropdown inside a dialog leaves the dialog
489
+ * open. The topmost popup consumes the key even when it doesn't close on Escape, so a modal that can't
490
+ * be dismissed doesn't let it reach the popup underneath. An Escape that ends an IME composition is left
491
+ * alone. `preventDefault()` doesn't keep the popup open, because controls call it on every navigation key;
492
+ * a control that handles Escape itself stops its propagation instead.
493
+ */
494
+ private handleEscapeKey;
457
495
  private handleFocusRestoration;
458
496
  private isScrollableElement;
459
497
  private isScrollableOverflow;
498
+ /**
499
+ * One pair of `document` listeners serves every open popup. The capturing one notes which popup is on
500
+ * top before the key reaches any control; the bubbling one closes it if nothing handled the key.
501
+ */
502
+ private listenForEscape;
503
+ /**
504
+ * A popup leaves the stack as soon as it starts closing, so a second Escape during its leave animation
505
+ * goes to the popup underneath.
506
+ */
507
+ private registerOpenPopup;
460
508
  /**
461
509
  * Resolves a PopupAnchor to a FlexibleConnectedPositionStrategyOrigin.
462
510
  * This method should only receive actual elements or ElementRefs, not CSS selector strings.
@@ -465,7 +513,6 @@ declare class PopupService {
465
513
  * @returns The resolved anchor
466
514
  */
467
515
  private resolveAnchor;
468
- private restoreFocusToAnchor;
469
516
  private setupBackdropCloseSubscription;
470
517
  /**
471
518
  * Starts the backdrop fade-out as soon as the close begins, so it runs alongside the popup's leave
@@ -474,15 +521,26 @@ declare class PopupService {
474
521
  private setupBackdropFadeOut;
475
522
  private setupCleanupSubscription;
476
523
  private setupCloseSubscriptions;
477
- private setupEscapeKeyListener;
524
+ /**
525
+ * `PopupRef.overlayRef` is public, so the overlay can be detached or disposed without going through
526
+ * `close()`. Finish the close then too, or `closed` never fires and focus, subscriptions and consumers
527
+ * waiting for it (the dropdowns won't reopen until it does) stay stuck.
528
+ */
529
+ private setupDetachTracking;
530
+ private setupDirectionTracking;
531
+ /**
532
+ * Listens on the document rather than on the elements matched at creation time, so elements added later
533
+ * get a popup too. One popup shows at a time; it closes when the pointer leaves its element, and the
534
+ * returned subscription's teardown closes it as well.
535
+ */
478
536
  private setupInternalEventDelegation;
479
537
  private setupMouseLeaveSubscription;
480
538
  private setupOutsideClickSubscription;
481
539
  private setupPositionChangeTracking;
482
- private setupDirectionTracking;
483
540
  private setupScrollClosing;
484
541
  private setupScrollTracking;
485
542
  private shouldIgnoreOutsideClick;
543
+ private unregisterOpenPopup;
486
544
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PopupService, never>;
487
545
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<PopupService>;
488
546
  }
@@ -495,6 +553,9 @@ declare const slideFromLeftPopupAnimation: Required<PopupAnimationSettings>;
495
553
  declare const slideFromTopPopupAnimation: Required<PopupAnimationSettings>;
496
554
  declare const slideFromBottomPopupAnimation: Required<PopupAnimationSettings>;
497
555
 
556
+ /**
557
+ * The `data` passed in `PopupSettings`, available to the popup content.
558
+ */
498
559
  declare const PopupDataInjectionToken: InjectionToken<unknown>;
499
560
 
500
561
  export { PopupCloseEvent, PopupCloseSource, PopupComponent, PopupDataInjectionToken, PopupRef, PopupService, defaultPopupAnimation, dropdownPopupAnimation, fadePopupAnimation, slideFromBottomPopupAnimation, slideFromLeftPopupAnimation, slideFromRightPopupAnimation, slideFromTopPopupAnimation };
@@ -6,7 +6,7 @@ import { VariantInputs, AttributeConfig } from '@nanahoshi/mona-ui/internal';
6
6
  import * as class_variance_authority_types from 'class-variance-authority/types';
7
7
  import { VariantProps } from 'class-variance-authority';
8
8
 
9
- type InputType = "email" | "password" | "text";
9
+ type InputType = "email" | "password" | "search" | "tel" | "text" | "url";
10
10
 
11
11
  declare const textBoxThemeVariants: (props?: ({
12
12
  rounded?: "full" | "large" | "medium" | "none" | "small" | null | undefined;
@@ -28,24 +28,43 @@ declare class TextBoxComponent implements TextBoxVariantInput, FormValueControl<
28
28
  protected readonly invalidInput: _angular_core.Signal<boolean>;
29
29
  protected readonly messages: _angular_core.Signal<_nanahoshi_mona_ui_i18n.MonaTextBoxMessages>;
30
30
  protected readonly prefixTemplateList: _angular_core.Signal<readonly TemplateRef<any>[]>;
31
+ protected readonly showClearButton: _angular_core.Signal<boolean>;
31
32
  protected readonly suffixTemplateList: _angular_core.Signal<readonly TemplateRef<any>[]>;
33
+ /**
34
+ * @description Id of an element that describes the inner input, such as a hint or an error message.
35
+ * @default ""
36
+ */
37
+ readonly ariaDescribedBy: _angular_core.InputSignal<string>;
38
+ /**
39
+ * @description Accessible name of the inner input. Prefer a visible label, linked through {@link inputId} or
40
+ * {@link ariaLabelledBy}; the placeholder is not a label.
41
+ * @default ""
42
+ */
43
+ readonly ariaLabel: _angular_core.InputSignal<string>;
44
+ /**
45
+ * @description Id of the element that labels the inner input.
46
+ * @default ""
47
+ */
48
+ readonly ariaLabelledBy: _angular_core.InputSignal<string>;
32
49
  /**
33
50
  * @description Displays a clear button that resets the value to empty.
51
+ * The button is hidden while the value is empty or the text box is disabled or read-only.
34
52
  * @default false
35
53
  */
36
- readonly clearButton: _angular_core.InputSignal<boolean>;
54
+ readonly clearButton: _angular_core.InputSignalWithTransform<boolean, unknown>;
37
55
  /**
38
56
  * @description Renders the component with reduced visual emphasis and removes pointer interaction.
39
57
  * @default false
40
58
  */
41
- readonly disabled: _angular_core.InputSignal<boolean>;
59
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
42
60
  /**
43
61
  * @description Additional HTML attributes applied directly to the inner `<input>` element.
44
62
  * @default {}
45
63
  */
46
64
  readonly inputAttributes: _angular_core.InputSignal<AttributeConfig>;
47
65
  /**
48
- * @description Emitted when the inner input loses focus.
66
+ * @description Emitted when the inner input loses focus, including when focus moves to the clear button or to
67
+ * content in the prefix or suffix templates.
49
68
  */
50
69
  readonly inputBlur: _angular_core.OutputEmitterRef<FocusEvent>;
51
70
  /**
@@ -57,6 +76,12 @@ declare class TextBoxComponent implements TextBoxVariantInput, FormValueControl<
57
76
  * @description Emitted when the inner input gains focus.
58
77
  */
59
78
  readonly inputFocus: _angular_core.OutputEmitterRef<FocusEvent>;
79
+ /**
80
+ * @description Id of the inner `<input>` element. Point a `<label for>` or `<mona-label for>` at it to label the
81
+ * text box. A unique id is generated when it isn't set.
82
+ * @default generated
83
+ */
84
+ readonly inputId: _angular_core.InputSignal<string>;
60
85
  /**
61
86
  * @description Inline styles applied to the inner `<input>` element.
62
87
  * Accepts a style string or a `CSSStyleDeclaration` partial.
@@ -68,7 +93,25 @@ declare class TextBoxComponent implements TextBoxVariantInput, FormValueControl<
68
93
  * this is written by the `FormField` directive.
69
94
  * @default false
70
95
  */
71
- readonly invalid: _angular_core.InputSignal<boolean>;
96
+ readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
97
+ /**
98
+ * @description Maximum number of characters, set as `maxlength` on the inner input. When bound to a signal form
99
+ * field via `[formField]`, this is written from the field's `maxLength` rule.
100
+ * @default undefined
101
+ */
102
+ readonly maxLength: _angular_core.InputSignal<number | undefined>;
103
+ /**
104
+ * @description Minimum number of characters, set as `minlength` on the inner input. When bound to a signal form
105
+ * field via `[formField]`, this is written from the field's `minLength` rule.
106
+ * @default undefined
107
+ */
108
+ readonly minLength: _angular_core.InputSignal<number | undefined>;
109
+ /**
110
+ * @description Name of the inner input, used by browsers and password managers for autofill. When bound to a
111
+ * signal form field via `[formField]`, this is written by the `FormField` directive.
112
+ * @default ""
113
+ */
114
+ readonly name: _angular_core.InputSignal<string>;
72
115
  /**
73
116
  * @description Placeholder text shown when no value has been entered.
74
117
  * @default ""
@@ -78,13 +121,13 @@ declare class TextBoxComponent implements TextBoxVariantInput, FormValueControl<
78
121
  * @description Prevents value changes while preserving the component's visual state.
79
122
  * @default false
80
123
  */
81
- readonly readonly: _angular_core.InputSignal<boolean>;
124
+ readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
82
125
  /**
83
126
  * @description Marks the text box as required.
84
127
  * Triggers the invalid state when the value is empty and the field has been touched.
85
128
  * @default false
86
129
  */
87
- readonly required: _angular_core.InputSignal<boolean>;
130
+ readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
88
131
  /**
89
132
  * @description Border-radius preset applied to the component.
90
133
  * @default "medium"
@@ -96,8 +139,8 @@ declare class TextBoxComponent implements TextBoxVariantInput, FormValueControl<
96
139
  */
97
140
  readonly size: _angular_core.InputSignal<"large" | "medium" | "small" | null | undefined>;
98
141
  /**
99
- * @description Emitted when the text box is interacted with — on blur, value change, or clear.
100
- * The `FormField` directive listens to this to mark the field as touched.
142
+ * @description Emitted when focus leaves the text box, including its clear button and prefix and suffix content.
143
+ * Form directives (`[formField]`, `ngModel`, `formControl`) listen to this to mark the field as touched.
101
144
  */
102
145
  readonly touch: _angular_core.OutputEmitterRef<void>;
103
146
  /**
@@ -105,7 +148,7 @@ declare class TextBoxComponent implements TextBoxVariantInput, FormValueControl<
105
148
  * this is written by the `FormField` directive.
106
149
  * @default false
107
150
  */
108
- readonly touched: _angular_core.InputSignal<boolean>;
151
+ readonly touched: _angular_core.InputSignalWithTransform<boolean, unknown>;
109
152
  /**
110
153
  * @description Sets the `type` attribute of the inner `<input>` element.
111
154
  * @default "text"
@@ -121,12 +164,17 @@ declare class TextBoxComponent implements TextBoxVariantInput, FormValueControl<
121
164
  * @default ""
122
165
  */
123
166
  readonly value: _angular_core.ModelSignal<string>;
124
- focus(): void;
167
+ /**
168
+ * Focuses the inner input and places the caret after the value, so the end of a long value is in view.
169
+ * @param options Options passed to the native `focus()` call, such as `preventScroll`.
170
+ */
171
+ focus(options?: FocusOptions): void;
125
172
  onClearClick(): void;
126
173
  onInputBlur(event: FocusEvent): void;
127
174
  onValueChange(value: string): void;
175
+ protected onFocusOut(event: FocusEvent): void;
128
176
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TextBoxComponent, never>;
129
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<TextBoxComponent, "mona-text-box", never, { "clearButton": { "alias": "clearButton"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "inputAttributes": { "alias": "inputAttributes"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "inputStyle": { "alias": "inputStyle"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "inputBlur": "inputBlur"; "inputFocus": "inputFocus"; "touch": "touch"; "value": "valueChange"; }, ["prefixTemplateList", "suffixTemplateList"], never, true, never>;
177
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TextBoxComponent, "mona-text-box", never, { "ariaDescribedBy": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "clearButton": { "alias": "clearButton"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "inputAttributes": { "alias": "inputAttributes"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "inputStyle": { "alias": "inputStyle"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "minLength": { "alias": "minLength"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "inputBlur": "inputBlur"; "inputFocus": "inputFocus"; "touch": "touch"; "value": "valueChange"; }, ["prefixTemplateList", "suffixTemplateList"], never, true, never>;
130
178
  }
131
179
 
132
180
  declare class TextBoxDirective implements InputVariantInput {
@@ -136,7 +184,7 @@ declare class TextBoxDirective implements InputVariantInput {
136
184
  * @description Marks the input as invalid, triggering error border and ring styling.
137
185
  * @default false
138
186
  */
139
- readonly invalid: _angular_core.InputSignal<boolean>;
187
+ readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
140
188
  /**
141
189
  * @description Border-radius preset applied to the component.
142
190
  * @default "medium"
@@ -151,7 +199,7 @@ declare class TextBoxDirective implements InputVariantInput {
151
199
  * @description Marks the input as touched. Error styling is only shown when both `invalid` and `touched` are `true`.
152
200
  * @default false
153
201
  */
154
- readonly touched: _angular_core.InputSignal<boolean>;
202
+ readonly touched: _angular_core.InputSignalWithTransform<boolean, unknown>;
155
203
  /**
156
204
  * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
157
205
  * @default ""