@molecule/app-ui-angular 1.1.1 → 1.2.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.
- package/README.md +279 -180
- package/dist/components/card.component.d.ts +10 -0
- package/dist/components/card.component.d.ts.map +1 -1
- package/dist/components/card.component.js +27 -7
- package/dist/components/card.component.js.map +1 -1
- package/dist/components/checkbox.component.d.ts +0 -5
- package/dist/components/checkbox.component.d.ts.map +1 -1
- package/dist/components/checkbox.component.js +16 -20
- package/dist/components/checkbox.component.js.map +1 -1
- package/dist/components/confirm-dialog.component.d.ts +33 -2
- package/dist/components/confirm-dialog.component.d.ts.map +1 -1
- package/dist/components/confirm-dialog.component.js +81 -24
- package/dist/components/confirm-dialog.component.js.map +1 -1
- package/dist/components/controlled-checked.directive.d.ts +45 -0
- package/dist/components/controlled-checked.directive.d.ts.map +1 -0
- package/dist/components/controlled-checked.directive.js +74 -0
- package/dist/components/controlled-checked.directive.js.map +1 -0
- package/dist/components/dropdown.component.d.ts.map +1 -1
- package/dist/components/dropdown.component.js +5 -4
- package/dist/components/dropdown.component.js.map +1 -1
- package/dist/components/input.component.d.ts.map +1 -1
- package/dist/components/input.component.js +11 -2
- package/dist/components/input.component.js.map +1 -1
- package/dist/components/modal.component.d.ts +16 -9
- package/dist/components/modal.component.d.ts.map +1 -1
- package/dist/components/modal.component.js +27 -15
- package/dist/components/modal.component.js.map +1 -1
- package/dist/components/page-header.component.d.ts +11 -0
- package/dist/components/page-header.component.d.ts.map +1 -1
- package/dist/components/page-header.component.js +25 -10
- package/dist/components/page-header.component.js.map +1 -1
- package/dist/components/prompt-dialog.component.d.ts +35 -4
- package/dist/components/prompt-dialog.component.d.ts.map +1 -1
- package/dist/components/prompt-dialog.component.js +63 -9
- package/dist/components/prompt-dialog.component.js.map +1 -1
- package/dist/components/radio-group.component.d.ts.map +1 -1
- package/dist/components/radio-group.component.js +19 -17
- package/dist/components/radio-group.component.js.map +1 -1
- package/dist/components/responsive-app-shell.component.d.ts +3 -7
- package/dist/components/responsive-app-shell.component.d.ts.map +1 -1
- package/dist/components/responsive-app-shell.component.js +12 -17
- package/dist/components/responsive-app-shell.component.js.map +1 -1
- package/dist/components/select.component.d.ts +3 -1
- package/dist/components/select.component.d.ts.map +1 -1
- package/dist/components/select.component.js +11 -2
- package/dist/components/select.component.js.map +1 -1
- package/dist/components/sidebar-user-card.component.d.ts +10 -0
- package/dist/components/sidebar-user-card.component.d.ts.map +1 -1
- package/dist/components/sidebar-user-card.component.js +20 -3
- package/dist/components/sidebar-user-card.component.js.map +1 -1
- package/dist/components/switch.component.d.ts.map +1 -1
- package/dist/components/switch.component.js +17 -16
- package/dist/components/switch.component.js.map +1 -1
- package/dist/components/tabs.component.d.ts +10 -0
- package/dist/components/tabs.component.d.ts.map +1 -1
- package/dist/components/tabs.component.js +19 -7
- package/dist/components/tabs.component.js.map +1 -1
- package/dist/components/textarea.component.d.ts +8 -1
- package/dist/components/textarea.component.d.ts.map +1 -1
- package/dist/components/textarea.component.js +18 -3
- package/dist/components/textarea.component.js.map +1 -1
- package/dist/components/tooltip.component.d.ts.map +1 -1
- package/dist/components/tooltip.component.js +3 -2
- package/dist/components/tooltip.component.js.map +1 -1
- package/dist/utilities/rest-attrs.d.ts +35 -2
- package/dist/utilities/rest-attrs.d.ts.map +1 -1
- package/dist/utilities/rest-attrs.js +38 -2
- package/dist/utilities/rest-attrs.js.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-16T10:36:46.823Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-ui-angular
|
|
@@ -1696,6 +1696,24 @@ interface ResolvedIcon {
|
|
|
1696
1696
|
}
|
|
1697
1697
|
```
|
|
1698
1698
|
|
|
1699
|
+
#### `ReapplyRestAttributesOptions`
|
|
1700
|
+
|
|
1701
|
+
Options for {@link reapplyRestAttributes}.
|
|
1702
|
+
|
|
1703
|
+
```typescript
|
|
1704
|
+
interface ReapplyRestAttributesOptions {
|
|
1705
|
+
/**
|
|
1706
|
+
* Move `aria-describedby` too. The default keeps it on the host: a
|
|
1707
|
+
* component that MERGES the host's `aria-describedby` with its own target
|
|
1708
|
+
* (the input/select/textarea family, see below) has already applied it on
|
|
1709
|
+
* an inner binding, and re-moving the re-bound value would erase that
|
|
1710
|
+
* merge. A component that spreads `aria-describedby` straight onto its
|
|
1711
|
+
* `...rest` target (Modal) has no merge to protect, so it opts in.
|
|
1712
|
+
*/
|
|
1713
|
+
includeDescribedBy?: boolean
|
|
1714
|
+
}
|
|
1715
|
+
```
|
|
1716
|
+
|
|
1699
1717
|
### Types
|
|
1700
1718
|
|
|
1701
1719
|
#### `Children`
|
|
@@ -2862,6 +2880,7 @@ order; rest props (`aria-*`, `data-*`, `id`) land on the host.
|
|
|
2862
2880
|
'[attr.data-testid]': 'testId',
|
|
2863
2881
|
'[attr.role]': 'interactive ? "button" : null',
|
|
2864
2882
|
'[attr.tabindex]': 'interactive ? 0 : null',
|
|
2883
|
+
'(keydown)': 'handleKeyDown($event)',
|
|
2865
2884
|
},
|
|
2866
2885
|
template: `<ng-content></ng-content>`,
|
|
2867
2886
|
})
|
|
@@ -2908,6 +2927,22 @@ export class Card {
|
|
|
2908
2927
|
hostStyle(): string | null {
|
|
2909
2928
|
return styleText(this.style)
|
|
2910
2929
|
}
|
|
2930
|
+
|
|
2931
|
+
/**
|
|
2932
|
+
* An interactive card is announced as a button and sits in the tab order, so
|
|
2933
|
+
* Enter and Space activate it the way they activate a native button: by
|
|
2934
|
+
* clicking it, which runs the consumer's click handler with a real click
|
|
2935
|
+
* event. Keys pressed in a control inside the card belong to that control,
|
|
2936
|
+
* and a card that is not interactive ignores keys.
|
|
2937
|
+
*
|
|
2938
|
+
* @param event - The key event.
|
|
2939
|
+
*/
|
|
2940
|
+
handleKeyDown(event: KeyboardEvent): void {
|
|
2941
|
+
if (!this.interactive || event.target !== event.currentTarget) return
|
|
2942
|
+
if (event.key !== 'Enter' && event.key !== ' ') return
|
|
2943
|
+
event.preventDefault()
|
|
2944
|
+
;(event.currentTarget as HTMLElement).click()
|
|
2945
|
+
}
|
|
2911
2946
|
}
|
|
2912
2947
|
```
|
|
2913
2948
|
|
|
@@ -3104,6 +3139,7 @@ there at view init.
|
|
|
3104
3139
|
@Component({
|
|
3105
3140
|
selector: 'div[mol-checkbox]',
|
|
3106
3141
|
standalone: true,
|
|
3142
|
+
imports: [MolControlledChecked],
|
|
3107
3143
|
inputs: [
|
|
3108
3144
|
'label',
|
|
3109
3145
|
'checked',
|
|
@@ -3126,7 +3162,8 @@ there at view init.
|
|
|
3126
3162
|
type="checkbox"
|
|
3127
3163
|
[attr.id]="checkboxId()"
|
|
3128
3164
|
[attr.name]="name"
|
|
3129
|
-
[
|
|
3165
|
+
[molChecked]="checked"
|
|
3166
|
+
[molDefaultChecked]="defaultChecked"
|
|
3130
3167
|
[disabled]="disabled"
|
|
3131
3168
|
[attr.data-state]="checked ? 'checked' : 'unchecked'"
|
|
3132
3169
|
[attr.aria-invalid]="error || fieldContext()?.invalid ? 'true' : 'false'"
|
|
@@ -3172,14 +3209,6 @@ export class Checkbox implements AfterViewChecked {
|
|
|
3172
3209
|
/** Uncontrolled initial checked state (renders as the checked attribute). */
|
|
3173
3210
|
defaultChecked?: boolean
|
|
3174
3211
|
|
|
3175
|
-
/**
|
|
3176
|
-
* The controlled-or-default checked state (React: `checked ?? defaultChecked`).
|
|
3177
|
-
* @returns True when the checked attribute renders.
|
|
3178
|
-
*/
|
|
3179
|
-
isChecked(): boolean {
|
|
3180
|
-
return (this.checked ?? this.defaultChecked) === true
|
|
3181
|
-
}
|
|
3182
|
-
|
|
3183
3212
|
/** The genuine native `change` event. */
|
|
3184
3213
|
@Output() readonly change = new EventEmitter<Event>()
|
|
3185
3214
|
|
|
@@ -3605,12 +3634,18 @@ React's `Modal` root is a fragment/portal).
|
|
|
3605
3634
|
'data-parity-unwrap': '',
|
|
3606
3635
|
style: 'display: contents',
|
|
3607
3636
|
},
|
|
3608
|
-
template: `<mol-modal
|
|
3637
|
+
template: `<mol-modal
|
|
3638
|
+
[open]="open"
|
|
3639
|
+
(close)="close.emit($event)"
|
|
3640
|
+
[attr.aria-labelledby]="titleId"
|
|
3641
|
+
[attr.aria-describedby]="ariaDescribedBy"
|
|
3609
3642
|
><div [class]="cm().stack(3)">
|
|
3610
|
-
<h2 [class]="cm().cn(cm().textSize('lg'), cm().fontWeight('bold'))">
|
|
3643
|
+
<h2 [attr.id]="titleId" [class]="cm().cn(cm().textSize('lg'), cm().fontWeight('bold'))">
|
|
3611
3644
|
<ng-content select="[slot=title]"></ng-content>
|
|
3612
3645
|
</h2>
|
|
3613
|
-
<p [class]="cm().textSize('sm')"
|
|
3646
|
+
<p #descriptionSlot [attr.id]="descriptionId" [class]="cm().textSize('sm')">
|
|
3647
|
+
<ng-content select="[slot=description]"></ng-content>
|
|
3648
|
+
</p>
|
|
3614
3649
|
<ng-content></ng-content>
|
|
3615
3650
|
<div [class]="cm().flex({ justify: 'end', gap: 'sm' })">
|
|
3616
3651
|
<button mol-button [variant]="'ghost'" [disabled]="!!loading" (click)="close.emit($event)">
|
|
@@ -3628,7 +3663,32 @@ React's `Modal` root is a fragment/portal).
|
|
|
3628
3663
|
</div></mol-modal
|
|
3629
3664
|
>`,
|
|
3630
3665
|
})
|
|
3631
|
-
export class ConfirmDialog {
|
|
3666
|
+
export class ConfirmDialog implements DoCheck {
|
|
3667
|
+
/**
|
|
3668
|
+
* Per-instance id of the rendered title heading, wired as the dialog's
|
|
3669
|
+
* accessible name: the binding on `<mol-modal>` lands on its host element,
|
|
3670
|
+
* which Modal's rest-attribute move copies onto the dialog `<div>` —
|
|
3671
|
+
* `aria-labelledby` pointing at the visible `<h2>` (WAI-ARIA dialog
|
|
3672
|
+
* pattern; axe `aria-dialog-name`).
|
|
3673
|
+
*/
|
|
3674
|
+
readonly titleId = `mol-confirm-dialog-title-${++confirmDialogInstances}`
|
|
3675
|
+
|
|
3676
|
+
/**
|
|
3677
|
+
* Per-instance id of the rendered description paragraph, wired as the
|
|
3678
|
+
* dialog's accessible description through the same rest-attribute move as
|
|
3679
|
+
* the title (only bound when projected description content renders — a
|
|
3680
|
+
* reference to an empty paragraph describes nothing, axe
|
|
3681
|
+
* `aria-dialog-name`/`aria-valid-attr-value`).
|
|
3682
|
+
*/
|
|
3683
|
+
readonly descriptionId = nextInstanceId()
|
|
3684
|
+
|
|
3685
|
+
/** The rendered description paragraph (its projected nodes decide the wiring). */
|
|
3686
|
+
// `static: true` resolves the query during creation, so the projected nodes
|
|
3687
|
+
// are readable on the FIRST change-detection pass — a non-static query
|
|
3688
|
+
// resolves after view init, one pass too late for the description wiring.
|
|
3689
|
+
@ViewChild('descriptionSlot', { static: true })
|
|
3690
|
+
descriptionSlot?: ElementRef<HTMLParagraphElement>
|
|
3691
|
+
|
|
3632
3692
|
/** Whether the dialog is open. */
|
|
3633
3693
|
open = false
|
|
3634
3694
|
/** Title (node-valued prop). */
|
|
@@ -3664,6 +3724,23 @@ export class ConfirmDialog {
|
|
|
3664
3724
|
return getClassMap()
|
|
3665
3725
|
}
|
|
3666
3726
|
|
|
3727
|
+
/**
|
|
3728
|
+
* The dialog's accessible description id, or null when no description
|
|
3729
|
+
* content renders. A FIELD, not a template method call: Angular memoizes a
|
|
3730
|
+
* no-argument method binding, so it would keep the first (pre-view-init)
|
|
3731
|
+
* value forever. Re-read each pass from the projected description nodes.
|
|
3732
|
+
*/
|
|
3733
|
+
ariaDescribedBy: string | null = null
|
|
3734
|
+
|
|
3735
|
+
/**
|
|
3736
|
+
* Recomputes {@link ariaDescribedBy} before each view check. The query is
|
|
3737
|
+
* static, so the projected nodes are readable on the first pass already; a
|
|
3738
|
+
* later change to what renders is picked up on the next pass.
|
|
3739
|
+
*/
|
|
3740
|
+
ngDoCheck(): void {
|
|
3741
|
+
this.ariaDescribedBy = hasNodes(this.descriptionSlot?.nativeElement) ? this.descriptionId : null
|
|
3742
|
+
}
|
|
3743
|
+
|
|
3667
3744
|
/**
|
|
3668
3745
|
* The cancel button's label.
|
|
3669
3746
|
* @returns The label text.
|
|
@@ -3727,6 +3804,7 @@ fragment-like.
|
|
|
3727
3804
|
><div
|
|
3728
3805
|
[attr.id]="menuId"
|
|
3729
3806
|
role="menu"
|
|
3807
|
+
tabindex="-1"
|
|
3730
3808
|
data-state="open"
|
|
3731
3809
|
[class]="menuClasses()"
|
|
3732
3810
|
[style]="menuStyleText()"
|
|
@@ -5054,6 +5132,7 @@ export class Input implements DoCheck {
|
|
|
5054
5132
|
}
|
|
5055
5133
|
|
|
5056
5134
|
ngDoCheck(): void {
|
|
5135
|
+
void this.i18n.locale()
|
|
5057
5136
|
const host = this.host.nativeElement as HTMLElement
|
|
5058
5137
|
const input = this.inputEl?.nativeElement ?? host.querySelector('input')
|
|
5059
5138
|
const left =
|
|
@@ -5076,9 +5155,10 @@ export class Input implements DoCheck {
|
|
|
5076
5155
|
this.sync.sync(right, this.hasRight || clear, this.parentOf(right))
|
|
5077
5156
|
if (!this.movedRest && input) {
|
|
5078
5157
|
this.restDescribedBy = host.getAttribute('aria-describedby')
|
|
5079
|
-
moveRestAttributes(host, input)
|
|
5080
5158
|
this.movedRest = true
|
|
5159
|
+
moveRestAttributes(host, input)
|
|
5081
5160
|
}
|
|
5161
|
+
reapplyRestAttributes(host, input)
|
|
5082
5162
|
if (this.value !== undefined && input && input.value !== String(this.value))
|
|
5083
5163
|
input.value = String(this.value)
|
|
5084
5164
|
}
|
|
@@ -5971,6 +6051,7 @@ the topmost dialog only, reference-counted body scroll lock).
|
|
|
5971
6051
|
#wrapper
|
|
5972
6052
|
[class]="cm().dialogWrapper"
|
|
5973
6053
|
[style]="wrapperStyle()"
|
|
6054
|
+
role="presentation"
|
|
5974
6055
|
(click)="handleOverlayClick($event)"
|
|
5975
6056
|
>
|
|
5976
6057
|
<div
|
|
@@ -5982,7 +6063,6 @@ the topmost dialog only, reference-counted body scroll lock).
|
|
|
5982
6063
|
[class]="dialogClasses()"
|
|
5983
6064
|
[style]="dialogStyle()"
|
|
5984
6065
|
[attr.data-testid]="testId"
|
|
5985
|
-
(click)="stopPropagation($event)"
|
|
5986
6066
|
>
|
|
5987
6067
|
@if (title) {
|
|
5988
6068
|
<div [class]="cm().dialogHeader">
|
|
@@ -6019,7 +6099,7 @@ the topmost dialog only, reference-counted body scroll lock).
|
|
|
6019
6099
|
</div>
|
|
6020
6100
|
</div>`,
|
|
6021
6101
|
})
|
|
6022
|
-
export class Modal implements AfterViewInit, DoCheck, OnDestroy {
|
|
6102
|
+
export class Modal implements AfterViewInit, AfterViewChecked, DoCheck, OnDestroy {
|
|
6023
6103
|
open = false
|
|
6024
6104
|
title?: string
|
|
6025
6105
|
size: ModalSize = 'md'
|
|
@@ -6081,12 +6161,12 @@ export class Modal implements AfterViewInit, DoCheck, OnDestroy {
|
|
|
6081
6161
|
return resolveIcon('x-mark', this.cm().iconMd)
|
|
6082
6162
|
}
|
|
6083
6163
|
|
|
6084
|
-
stopPropagation(event: MouseEvent): void {
|
|
6085
|
-
event.stopPropagation()
|
|
6086
|
-
}
|
|
6087
|
-
|
|
6088
6164
|
handleOverlayClick(event: MouseEvent): void {
|
|
6089
|
-
if (
|
|
6165
|
+
if (event.target !== event.currentTarget) {
|
|
6166
|
+
event.stopPropagation()
|
|
6167
|
+
return
|
|
6168
|
+
}
|
|
6169
|
+
if (this.closeOnOverlayClick) this.requestClose()
|
|
6090
6170
|
}
|
|
6091
6171
|
|
|
6092
6172
|
requestClose(): void {
|
|
@@ -6133,6 +6213,12 @@ export class Modal implements AfterViewInit, DoCheck, OnDestroy {
|
|
|
6133
6213
|
this.syncScrollLock()
|
|
6134
6214
|
}
|
|
6135
6215
|
|
|
6216
|
+
ngAfterViewChecked(): void {
|
|
6217
|
+
reapplyRestAttributes(this.host.nativeElement, this.dialog?.nativeElement, {
|
|
6218
|
+
includeDescribedBy: true,
|
|
6219
|
+
})
|
|
6220
|
+
}
|
|
6221
|
+
|
|
6136
6222
|
ngOnDestroy(): void {
|
|
6137
6223
|
this.removeListeners()
|
|
6138
6224
|
popModalStack(this.stackId)
|
|
@@ -6206,18 +6292,7 @@ export class Modal implements AfterViewInit, DoCheck, OnDestroy {
|
|
|
6206
6292
|
this.wrapper?.nativeElement.remove()
|
|
6207
6293
|
this.moved = false
|
|
6208
6294
|
}
|
|
6209
|
-
|
|
6210
|
-
private syncScrollLock(): void {
|
|
6211
|
-
const shouldLock = !!this.open && this.preventScroll
|
|
6212
|
-
if (shouldLock && !this.locked) {
|
|
6213
|
-
this.sync.lock()
|
|
6214
|
-
this.locked = true
|
|
6215
|
-
} else if (!shouldLock && this.locked) {
|
|
6216
|
-
this.sync.unlock()
|
|
6217
|
-
this.locked = false
|
|
6218
|
-
}
|
|
6219
|
-
}
|
|
6220
|
-
// … truncated — 3 more members: addListeners, removeListeners, handleKeyDown; the full declaration is in node_modules/@molecule/app-ui-angular/dist/components/modal.component.d.ts
|
|
6295
|
+
// … truncated — 4 more members: syncScrollLock, addListeners, removeListeners, handleKeyDown; the full declaration is in node_modules/@molecule/app-ui-angular/dist/components/modal.component.d.ts
|
|
6221
6296
|
```
|
|
6222
6297
|
|
|
6223
6298
|
_(Member comments are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/modal.component.d.ts`.)_
|
|
@@ -8140,7 +8215,7 @@ from the DOM — the projected nodes need an always-mounted capture point.
|
|
|
8140
8215
|
'[attr.data-mol-id]': 'automationId',
|
|
8141
8216
|
},
|
|
8142
8217
|
template: `@if (breadcrumbs && breadcrumbs.length > 0) {
|
|
8143
|
-
<nav [class]="cm().pageHeaderBreadcrumbs" aria-label="
|
|
8218
|
+
<nav [class]="cm().pageHeaderBreadcrumbs" [attr.aria-label]="breadcrumbLabel()">
|
|
8144
8219
|
@for (crumb of breadcrumbs; track $index) {
|
|
8145
8220
|
@if ($index > 0) {
|
|
8146
8221
|
<span [class]="cm().pageHeaderBreadcrumbSeparator" aria-hidden="true">/</span>
|
|
@@ -8184,6 +8259,13 @@ export class PageHeader implements AfterViewInit, DoCheck {
|
|
|
8184
8259
|
/** The actions wrapper (always in the template; detached when unused). */
|
|
8185
8260
|
@ViewChild('actionsSlot') actionsSlot?: ElementRef<HTMLDivElement>
|
|
8186
8261
|
|
|
8262
|
+
/**
|
|
8263
|
+
* Reactive translation, read in the injection context. Its `t` reads the
|
|
8264
|
+
* locale, so the view re-renders the label on a locale switch (the static `t`
|
|
8265
|
+
* does not).
|
|
8266
|
+
*/
|
|
8267
|
+
private readonly i18n = useTranslation()
|
|
8268
|
+
|
|
8187
8269
|
private readonly sync = new SlotWrapper(inject(ElementRef), inject(Renderer2))
|
|
8188
8270
|
private hasActions = false
|
|
8189
8271
|
private actionsParent: HTMLElement | null = null
|
|
@@ -8204,6 +8286,14 @@ export class PageHeader implements AfterViewInit, DoCheck {
|
|
|
8204
8286
|
return this.cm().cn(this.cm().pageHeader, this.className)
|
|
8205
8287
|
}
|
|
8206
8288
|
|
|
8289
|
+
/**
|
|
8290
|
+
* The breadcrumb nav's accessible label.
|
|
8291
|
+
* @returns The label text.
|
|
8292
|
+
*/
|
|
8293
|
+
breadcrumbLabel(): string {
|
|
8294
|
+
return this.i18n.t('ui.pageHeader.breadcrumbs', undefined, { defaultValue: 'Breadcrumb' })
|
|
8295
|
+
}
|
|
8296
|
+
|
|
8207
8297
|
/**
|
|
8208
8298
|
* Serializes the inline style.
|
|
8209
8299
|
* @returns The style attribute text.
|
|
@@ -8928,14 +9018,22 @@ keeps it open with the value intact. The host is unwrapped
|
|
|
8928
9018
|
'data-parity-unwrap': '',
|
|
8929
9019
|
style: 'display: contents',
|
|
8930
9020
|
},
|
|
8931
|
-
template: `<mol-modal
|
|
9021
|
+
template: `<mol-modal
|
|
9022
|
+
[open]="open"
|
|
9023
|
+
(close)="onModalClose()"
|
|
9024
|
+
[attr.aria-labelledby]="titleId"
|
|
9025
|
+
[attr.aria-describedby]="description ? descriptionId : null"
|
|
8932
9026
|
><form (submit)="handleSubmit($event)">
|
|
8933
9027
|
<div [class]="cm().stack(3)">
|
|
8934
|
-
<h2
|
|
9028
|
+
<h2
|
|
9029
|
+
#titleSlot
|
|
9030
|
+
[attr.id]="titleId"
|
|
9031
|
+
[class]="cm().cn(cm().textSize('lg'), cm().fontWeight('bold'))"
|
|
9032
|
+
>
|
|
8935
9033
|
<ng-content select="[slot=title]"></ng-content>
|
|
8936
9034
|
</h2>
|
|
8937
9035
|
@if (description) {
|
|
8938
|
-
<p [class]="cm().textSize('sm')">{{ description }}</p>
|
|
9036
|
+
<p [attr.id]="descriptionId" [class]="cm().textSize('sm')">{{ description }}</p>
|
|
8939
9037
|
}
|
|
8940
9038
|
<div
|
|
8941
9039
|
mol-input
|
|
@@ -8971,7 +9069,7 @@ keeps it open with the value intact. The host is unwrapped
|
|
|
8971
9069
|
</form></mol-modal
|
|
8972
9070
|
>`,
|
|
8973
9071
|
})
|
|
8974
|
-
export class PromptDialog implements AfterViewInit, DoCheck {
|
|
9072
|
+
export class PromptDialog implements AfterViewInit, AfterViewChecked, DoCheck {
|
|
8975
9073
|
/** Whether the dialog is open. */
|
|
8976
9074
|
open = false
|
|
8977
9075
|
/** Dialog heading (node-valued prop). */
|
|
@@ -8982,10 +9080,7 @@ export class PromptDialog implements AfterViewInit, DoCheck {
|
|
|
8982
9080
|
placeholder?: string
|
|
8983
9081
|
/** Value the input starts from every time the dialog opens. */
|
|
8984
9082
|
initialValue = ''
|
|
8985
|
-
/**
|
|
8986
|
-
* Called with the entered value on confirm. Resolve to close the dialog;
|
|
8987
|
-
* reject or throw to keep it open.
|
|
8988
|
-
*/
|
|
9083
|
+
/** Called with the entered value on confirm. */
|
|
8989
9084
|
onSubmit?: (value: string) => void | Promise<void>
|
|
8990
9085
|
/** Confirm-button label. */
|
|
8991
9086
|
confirmLabel?: string
|
|
@@ -9008,50 +9103,41 @@ export class PromptDialog implements AfterViewInit, DoCheck {
|
|
|
9008
9103
|
/** The composed input (its native element receives React's aria-label). */
|
|
9009
9104
|
@ViewChild(Input) inputComponent?: Input
|
|
9010
9105
|
|
|
9106
|
+
/** Per-instance id of the rendered title heading, wired as the dialog's accessible name: the binding on `<mol-modal>` lands on its host element, which Modal's res… */
|
|
9107
|
+
readonly titleId = nextInstanceId()
|
|
9108
|
+
|
|
9109
|
+
/** Per-instance id of the rendered description paragraph, wired as the dialog's accessible description (only bound when a description renders — a reference to not… */
|
|
9110
|
+
readonly descriptionId = nextInstanceId()
|
|
9111
|
+
|
|
9011
9112
|
/** The current input value. */
|
|
9012
9113
|
readonly value = signal('')
|
|
9013
9114
|
/** Whether a submit is in flight. */
|
|
9014
9115
|
readonly pending = signal(false)
|
|
9015
9116
|
|
|
9016
|
-
/**
|
|
9017
|
-
* Reactive translation, read in the injection context. Its `t` reads the
|
|
9018
|
-
* locale, so the view re-renders the text on a locale switch (the static `t`
|
|
9019
|
-
* does not).
|
|
9020
|
-
*/
|
|
9117
|
+
/** Reactive translation, read in the injection context. */
|
|
9021
9118
|
private readonly i18n = useTranslation()
|
|
9022
9119
|
|
|
9023
9120
|
private lastOpen = false
|
|
9024
9121
|
private lastInitial = ''
|
|
9122
|
+
/** Whether an open transition is waiting for the after-view input focus. */
|
|
9123
|
+
private pendingInputFocus = false
|
|
9025
9124
|
|
|
9026
|
-
/**
|
|
9027
|
-
* The current class map.
|
|
9028
|
-
* @returns The UIClassMap.
|
|
9029
|
-
*/
|
|
9125
|
+
/** The current class map. */
|
|
9030
9126
|
cm(): UIClassMap {
|
|
9031
9127
|
return getClassMap()
|
|
9032
9128
|
}
|
|
9033
9129
|
|
|
9034
|
-
/**
|
|
9035
|
-
* The cancel button's label.
|
|
9036
|
-
* @returns The label text.
|
|
9037
|
-
*/
|
|
9130
|
+
/** The cancel button's label. */
|
|
9038
9131
|
cancelText(): string {
|
|
9039
9132
|
return this.cancelLabel ?? this.i18n.t('prompt.cancel', {}, { defaultValue: 'Cancel' })
|
|
9040
9133
|
}
|
|
9041
9134
|
|
|
9042
|
-
/**
|
|
9043
|
-
* The confirm button's label.
|
|
9044
|
-
* @returns The label text.
|
|
9045
|
-
*/
|
|
9135
|
+
/** The confirm button's label. */
|
|
9046
9136
|
confirmText(): string {
|
|
9047
9137
|
return this.confirmLabel ?? this.i18n.t('prompt.confirm', {}, { defaultValue: 'Confirm' })
|
|
9048
9138
|
}
|
|
9049
9139
|
|
|
9050
|
-
/**
|
|
9051
|
-
* The input's accessible label: React uses the title when it is a plain
|
|
9052
|
-
* string, otherwise the placeholder.
|
|
9053
|
-
* @returns The label, or null when React would render none.
|
|
9054
|
-
*/
|
|
9140
|
+
/** The input's accessible label: React uses the title when it is a plain string, otherwise the placeholder. */
|
|
9055
9141
|
inputLabel(): string | null {
|
|
9056
9142
|
const title = this.titleSlot?.nativeElement
|
|
9057
9143
|
if (title) {
|
|
@@ -9062,10 +9148,7 @@ export class PromptDialog implements AfterViewInit, DoCheck {
|
|
|
9062
9148
|
return this.placeholder ?? null
|
|
9063
9149
|
}
|
|
9064
9150
|
|
|
9065
|
-
/**
|
|
9066
|
-
* Seeds the value when the dialog opens (React's `[open, initialValue]`
|
|
9067
|
-
* effect).
|
|
9068
|
-
*/
|
|
9151
|
+
/** Seeds the value when the dialog opens (React's `[open, initialValue]` effect). */
|
|
9069
9152
|
ngAfterViewInit(): void {
|
|
9070
9153
|
this.applyInputLabel()
|
|
9071
9154
|
this.lastOpen = !!this.open
|
|
@@ -9073,12 +9156,13 @@ export class PromptDialog implements AfterViewInit, DoCheck {
|
|
|
9073
9156
|
if (this.open) {
|
|
9074
9157
|
this.value.set(this.initialValue)
|
|
9075
9158
|
this.pending.set(false)
|
|
9159
|
+
// The dialog exists to take one string, so opening it puts focus in the
|
|
9160
|
+
// input — after the Modal has focused the dialog's first control.
|
|
9161
|
+
this.pendingInputFocus = true
|
|
9076
9162
|
}
|
|
9077
9163
|
}
|
|
9078
9164
|
|
|
9079
|
-
/**
|
|
9080
|
-
* Re-seeds the value on a later open transition (React's effect).
|
|
9081
|
-
*/
|
|
9165
|
+
/** Re-seeds the value on a later open transition (React's effect). */
|
|
9082
9166
|
ngDoCheck(): void {
|
|
9083
9167
|
const open = !!this.open
|
|
9084
9168
|
this.applyInputLabel()
|
|
@@ -9088,14 +9172,24 @@ export class PromptDialog implements AfterViewInit, DoCheck {
|
|
|
9088
9172
|
if (open) {
|
|
9089
9173
|
this.value.set(this.initialValue)
|
|
9090
9174
|
this.pending.set(false)
|
|
9175
|
+
this.pendingInputFocus = true
|
|
9091
9176
|
}
|
|
9092
9177
|
}
|
|
9093
9178
|
}
|
|
9094
9179
|
|
|
9095
|
-
/**
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9180
|
+
/** Focuses the input after the view — and the composed `Modal`'s focus move — has settled (React's `[open]` effect running after the Modal's effects). */
|
|
9181
|
+
ngAfterViewChecked(): void {
|
|
9182
|
+
if (!this.pendingInputFocus) return
|
|
9183
|
+
this.pendingInputFocus = false
|
|
9184
|
+
this.focusInput()
|
|
9185
|
+
}
|
|
9186
|
+
|
|
9187
|
+
/** Moves focus into the dialog's input (the input ends up focused, exactly as React's post-Modal focus effect leaves it). */
|
|
9188
|
+
focusInput(): void {
|
|
9189
|
+
this.inputComponent?.inputEl?.nativeElement.focus()
|
|
9190
|
+
}
|
|
9191
|
+
|
|
9192
|
+
/** Applies React's `aria-label` to the inner input (it is a rest prop there, and the view queries it needs resolve only after view init). */
|
|
9099
9193
|
private applyInputLabel(): void {
|
|
9100
9194
|
const input = this.inputComponent?.inputEl?.nativeElement
|
|
9101
9195
|
if (!input) return
|
|
@@ -9104,30 +9198,18 @@ export class PromptDialog implements AfterViewInit, DoCheck {
|
|
|
9104
9198
|
else input.setAttribute('aria-label', label)
|
|
9105
9199
|
}
|
|
9106
9200
|
|
|
9107
|
-
/**
|
|
9108
|
-
* Tracks the typed value (React's controlled `onChange`).
|
|
9109
|
-
*
|
|
9110
|
-
* @param event - The native input event.
|
|
9111
|
-
*/
|
|
9201
|
+
/** Tracks the typed value (React's controlled `onChange`). */
|
|
9112
9202
|
onInput(event: Event): void {
|
|
9113
9203
|
this.value.set((event.target as HTMLInputElement).value)
|
|
9114
9204
|
}
|
|
9115
9205
|
|
|
9116
|
-
/**
|
|
9117
|
-
* Modal's close request: ignored while a submit is pending (React passes a
|
|
9118
|
-
* no-op `onClose` while pending).
|
|
9119
|
-
*/
|
|
9206
|
+
/** Modal's close request: ignored while a submit is pending (React passes a no-op `onClose` while pending). */
|
|
9120
9207
|
onModalClose(): void {
|
|
9121
9208
|
if (this.pending()) return
|
|
9122
9209
|
this.close.emit()
|
|
9123
9210
|
}
|
|
9124
9211
|
|
|
9125
|
-
/**
|
|
9126
|
-
* Submits the entered value: resolve closes and resets; reject keeps the
|
|
9127
|
-
* dialog open (React's `handleSubmit`).
|
|
9128
|
-
*
|
|
9129
|
-
* @param event - The form submit event.
|
|
9130
|
-
*/
|
|
9212
|
+
/** Submits the entered value: resolve closes and resets; reject keeps the dialog open (React's `handleSubmit`). */
|
|
9131
9213
|
handleSubmit(event: Event): void {
|
|
9132
9214
|
event.preventDefault()
|
|
9133
9215
|
if (this.pending()) return
|
|
@@ -9146,6 +9228,8 @@ export class PromptDialog implements AfterViewInit, DoCheck {
|
|
|
9146
9228
|
}
|
|
9147
9229
|
```
|
|
9148
9230
|
|
|
9231
|
+
_(Member comments are shortened to their first sentence to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/prompt-dialog.component.d.ts`.)_
|
|
9232
|
+
|
|
9149
9233
|
#### `RadioGroup`
|
|
9150
9234
|
|
|
9151
9235
|
RadioGroup component.
|
|
@@ -9158,6 +9242,7 @@ exactly like React's per-option handler.
|
|
|
9158
9242
|
@Component({
|
|
9159
9243
|
selector: 'div[mol-radio-group]',
|
|
9160
9244
|
standalone: true,
|
|
9245
|
+
imports: [MolControlledChecked],
|
|
9161
9246
|
inputs: [
|
|
9162
9247
|
'options',
|
|
9163
9248
|
'value',
|
|
@@ -9194,7 +9279,7 @@ exactly like React's per-option handler.
|
|
|
9194
9279
|
type="radio"
|
|
9195
9280
|
[attr.name]="groupName()"
|
|
9196
9281
|
[attr.value]="option.value"
|
|
9197
|
-
[
|
|
9282
|
+
[molChecked]="value === option.value"
|
|
9198
9283
|
[disabled]="disabled || option.disabled"
|
|
9199
9284
|
(change)="select($event)"
|
|
9200
9285
|
[attr.data-state]="value === option.value ? 'checked' : 'unchecked'"
|
|
@@ -9813,6 +9898,7 @@ backdrop, portaled into `document.body`.
|
|
|
9813
9898
|
#wrapper
|
|
9814
9899
|
[class]="cm().cn(cm().position('fixed'), cm().inset0)"
|
|
9815
9900
|
[style]="wrapperStyle()"
|
|
9901
|
+
role="presentation"
|
|
9816
9902
|
(click)="handleBackdropClick($event)"
|
|
9817
9903
|
>
|
|
9818
9904
|
<div
|
|
@@ -9826,7 +9912,6 @@ backdrop, portaled into `document.body`.
|
|
|
9826
9912
|
[style]="panelStyle()"
|
|
9827
9913
|
[attr.data-mol-id]="dataMolId"
|
|
9828
9914
|
[attr.data-testid]="testId"
|
|
9829
|
-
(click)="stopPropagation($event)"
|
|
9830
9915
|
>
|
|
9831
9916
|
<div
|
|
9832
9917
|
#headerRow
|
|
@@ -9963,12 +10048,12 @@ export class ResponsiveAppShellDrawer implements AfterViewInit, DoCheck, OnDestr
|
|
|
9963
10048
|
return resolveIcon('x-mark', this.cm().iconMd)
|
|
9964
10049
|
}
|
|
9965
10050
|
|
|
9966
|
-
stopPropagation(event: MouseEvent): void {
|
|
9967
|
-
event.stopPropagation()
|
|
9968
|
-
}
|
|
9969
|
-
|
|
9970
10051
|
handleBackdropClick(event: MouseEvent): void {
|
|
9971
|
-
if (event.target
|
|
10052
|
+
if (event.target !== event.currentTarget) {
|
|
10053
|
+
event.stopPropagation()
|
|
10054
|
+
return
|
|
10055
|
+
}
|
|
10056
|
+
this.shell().closeDrawer()
|
|
9972
10057
|
}
|
|
9973
10058
|
|
|
9974
10059
|
ngAfterViewInit(): void {
|
|
@@ -10314,6 +10399,8 @@ export class Select implements AfterViewInit, AfterViewChecked {
|
|
|
10314
10399
|
}
|
|
10315
10400
|
|
|
10316
10401
|
ngAfterViewChecked(): void {
|
|
10402
|
+
void this.i18n.locale()
|
|
10403
|
+
reapplyRestAttributes(this.host.nativeElement, this.selectEl?.nativeElement)
|
|
10317
10404
|
this.applyValue(false)
|
|
10318
10405
|
}
|
|
10319
10406
|
|
|
@@ -10450,7 +10537,11 @@ matching props override it.
|
|
|
10450
10537
|
<span [class]="secondaryClasses()">{{ secondary }}</span>
|
|
10451
10538
|
}
|
|
10452
10539
|
</span></button
|
|
10453
|
-
><mol-modal
|
|
10540
|
+
><mol-modal
|
|
10541
|
+
[open]="isOpen()"
|
|
10542
|
+
(close)="isOpen.set(false)"
|
|
10543
|
+
[className]="cm().drawer"
|
|
10544
|
+
[attr.aria-label]="drawerLabel()"
|
|
10454
10545
|
><mol-panel-close-provider [close]="closePanel"
|
|
10455
10546
|
><ng-content></ng-content></mol-panel-close-provider
|
|
10456
10547
|
></mol-modal>`,
|
|
@@ -10516,6 +10607,19 @@ export class SidebarUserCard implements AfterViewInit, OnDestroy {
|
|
|
10516
10607
|
)
|
|
10517
10608
|
}
|
|
10518
10609
|
|
|
10610
|
+
/**
|
|
10611
|
+
* The drawer's accessible label. The drawer is a title-less Modal (its
|
|
10612
|
+
* panel content carries its own headings), so it is named with the
|
|
10613
|
+
* localized `sidebarUserCard.drawer` label: the binding on `<mol-modal>`
|
|
10614
|
+
* lands on its host element, which Modal's rest-attribute move copies onto
|
|
10615
|
+
* the dialog `<div>` — screen readers announce "Account" instead of an
|
|
10616
|
+
* unnamed dialog (axe `aria-dialog-name`).
|
|
10617
|
+
* @returns The label text.
|
|
10618
|
+
*/
|
|
10619
|
+
drawerLabel(): string {
|
|
10620
|
+
return this.i18n.t('sidebarUserCard.drawer', {}, { defaultValue: 'Account' })
|
|
10621
|
+
}
|
|
10622
|
+
|
|
10519
10623
|
/**
|
|
10520
10624
|
* The resolved display name (React's fallback chain).
|
|
10521
10625
|
* @returns The name.
|
|
@@ -10933,6 +11037,7 @@ forwarded as the `change` output.
|
|
|
10933
11037
|
@Component({
|
|
10934
11038
|
selector: 'mol-switch',
|
|
10935
11039
|
standalone: true,
|
|
11040
|
+
imports: [MolControlledChecked],
|
|
10936
11041
|
inputs: ['label', 'checked', 'size', 'color', 'className', 'style', 'testId', 'disabled'],
|
|
10937
11042
|
host: {
|
|
10938
11043
|
'data-parity-unwrap': '',
|
|
@@ -10940,7 +11045,7 @@ forwarded as the `change` output.
|
|
|
10940
11045
|
},
|
|
10941
11046
|
template: `<input
|
|
10942
11047
|
type="checkbox"
|
|
10943
|
-
[
|
|
11048
|
+
[molChecked]="!!checked"
|
|
10944
11049
|
[disabled]="disabled"
|
|
10945
11050
|
aria-hidden="true"
|
|
10946
11051
|
tabindex="-1"
|
|
@@ -11372,7 +11477,7 @@ node value.
|
|
|
11372
11477
|
'[style]': 'hostStyle()',
|
|
11373
11478
|
'[attr.data-testid]': 'testId',
|
|
11374
11479
|
},
|
|
11375
|
-
template: `<div [class]="listClasses()" role="tablist"
|
|
11480
|
+
template: `<div [class]="listClasses()" role="tablist">
|
|
11376
11481
|
@for (item of items; track item.value) {
|
|
11377
11482
|
<button
|
|
11378
11483
|
#tabBtn
|
|
@@ -11380,11 +11485,12 @@ node value.
|
|
|
11380
11485
|
type="button"
|
|
11381
11486
|
role="tab"
|
|
11382
11487
|
[attr.aria-selected]="item.value === activeValue() ? 'true' : 'false'"
|
|
11383
|
-
[attr.aria-controls]="
|
|
11488
|
+
[attr.aria-controls]="controlsId(item)"
|
|
11384
11489
|
[attr.data-state]="item.value === activeValue() ? 'active' : 'inactive'"
|
|
11385
11490
|
[attr.tabindex]="item.value === activeValue() ? 0 : -1"
|
|
11386
11491
|
[disabled]="!!item.disabled"
|
|
11387
11492
|
(click)="selectTab(item.value)"
|
|
11493
|
+
(keydown)="handleKeyDown($event)"
|
|
11388
11494
|
[class]="triggerClasses()"
|
|
11389
11495
|
>
|
|
11390
11496
|
@if (item.icon) {
|
|
@@ -11449,54 +11555,38 @@ export class Tabs implements OnInit {
|
|
|
11449
11555
|
/** The uncontrolled active value. */
|
|
11450
11556
|
private readonly internalValue = signal<string | undefined>(undefined)
|
|
11451
11557
|
|
|
11452
|
-
/**
|
|
11453
|
-
* The current class map.
|
|
11454
|
-
* @returns The UIClassMap.
|
|
11455
|
-
*/
|
|
11558
|
+
/** The current class map. */
|
|
11456
11559
|
cm(): UIClassMap {
|
|
11457
11560
|
return getClassMap()
|
|
11458
11561
|
}
|
|
11459
11562
|
|
|
11460
|
-
/**
|
|
11461
|
-
* Seeds the uncontrolled value once, at mount, like React's
|
|
11462
|
-
* `useState(defaultValue || items[0]?.value)`: reordering the tabs later keeps
|
|
11463
|
-
* the active tab rather than activating whichever tab is now first.
|
|
11464
|
-
*/
|
|
11563
|
+
/** Seeds the uncontrolled value once, at mount, like React's `useState(defaultValue || items[0]?.value)`: reordering the tabs later keeps the active tab rather th… */
|
|
11465
11564
|
ngOnInit(): void {
|
|
11466
11565
|
this.internalValue.set(this.defaultValue || this.items[0]?.value)
|
|
11467
11566
|
}
|
|
11468
11567
|
|
|
11469
|
-
/**
|
|
11470
|
-
* The active tab value: the controlled `value`, else the uncontrolled one.
|
|
11471
|
-
* @returns The active value.
|
|
11472
|
-
*/
|
|
11568
|
+
/** The active tab value: the controlled `value`, else the uncontrolled one. */
|
|
11473
11569
|
activeValue(): string | undefined {
|
|
11474
11570
|
if (this.value !== undefined) return this.value
|
|
11475
11571
|
return this.internalValue()
|
|
11476
11572
|
}
|
|
11477
11573
|
|
|
11478
|
-
/**
|
|
11479
|
-
* The tab button id for a value.
|
|
11480
|
-
* @param value - The tab value.
|
|
11481
|
-
* @returns The id.
|
|
11482
|
-
*/
|
|
11574
|
+
/** The tab button id for a value. */
|
|
11483
11575
|
tabId(value: string): string {
|
|
11484
11576
|
return `${this.idBase}-tab-${value}`
|
|
11485
11577
|
}
|
|
11486
11578
|
|
|
11487
|
-
/**
|
|
11488
|
-
* The tabpanel id for a value.
|
|
11489
|
-
* @param value - The tab value.
|
|
11490
|
-
* @returns The id.
|
|
11491
|
-
*/
|
|
11579
|
+
/** The tabpanel id for a value. */
|
|
11492
11580
|
panelId(value: string): string {
|
|
11493
11581
|
return `${this.idBase}-tabpanel-${value}`
|
|
11494
11582
|
}
|
|
11495
11583
|
|
|
11496
|
-
/**
|
|
11497
|
-
|
|
11498
|
-
|
|
11499
|
-
|
|
11584
|
+
/** The `aria-controls` value for one tab, or null: only the tab whose panel is actually rendered (the active one, when its item has content) may name it — an `ari… */
|
|
11585
|
+
controlsId(item: TabItem<string>): string | null {
|
|
11586
|
+
return item.value === this.activeValue() && !!item.content ? this.panelId(item.value) : null
|
|
11587
|
+
}
|
|
11588
|
+
|
|
11589
|
+
/** The tab-list class list. */
|
|
11500
11590
|
listClasses(): string {
|
|
11501
11591
|
return this.cm().cn(
|
|
11502
11592
|
this.cm().tabsList({ variant: this.variant, size: this.size }),
|
|
@@ -11504,10 +11594,7 @@ export class Tabs implements OnInit {
|
|
|
11504
11594
|
)
|
|
11505
11595
|
}
|
|
11506
11596
|
|
|
11507
|
-
/**
|
|
11508
|
-
* The tab-button class list.
|
|
11509
|
-
* @returns The class string.
|
|
11510
|
-
*/
|
|
11597
|
+
/** The tab-button class list. */
|
|
11511
11598
|
triggerClasses(): string {
|
|
11512
11599
|
return this.cm().cn(
|
|
11513
11600
|
this.cm().tabsTrigger({ variant: this.variant, size: this.size }),
|
|
@@ -11515,82 +11602,51 @@ export class Tabs implements OnInit {
|
|
|
11515
11602
|
)
|
|
11516
11603
|
}
|
|
11517
11604
|
|
|
11518
|
-
/**
|
|
11519
|
-
* The tabpanel class list.
|
|
11520
|
-
* @returns The class string.
|
|
11521
|
-
*/
|
|
11605
|
+
/** The tabpanel class list. */
|
|
11522
11606
|
contentClasses(): string {
|
|
11523
11607
|
return this.cm().tabsContent({ variant: this.variant, size: this.size })
|
|
11524
11608
|
}
|
|
11525
11609
|
|
|
11526
|
-
/**
|
|
11527
|
-
* Serializes the root's inline style.
|
|
11528
|
-
* @returns The style attribute text.
|
|
11529
|
-
*/
|
|
11610
|
+
/** Serializes the root's inline style. */
|
|
11530
11611
|
hostStyle(): string | null {
|
|
11531
11612
|
return styleText(this.style)
|
|
11532
11613
|
}
|
|
11533
11614
|
|
|
11534
|
-
/**
|
|
11535
|
-
* Narrows a node-valued prop to a TemplateRef.
|
|
11536
|
-
*
|
|
11537
|
-
* @param value - The prop value.
|
|
11538
|
-
* @returns The template, or null.
|
|
11539
|
-
*/
|
|
11615
|
+
/** Narrows a node-valued prop to a TemplateRef. */
|
|
11540
11616
|
asTemplate(value: unknown): TemplateRef<unknown> | null {
|
|
11541
11617
|
return value instanceof TemplateRef ? value : null
|
|
11542
11618
|
}
|
|
11543
11619
|
|
|
11544
|
-
/**
|
|
11545
|
-
* A plain-string node value's text.
|
|
11546
|
-
*
|
|
11547
|
-
* @param value - The prop value.
|
|
11548
|
-
* @returns The text, or empty.
|
|
11549
|
-
*/
|
|
11620
|
+
/** A plain-string node value's text. */
|
|
11550
11621
|
nodeText(value: unknown): string {
|
|
11551
11622
|
return typeof value === 'string' ? value : ''
|
|
11552
11623
|
}
|
|
11553
11624
|
|
|
11554
|
-
/**
|
|
11555
|
-
* Whether the active tab has content (React renders no panel without it).
|
|
11556
|
-
* @returns True when content is given.
|
|
11557
|
-
*/
|
|
11625
|
+
/** Whether the active tab has content (React renders no panel without it). */
|
|
11558
11626
|
hasContent(): boolean {
|
|
11559
11627
|
const active = this.items.find((item) => item.value === this.activeValue())
|
|
11560
11628
|
return !!active?.content
|
|
11561
11629
|
}
|
|
11562
11630
|
|
|
11563
|
-
/**
|
|
11564
|
-
* The active tab's content as a template.
|
|
11565
|
-
* @returns The template, or null for a plain string.
|
|
11566
|
-
*/
|
|
11631
|
+
/** The active tab's content as a template. */
|
|
11567
11632
|
activeContent(): TemplateRef<unknown> | null {
|
|
11568
11633
|
const active = this.items.find((item) => item.value === this.activeValue())
|
|
11569
11634
|
return active ? this.asTemplate(active.content) : null
|
|
11570
11635
|
}
|
|
11571
11636
|
|
|
11572
|
-
/**
|
|
11573
|
-
* The active tab's plain-string content.
|
|
11574
|
-
* @returns The text, or empty.
|
|
11575
|
-
*/
|
|
11637
|
+
/** The active tab's plain-string content. */
|
|
11576
11638
|
contentText(): string {
|
|
11577
11639
|
const active = this.items.find((item) => item.value === this.activeValue())
|
|
11578
11640
|
return this.nodeText(active?.content)
|
|
11579
11641
|
}
|
|
11580
11642
|
|
|
11581
|
-
/**
|
|
11582
|
-
* Selects a tab and notifies the caller (React's `selectTab`).
|
|
11583
|
-
* @param tabValue - The tab value.
|
|
11584
|
-
*/
|
|
11643
|
+
/** Selects a tab and notifies the caller (React's `selectTab`). */
|
|
11585
11644
|
selectTab(tabValue: string): void {
|
|
11586
11645
|
if (this.value === undefined) this.internalValue.set(tabValue)
|
|
11587
11646
|
this.change.emit(tabValue)
|
|
11588
11647
|
}
|
|
11589
11648
|
|
|
11590
|
-
/**
|
|
11591
|
-
* The APG keyboard model: Left/Right/Home/End move focus AND selection.
|
|
11592
|
-
* @param event - The key event.
|
|
11593
|
-
*/
|
|
11649
|
+
/** The APG keyboard model: Left/Right/Home/End move focus AND selection. */
|
|
11594
11650
|
handleKeyDown(event: KeyboardEvent): void {
|
|
11595
11651
|
const enabled = this.items.filter((item) => !item.disabled)
|
|
11596
11652
|
if (enabled.length === 0) return
|
|
@@ -11619,10 +11675,7 @@ export class Tabs implements OnInit {
|
|
|
11619
11675
|
this.focusTab(nextValue)
|
|
11620
11676
|
}
|
|
11621
11677
|
|
|
11622
|
-
/**
|
|
11623
|
-
* Moves focus to the tab with the given value (React's `tabRefs.focus()`).
|
|
11624
|
-
* @param value - The tab value.
|
|
11625
|
-
*/
|
|
11678
|
+
/** Moves focus to the tab with the given value (React's `tabRefs.focus()`). */
|
|
11626
11679
|
private focusTab(value: string): void {
|
|
11627
11680
|
const match = this.tabButtons?.find((ref) => ref.nativeElement.id === this.tabId(value))
|
|
11628
11681
|
match?.nativeElement.focus()
|
|
@@ -11630,6 +11683,8 @@ export class Tabs implements OnInit {
|
|
|
11630
11683
|
}
|
|
11631
11684
|
```
|
|
11632
11685
|
|
|
11686
|
+
_(Member comments are shortened to their first sentence to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/tabs.component.d.ts`.)_
|
|
11687
|
+
|
|
11633
11688
|
#### `Textarea`
|
|
11634
11689
|
|
|
11635
11690
|
Textarea component.
|
|
@@ -11742,6 +11797,10 @@ export class Textarea implements AfterViewInit, AfterViewChecked {
|
|
|
11742
11797
|
@ViewChild('textareaEl') textareaEl?: ElementRef<HTMLTextAreaElement>
|
|
11743
11798
|
|
|
11744
11799
|
private readonly host = inject(ElementRef)
|
|
11800
|
+
|
|
11801
|
+
/** Reactive translation, read in the injection context. */
|
|
11802
|
+
private readonly i18n = useTranslation()
|
|
11803
|
+
|
|
11745
11804
|
/** The `aria-describedby` the caller spread onto the host (React's rest). */
|
|
11746
11805
|
private restDescribedBy: string | null = null
|
|
11747
11806
|
/** Whether the rest-describedby value was captured. */
|
|
@@ -11828,6 +11887,13 @@ export class Textarea implements AfterViewInit, AfterViewChecked {
|
|
|
11828
11887
|
|
|
11829
11888
|
/** Re-applies a controlled value and recomputes the autoResize height after every check (React re-runs the value effect whenever `value` changes; running here cov… */
|
|
11830
11889
|
ngAfterViewChecked(): void {
|
|
11890
|
+
// Registering this view against the locale: a switch marks it for check,
|
|
11891
|
+
// so this hook runs and the reapply below moves the caller's re-bound
|
|
11892
|
+
// rest attribute onto the textarea. Without the read, zoneless change
|
|
11893
|
+
// detection never re-checks this view — the parent's re-bound
|
|
11894
|
+
// `[attr.aria-label]` would land on the host and stay there.
|
|
11895
|
+
void this.i18n.locale()
|
|
11896
|
+
reapplyRestAttributes(this.host.nativeElement, this.textareaEl?.nativeElement)
|
|
11831
11897
|
this.applyValue(false)
|
|
11832
11898
|
this.resize()
|
|
11833
11899
|
}
|
|
@@ -12404,6 +12470,7 @@ React's module-level `activeTooltips` map.
|
|
|
12404
12470
|
template: `<div
|
|
12405
12471
|
#triggerWrap
|
|
12406
12472
|
[class]="cm().tooltipTrigger"
|
|
12473
|
+
role="presentation"
|
|
12407
12474
|
(mouseover)="show()"
|
|
12408
12475
|
(mouseout)="scheduleHide()"
|
|
12409
12476
|
(focusin)="handleFocus($event)"
|
|
@@ -13687,6 +13754,8 @@ function formSubmitErrorMessages(error: unknown, fallback: string): string[]
|
|
|
13687
13754
|
|
|
13688
13755
|
#### `getIconSvg(name, className)` _(deprecated)_
|
|
13689
13756
|
|
|
13757
|
+
> **Deprecated:** Used only by the deprecated `Molecule*` spike components.
|
|
13758
|
+
|
|
13690
13759
|
Generates SVG markup string from an icon name.
|
|
13691
13760
|
|
|
13692
13761
|
```typescript
|
|
@@ -13805,8 +13874,9 @@ function resolveIcon(name: IconName, className?: string): ResolvedIcon
|
|
|
13805
13874
|
Moves every rest attribute (`aria-*`, `data-*`, `id`, …) from the host
|
|
13806
13875
|
element onto the element React spreads `{...rest}` onto.
|
|
13807
13876
|
|
|
13808
|
-
|
|
13809
|
-
|
|
13877
|
+
The first move happens at view init; a caller whose rest attributes follow
|
|
13878
|
+
state (an accessible label that switches with the locale) re-moves the
|
|
13879
|
+
re-bound ones with {@link reapplyRestAttributes}.
|
|
13810
13880
|
|
|
13811
13881
|
```typescript
|
|
13812
13882
|
function moveRestAttributes(host: Element, target: Element | undefined | null): string[]
|
|
@@ -13817,6 +13887,35 @@ function moveRestAttributes(host: Element, target: Element | undefined | null):
|
|
|
13817
13887
|
|
|
13818
13888
|
**Returns:** The moved attribute names.
|
|
13819
13889
|
|
|
13890
|
+
#### `reapplyRestAttributes(host, target, options)`
|
|
13891
|
+
|
|
13892
|
+
Moves the rest attributes a caller RE-BOUND since the last move.
|
|
13893
|
+
|
|
13894
|
+
Angular writes a changed `[attr.x]` binding back onto the host after
|
|
13895
|
+
{@link moveRestAttributes} took its first value off it, so without this the
|
|
13896
|
+
inner element keeps the first label forever while the host accumulates the
|
|
13897
|
+
new one. `aria-describedby` is left alone by default: the input family
|
|
13898
|
+
captured the host's value once and merges it with the field context's own
|
|
13899
|
+
target on its inner binding, so re-moving a re-bound value would erase that
|
|
13900
|
+
merge. A component that spreads the attribute onto `...rest` with no merge
|
|
13901
|
+
(Modal) passes {@link ReapplyRestAttributesOptions.includeDescribedBy}.
|
|
13902
|
+
|
|
13903
|
+
Idempotent: a host with nothing re-bound moves nothing.
|
|
13904
|
+
|
|
13905
|
+
```typescript
|
|
13906
|
+
function reapplyRestAttributes(
|
|
13907
|
+
host: Element,
|
|
13908
|
+
target: Element | undefined | null,
|
|
13909
|
+
options?: ReapplyRestAttributesOptions,
|
|
13910
|
+
): string[]
|
|
13911
|
+
```
|
|
13912
|
+
|
|
13913
|
+
- `host` — The component host element.
|
|
13914
|
+
- `target` — The element React's `...rest` targets.
|
|
13915
|
+
- `options` — Whether to move `aria-describedby` too.
|
|
13916
|
+
|
|
13917
|
+
**Returns:** The moved attribute names.
|
|
13918
|
+
|
|
13820
13919
|
#### `kebab(key)`
|
|
13821
13920
|
|
|
13822
13921
|
Converts a camelCase CSS property name to kebab-case.
|
|
@@ -13878,7 +13977,7 @@ Peer dependencies:
|
|
|
13878
13977
|
- `@molecule/app-angular` ^3.4.0
|
|
13879
13978
|
- `@molecule/app-i18n` ^1.0.1
|
|
13880
13979
|
- `@molecule/app-icons` ^1.0.1
|
|
13881
|
-
- `@molecule/app-ui` ^1.
|
|
13980
|
+
- `@molecule/app-ui` ^1.3.10
|
|
13882
13981
|
|
|
13883
13982
|
### Runtime Dependencies
|
|
13884
13983
|
|