@molecule/app-ui-angular 1.5.1 → 1.10.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 +780 -362
- package/dist/components/checkbox.component.d.ts +5 -1
- package/dist/components/checkbox.component.d.ts.map +1 -1
- package/dist/components/checkbox.component.js +14 -3
- package/dist/components/checkbox.component.js.map +1 -1
- package/dist/components/confirm-button.component.d.ts +1 -5
- package/dist/components/confirm-button.component.d.ts.map +1 -1
- package/dist/components/confirm-button.component.js +15 -11
- package/dist/components/confirm-button.component.js.map +1 -1
- package/dist/components/confirm-dialog.component.d.ts +1 -5
- package/dist/components/confirm-dialog.component.d.ts.map +1 -1
- package/dist/components/confirm-dialog.component.js +5 -3
- package/dist/components/confirm-dialog.component.js.map +1 -1
- package/dist/components/dropdown.component.d.ts +3 -11
- package/dist/components/dropdown.component.d.ts.map +1 -1
- package/dist/components/dropdown.component.js +54 -97
- package/dist/components/dropdown.component.js.map +1 -1
- package/dist/components/file-field.component.d.ts +42 -0
- package/dist/components/file-field.component.d.ts.map +1 -0
- package/dist/components/file-field.component.js +121 -0
- package/dist/components/file-field.component.js.map +1 -0
- package/dist/components/floating-input.component.d.ts +21 -3
- package/dist/components/floating-input.component.d.ts.map +1 -1
- package/dist/components/floating-input.component.js +34 -4
- package/dist/components/floating-input.component.js.map +1 -1
- package/dist/components/form.component.d.ts.map +1 -1
- package/dist/components/form.component.js +11 -6
- package/dist/components/form.component.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/input.component.d.ts +18 -2
- package/dist/components/input.component.d.ts.map +1 -1
- package/dist/components/input.component.js +37 -11
- package/dist/components/input.component.js.map +1 -1
- package/dist/components/language-picker.component.d.ts +9 -1
- package/dist/components/language-picker.component.d.ts.map +1 -1
- package/dist/components/language-picker.component.js +15 -8
- package/dist/components/language-picker.component.js.map +1 -1
- package/dist/components/load-error-banner.component.d.ts +21 -3
- package/dist/components/load-error-banner.component.d.ts.map +1 -1
- package/dist/components/load-error-banner.component.js +33 -5
- package/dist/components/load-error-banner.component.js.map +1 -1
- package/dist/components/modal.component.d.ts +27 -48
- package/dist/components/modal.component.d.ts.map +1 -1
- package/dist/components/modal.component.js +85 -184
- package/dist/components/modal.component.js.map +1 -1
- package/dist/components/molecule/input.component.d.ts +7 -0
- package/dist/components/molecule/input.component.d.ts.map +1 -1
- package/dist/components/molecule/input.component.js +13 -5
- package/dist/components/molecule/input.component.js.map +1 -1
- package/dist/components/molecule/select.component.d.ts +7 -0
- package/dist/components/molecule/select.component.d.ts.map +1 -1
- package/dist/components/molecule/select.component.js +13 -5
- package/dist/components/molecule/select.component.js.map +1 -1
- package/dist/components/page-header.component.d.ts.map +1 -1
- package/dist/components/page-header.component.js +22 -21
- package/dist/components/page-header.component.js.map +1 -1
- package/dist/components/prompt-dialog.component.d.ts +6 -30
- package/dist/components/prompt-dialog.component.d.ts.map +1 -1
- package/dist/components/prompt-dialog.component.js +25 -56
- package/dist/components/prompt-dialog.component.js.map +1 -1
- package/dist/components/responsive-app-shell.component.d.ts +16 -34
- package/dist/components/responsive-app-shell.component.d.ts.map +1 -1
- package/dist/components/responsive-app-shell.component.js +58 -141
- package/dist/components/responsive-app-shell.component.js.map +1 -1
- package/dist/components/select.component.d.ts +9 -1
- package/dist/components/select.component.d.ts.map +1 -1
- package/dist/components/select.component.js +16 -7
- package/dist/components/select.component.js.map +1 -1
- package/dist/components/sidebar-user-card.component.d.ts +5 -1
- package/dist/components/sidebar-user-card.component.d.ts.map +1 -1
- package/dist/components/sidebar-user-card.component.js +11 -7
- package/dist/components/sidebar-user-card.component.js.map +1 -1
- package/dist/components/switch.component.d.ts +3 -1
- package/dist/components/switch.component.d.ts.map +1 -1
- package/dist/components/switch.component.js +9 -2
- package/dist/components/switch.component.js.map +1 -1
- package/dist/components/textarea.component.d.ts +15 -9
- package/dist/components/textarea.component.d.ts.map +1 -1
- package/dist/components/textarea.component.js +33 -19
- package/dist/components/textarea.component.js.map +1 -1
- package/dist/components/theme-toggle.component.d.ts +14 -1
- package/dist/components/theme-toggle.component.d.ts.map +1 -1
- package/dist/components/theme-toggle.component.js +27 -6
- package/dist/components/theme-toggle.component.js.map +1 -1
- package/dist/components/toast.component.d.ts +13 -18
- package/dist/components/toast.component.d.ts.map +1 -1
- package/dist/components/toast.component.js +47 -63
- package/dist/components/toast.component.js.map +1 -1
- package/dist/components/tooltip.component.d.ts +17 -2
- package/dist/components/tooltip.component.d.ts.map +1 -1
- package/dist/components/tooltip.component.js +52 -92
- package/dist/components/tooltip.component.js.map +1 -1
- package/dist/components/user-menu-popover.component.d.ts +16 -8
- package/dist/components/user-menu-popover.component.d.ts.map +1 -1
- package/dist/components/user-menu-popover.component.js +40 -48
- package/dist/components/user-menu-popover.component.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/utilities/element-props.d.ts +1 -1
- package/dist/utilities/element-props.d.ts.map +1 -1
- package/dist/utilities/element-props.js +3 -13
- package/dist/utilities/element-props.js.map +1 -1
- package/dist/utilities/element.d.ts +10 -0
- package/dist/utilities/element.d.ts.map +1 -1
- package/dist/utilities/element.js +13 -0
- package/dist/utilities/element.js.map +1 -1
- package/dist/utilities/style.d.ts +6 -16
- package/dist/utilities/style.d.ts.map +1 -1
- package/dist/utilities/style.js +38 -117
- package/dist/utilities/style.js.map +1 -1
- package/dist/web-drag.directive.d.ts +25 -0
- package/dist/web-drag.directive.d.ts.map +1 -0
- package/dist/web-drag.directive.js +43 -0
- package/dist/web-drag.directive.js.map +1 -0
- package/dist/web-hover.directive.d.ts +24 -0
- package/dist/web-hover.directive.d.ts.map +1 -0
- package/dist/web-hover.directive.js +42 -0
- package/dist/web-hover.directive.js.map +1 -0
- package/dist/web-wheel-zoom.directive.d.ts +18 -0
- package/dist/web-wheel-zoom.directive.d.ts.map +1 -0
- package/dist/web-wheel-zoom.directive.js +28 -0
- package/dist/web-wheel-zoom.directive.js.map +1 -0
- package/package.json +13 -5
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-26T04:13:54.192Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-ui-angular
|
|
@@ -71,7 +71,7 @@ class SavePanel {
|
|
|
71
71
|
## Installation
|
|
72
72
|
|
|
73
73
|
```bash
|
|
74
|
-
npm install @molecule/app-ui-angular @angular/common @angular/core @angular/platform-browser @molecule/app-angular @molecule/app-i18n @molecule/app-icons @molecule/app-ui
|
|
74
|
+
npm install @molecule/app-ui-angular @angular/common @angular/core @angular/platform-browser @molecule/app-angular @molecule/app-filesystem @molecule/app-i18n @molecule/app-icons @molecule/app-inline-style-dom @molecule/app-overlay-dom @molecule/app-pointer-events-dom @molecule/app-ui
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
## API
|
|
@@ -91,8 +91,8 @@ interface CSSProperties {
|
|
|
91
91
|
|
|
92
92
|
#### `KitEvent`
|
|
93
93
|
|
|
94
|
-
The event a UI kit hands a component's handler: the members
|
|
95
|
-
passes React's event (so `stopPropagation()` stops React parent handlers), the other kits pass the DOM event;
|
|
94
|
+
The event a web UI kit hands a component's handler: the members shared by the web kits. React's kit
|
|
95
|
+
passes React's event (so `stopPropagation()` stops React parent handlers), the other web kits pass the DOM event;
|
|
96
96
|
both satisfy this type. A handler that needs a member only one of them has (`nativeEvent`, `composedPath()`,
|
|
97
97
|
`isComposing`) takes the component's ref element (see {@link BaseProps}) and listens on it.
|
|
98
98
|
|
|
@@ -238,7 +238,7 @@ interface HTMLElementProps extends BaseProps {
|
|
|
238
238
|
id?: string
|
|
239
239
|
title?: string
|
|
240
240
|
tabIndex?: number
|
|
241
|
-
role?:
|
|
241
|
+
role?: ElementRole
|
|
242
242
|
'aria-label'?: string
|
|
243
243
|
'aria-labelledby'?: string
|
|
244
244
|
'aria-describedby'?: string
|
|
@@ -282,6 +282,7 @@ interface InputElementProps extends HTMLElementProps {
|
|
|
282
282
|
maxLength?: number
|
|
283
283
|
minLength?: number
|
|
284
284
|
pattern?: string
|
|
285
|
+
/** Web change event. Prefer the control's value callback for shared web and native code. */
|
|
285
286
|
onChange?: ChangeEventHandler
|
|
286
287
|
onInput?: FormEventHandler
|
|
287
288
|
}
|
|
@@ -323,6 +324,7 @@ interface TextareaElementProps extends HTMLElementProps {
|
|
|
323
324
|
maxLength?: number
|
|
324
325
|
minLength?: number
|
|
325
326
|
wrap?: 'hard' | 'soft' | 'off'
|
|
327
|
+
/** Web change event. {@link TextareaProps.onValueChange} also works on native. */
|
|
326
328
|
onChange?: ChangeEventHandler
|
|
327
329
|
onInput?: FormEventHandler
|
|
328
330
|
}
|
|
@@ -338,6 +340,7 @@ interface SelectElementProps extends HTMLElementProps {
|
|
|
338
340
|
required?: boolean
|
|
339
341
|
autoFocus?: boolean
|
|
340
342
|
multiple?: boolean
|
|
343
|
+
/** Web change event. {@link SelectProps.onValueChange} also works on native. */
|
|
341
344
|
onChange?: ChangeEventHandler
|
|
342
345
|
}
|
|
343
346
|
```
|
|
@@ -419,7 +422,7 @@ Props for the Input component (text field, email, password, etc.).
|
|
|
419
422
|
Ref element: the native `<input>`.
|
|
420
423
|
|
|
421
424
|
```typescript
|
|
422
|
-
interface InputProps extends InputElementProps {
|
|
425
|
+
interface InputProps extends InputElementProps, Pick<TextFieldProps, 'onValueChange'> {
|
|
423
426
|
/**
|
|
424
427
|
* Input type.
|
|
425
428
|
*/
|
|
@@ -486,7 +489,7 @@ Props for the Textarea component.
|
|
|
486
489
|
Ref element: the native `<textarea>`.
|
|
487
490
|
|
|
488
491
|
```typescript
|
|
489
|
-
interface TextareaProps extends TextareaElementProps {
|
|
492
|
+
interface TextareaProps extends TextareaElementProps, Pick<TextFieldProps, 'onValueChange'> {
|
|
490
493
|
/**
|
|
491
494
|
* Text size tier (see {@link TextareaClassOptions.size}) — pass the same
|
|
492
495
|
* `size` as a neighboring Input for identical font sizes.
|
|
@@ -572,7 +575,7 @@ interface SelectProps<T = string> extends SelectElementProps {
|
|
|
572
575
|
value?: T
|
|
573
576
|
|
|
574
577
|
/**
|
|
575
|
-
*
|
|
578
|
+
* Called with the selected value on web and native.
|
|
576
579
|
*/
|
|
577
580
|
onValueChange?: (value: T) => void
|
|
578
581
|
|
|
@@ -615,7 +618,7 @@ Props for the Checkbox component.
|
|
|
615
618
|
Ref element: the native `<input type="checkbox">`.
|
|
616
619
|
|
|
617
620
|
```typescript
|
|
618
|
-
interface CheckboxProps extends InputElementProps {
|
|
621
|
+
interface CheckboxProps extends InputElementProps, Pick<CheckFieldProps, 'onCheckedChange'> {
|
|
619
622
|
/**
|
|
620
623
|
* Checkbox label.
|
|
621
624
|
*/
|
|
@@ -703,7 +706,7 @@ Props for the Switch/Toggle component.
|
|
|
703
706
|
Ref element: the `role="switch"` button.
|
|
704
707
|
|
|
705
708
|
```typescript
|
|
706
|
-
interface SwitchProps extends InputElementProps {
|
|
709
|
+
interface SwitchProps extends InputElementProps, Pick<CheckFieldProps, 'onCheckedChange'> {
|
|
707
710
|
/**
|
|
708
711
|
* Switch label.
|
|
709
712
|
*/
|
|
@@ -794,6 +797,14 @@ interface ModalProps extends HTMLElementProps {
|
|
|
794
797
|
* @default 'Close'
|
|
795
798
|
*/
|
|
796
799
|
closeLabel?: string
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* The control that takes focus when the modal opens, such as the field a dialog exists to fill.
|
|
803
|
+
* Without it, focus goes to the first focusable control, or to the dialog when it has none. The
|
|
804
|
+
* modal reads it once the open dialog is in the document, so a control rendered in the
|
|
805
|
+
* children can be named here.
|
|
806
|
+
*/
|
|
807
|
+
initialFocus?: OverlayTarget
|
|
797
808
|
}
|
|
798
809
|
```
|
|
799
810
|
|
|
@@ -1775,6 +1786,10 @@ interface LanguagePickerProps {
|
|
|
1775
1786
|
className?: string
|
|
1776
1787
|
/** Inline style object for the trigger button (React camelCase). */
|
|
1777
1788
|
style?: Record<string, unknown>
|
|
1789
|
+
/** `data-testid` for the trigger button. */
|
|
1790
|
+
testId?: string
|
|
1791
|
+
/** `data-mol-id` for the trigger button (React's `automationId`; default `language-picker-trigger`). */
|
|
1792
|
+
automationId?: string
|
|
1778
1793
|
/** Optional trigger replacement (a node value rendered as a template). */
|
|
1779
1794
|
renderTrigger?: TemplateRef<unknown>
|
|
1780
1795
|
}
|
|
@@ -1800,6 +1815,10 @@ interface LoadErrorBannerProps {
|
|
|
1800
1815
|
retryMolId?: string
|
|
1801
1816
|
/** Extra classes for the root (React's rest `className`). */
|
|
1802
1817
|
className?: string
|
|
1818
|
+
/** `data-testid` for the root. */
|
|
1819
|
+
testId?: string
|
|
1820
|
+
/** `data-mol-id` for the root (React's `automationId`). */
|
|
1821
|
+
automationId?: string
|
|
1803
1822
|
}
|
|
1804
1823
|
```
|
|
1805
1824
|
|
|
@@ -2146,6 +2165,8 @@ interface SidebarUserCardProps {
|
|
|
2146
2165
|
dataMolId?: string
|
|
2147
2166
|
/** Extra classes for the trigger. */
|
|
2148
2167
|
className?: string
|
|
2168
|
+
/** `data-testid` for the trigger. */
|
|
2169
|
+
testId?: string
|
|
2149
2170
|
}
|
|
2150
2171
|
```
|
|
2151
2172
|
|
|
@@ -2169,6 +2190,10 @@ interface ThemeToggleProps {
|
|
|
2169
2190
|
iconSize?: number
|
|
2170
2191
|
/** Extra classes joined onto the toggle classes. */
|
|
2171
2192
|
className?: string
|
|
2193
|
+
/** `data-testid` for the button. */
|
|
2194
|
+
testId?: string
|
|
2195
|
+
/** `data-mol-id` automation id (React's `automationId`; default `theme-toggle`). */
|
|
2196
|
+
automationId?: string
|
|
2172
2197
|
}
|
|
2173
2198
|
```
|
|
2174
2199
|
|
|
@@ -4247,6 +4272,8 @@ export class Checkbox implements AfterViewChecked, HasElement<HTMLInputElement>
|
|
|
4247
4272
|
|
|
4248
4273
|
/** The genuine native `change` event. */
|
|
4249
4274
|
@Output() readonly change = new EventEmitter<Event>()
|
|
4275
|
+
/** Fires with the new checked state. */
|
|
4276
|
+
@Output() readonly checkedChange = new EventEmitter<boolean>()
|
|
4250
4277
|
|
|
4251
4278
|
/** The native input (React's `...rest` spread target). */
|
|
4252
4279
|
private input?: ElementRef<HTMLInputElement>
|
|
@@ -4284,10 +4311,7 @@ export class Checkbox implements AfterViewChecked, HasElement<HTMLInputElement>
|
|
|
4284
4311
|
})
|
|
4285
4312
|
}
|
|
4286
4313
|
|
|
4287
|
-
/**
|
|
4288
|
-
* The current class map.
|
|
4289
|
-
* @returns The UIClassMap.
|
|
4290
|
-
*/
|
|
4314
|
+
/** The current class map. */
|
|
4291
4315
|
cm(): UIClassMap {
|
|
4292
4316
|
return getClassMap()
|
|
4293
4317
|
}
|
|
@@ -4316,10 +4340,7 @@ export class Checkbox implements AfterViewChecked, HasElement<HTMLInputElement>
|
|
|
4316
4340
|
)
|
|
4317
4341
|
}
|
|
4318
4342
|
|
|
4319
|
-
/**
|
|
4320
|
-
* Computes the checkbox class list.
|
|
4321
|
-
* @returns The class string.
|
|
4322
|
-
*/
|
|
4343
|
+
/** Computes the checkbox class list. */
|
|
4323
4344
|
classes(): string {
|
|
4324
4345
|
return this.cm().cn(this.cm().checkbox({ error: !!this.error }), this.className)
|
|
4325
4346
|
}
|
|
@@ -4334,26 +4355,29 @@ export class Checkbox implements AfterViewChecked, HasElement<HTMLInputElement>
|
|
|
4334
4355
|
return this.automationId ?? this.dataMolId ?? this.externalMolId
|
|
4335
4356
|
}
|
|
4336
4357
|
|
|
4337
|
-
/** React's checkbox `onChange` fires on the checkbox's CLICK event (React's change-event plugin maps checkbox/radio changes to the click), so the click event obje… */
|
|
4338
4358
|
handleClick(event: MouseEvent): void {
|
|
4339
4359
|
this.onClick?.(event)
|
|
4340
4360
|
this.justClicked = true
|
|
4341
|
-
this.
|
|
4361
|
+
this.emitChange(event)
|
|
4342
4362
|
queueMicrotask(() => (this.justClicked = false))
|
|
4343
4363
|
}
|
|
4344
4364
|
|
|
4345
|
-
/** A native change that did not come from this tick's click (a synthetic `dispatchEvent`) is forwarded like React would; the event never reaches the host, where t… */
|
|
4346
4365
|
handleChange(event: Event): void {
|
|
4347
4366
|
event.stopPropagation()
|
|
4348
|
-
if (!this.justClicked) this.
|
|
4367
|
+
if (!this.justClicked) this.emitChange(event)
|
|
4349
4368
|
if (this.checked !== undefined && this.input) this.input.nativeElement.checked = !!this.checked
|
|
4350
4369
|
}
|
|
4351
4370
|
|
|
4352
4371
|
private justClicked = false
|
|
4353
4372
|
|
|
4354
|
-
/**
|
|
4355
|
-
|
|
4356
|
-
|
|
4373
|
+
/** Reports the checkbox change and its new checked state. */
|
|
4374
|
+
private emitChange(event: Event): void {
|
|
4375
|
+
const next = this.input?.nativeElement.checked
|
|
4376
|
+
this.change.emit(event)
|
|
4377
|
+
if (next !== undefined) this.checkedChange.emit(next)
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4380
|
+
/** Applies the indeterminate DOM flag (a property, not an attribute). */
|
|
4357
4381
|
ngAfterViewChecked(): void {
|
|
4358
4382
|
const input = this.input?.nativeElement
|
|
4359
4383
|
if (input) {
|
|
@@ -4379,7 +4403,7 @@ export class Checkbox implements AfterViewChecked, HasElement<HTMLInputElement>
|
|
|
4379
4403
|
}
|
|
4380
4404
|
```
|
|
4381
4405
|
|
|
4382
|
-
_(
|
|
4406
|
+
_(Member comments are shortened to their first sentence, and the 2 longest are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/checkbox.component.d.ts`.)_
|
|
4383
4407
|
|
|
4384
4408
|
#### `ConfirmButton`
|
|
4385
4409
|
|
|
@@ -4419,7 +4443,6 @@ renders instead (React's `confirmLabel ?? t(…)`).
|
|
|
4419
4443
|
host: {
|
|
4420
4444
|
'[attr.type]': '"button"',
|
|
4421
4445
|
'(click)': 'handleClick()',
|
|
4422
|
-
'(document:keydown.escape)': 'handleEscape()',
|
|
4423
4446
|
'[disabled]': 'disabled || phase() === "pending"',
|
|
4424
4447
|
'[attr.aria-live]': '"polite"',
|
|
4425
4448
|
'[attr.data-state]': 'phase()',
|
|
@@ -4492,9 +4515,7 @@ export class ConfirmButton implements OnDestroy, HasElement<HTMLButtonElement> {
|
|
|
4492
4515
|
/** The pending-state label capture span. */
|
|
4493
4516
|
@ViewChild('pendingSlot') pendingSlot?: ElementRef<HTMLSpanElement>
|
|
4494
4517
|
|
|
4495
|
-
/** Whether the armed label slot carries content (a signal the template reads). */
|
|
4496
4518
|
readonly hasConfirmLabel = signal(false)
|
|
4497
|
-
/** Whether the pending label slot carries content (a signal the template reads). */
|
|
4498
4519
|
readonly hasPendingLabel = signal(false)
|
|
4499
4520
|
|
|
4500
4521
|
/** The current phase: idle → armed → pending → idle. */
|
|
@@ -4504,6 +4525,7 @@ export class ConfirmButton implements OnDestroy, HasElement<HTMLButtonElement> {
|
|
|
4504
4525
|
/** The element a caller's ref receives: the host `<button>`. */
|
|
4505
4526
|
readonly element = hostElement(this.el)
|
|
4506
4527
|
private disarmTimer: ReturnType<typeof setTimeout> | null = null
|
|
4528
|
+
private readonly layer = new OverlayLayer()
|
|
4507
4529
|
|
|
4508
4530
|
constructor() {
|
|
4509
4531
|
usePlacement((hasContent) => this.syncLabels(hasContent))
|
|
@@ -4513,7 +4535,17 @@ export class ConfirmButton implements OnDestroy, HasElement<HTMLButtonElement> {
|
|
|
4513
4535
|
this.disarmTimer = null
|
|
4514
4536
|
}
|
|
4515
4537
|
const disarmSeconds = this.disarmSeconds ?? 4
|
|
4516
|
-
|
|
4538
|
+
const armed = this.phase() === 'armed'
|
|
4539
|
+
const target = { current: this.el.nativeElement }
|
|
4540
|
+
this.layer.sync({
|
|
4541
|
+
open: armed,
|
|
4542
|
+
kind: 'popover',
|
|
4543
|
+
surface: target,
|
|
4544
|
+
anchor: target,
|
|
4545
|
+
dismissKey: true,
|
|
4546
|
+
onDismiss: () => this.disarm(),
|
|
4547
|
+
})
|
|
4548
|
+
if (armed && disarmSeconds > 0) {
|
|
4517
4549
|
this.disarmTimer = setTimeout(() => {
|
|
4518
4550
|
this.disarmTimer = null
|
|
4519
4551
|
this.phase.set('idle')
|
|
@@ -4574,10 +4606,6 @@ export class ConfirmButton implements OnDestroy, HasElement<HTMLButtonElement> {
|
|
|
4574
4606
|
}
|
|
4575
4607
|
}
|
|
4576
4608
|
|
|
4577
|
-
private handleEscape(): void {
|
|
4578
|
-
if (this.phase() === 'armed') this.disarm()
|
|
4579
|
-
}
|
|
4580
|
-
|
|
4581
4609
|
/** React's `disarm`: cancels the timer and returns to idle. */
|
|
4582
4610
|
private disarm(): void {
|
|
4583
4611
|
if (this.disarmTimer) {
|
|
@@ -4618,12 +4646,13 @@ export class ConfirmButton implements OnDestroy, HasElement<HTMLButtonElement> {
|
|
|
4618
4646
|
|
|
4619
4647
|
/** Clears the auto-disarm timer (React's unmount cleanup). */
|
|
4620
4648
|
ngOnDestroy(): void {
|
|
4649
|
+
this.layer.release()
|
|
4621
4650
|
if (this.disarmTimer) clearTimeout(this.disarmTimer)
|
|
4622
4651
|
}
|
|
4623
4652
|
}
|
|
4624
4653
|
```
|
|
4625
4654
|
|
|
4626
|
-
_(Member comments are shortened to their first sentence, and the
|
|
4655
|
+
_(Member comments are shortened to their first sentence, and the 7 longest are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/confirm-button.component.d.ts`.)_
|
|
4627
4656
|
|
|
4628
4657
|
#### `ConfirmDialog`
|
|
4629
4658
|
|
|
@@ -4781,6 +4810,7 @@ export class ConfirmDialog {
|
|
|
4781
4810
|
@ViewChild('modal', { read: ElementRef }) modalElement?: ElementRef<HTMLElement>
|
|
4782
4811
|
|
|
4783
4812
|
private readonly host: ElementRef<HTMLElement> = inject(ElementRef)
|
|
4813
|
+
private readonly browser = isPlatformBrowser(inject(PLATFORM_ID))
|
|
4784
4814
|
|
|
4785
4815
|
/**
|
|
4786
4816
|
* Recomputes {@link ariaLabelledBy} and {@link ariaDescribedBy} from the
|
|
@@ -4798,7 +4828,7 @@ export class ConfirmDialog {
|
|
|
4798
4828
|
? this.descriptionId
|
|
4799
4829
|
: null,
|
|
4800
4830
|
)
|
|
4801
|
-
setElementPresent(this.host.nativeElement,
|
|
4831
|
+
setElementPresent(this.host.nativeElement, !this.browser && this.open)
|
|
4802
4832
|
setHostRoot(this.host.nativeElement, this.modalElement?.nativeElement)
|
|
4803
4833
|
})
|
|
4804
4834
|
}
|
|
@@ -4945,10 +4975,12 @@ export class Dropdown implements AfterViewInit, DoCheck, OnDestroy, HasElement<H
|
|
|
4945
4975
|
private readonly inner = signal<HTMLDivElement | null>(null)
|
|
4946
4976
|
readonly element = this.inner.asReadonly()
|
|
4947
4977
|
private readonly renderer = inject(Renderer2)
|
|
4978
|
+
private readonly layer = new OverlayLayer()
|
|
4979
|
+
private readonly browser = isPlatformBrowser(inject(PLATFORM_ID))
|
|
4948
4980
|
private readonly cdr = inject(ChangeDetectorRef)
|
|
4949
4981
|
private readonly injector = inject(Injector)
|
|
4950
4982
|
private readonly host: HTMLElement = this.el.nativeElement
|
|
4951
|
-
private triggerEl: HTMLElement | null = null
|
|
4983
|
+
private triggerEl: HTMLElement | SVGElement | null = null
|
|
4952
4984
|
private triggerOwnTestId: string | null = null
|
|
4953
4985
|
private triggerOwnMolId: string | null = null
|
|
4954
4986
|
private triggerOwnDisabled = false
|
|
@@ -4961,7 +4993,7 @@ export class Dropdown implements AfterViewInit, DoCheck, OnDestroy, HasElement<H
|
|
|
4961
4993
|
private lastPlacement: DropdownPlacement = 'bottom-start'
|
|
4962
4994
|
private lastAlign: DropdownAlign = 'start'
|
|
4963
4995
|
private menuWidth: number | string | undefined
|
|
4964
|
-
private
|
|
4996
|
+
private cancelPosition?: () => void
|
|
4965
4997
|
private lastRoute: string | null = null
|
|
4966
4998
|
private pendingOpenFocus: 'first' | 'last' = 'first'
|
|
4967
4999
|
private focusedItemEl: HTMLElement | null = null
|
|
@@ -5086,7 +5118,7 @@ export class Dropdown implements AfterViewInit, DoCheck, OnDestroy, HasElement<H
|
|
|
5086
5118
|
if (!this.isOpen()) this.pendingOpenFocus = 'first'
|
|
5087
5119
|
this.setOpen(!this.isOpen())
|
|
5088
5120
|
}
|
|
5089
|
-
// … truncated —
|
|
5121
|
+
// … truncated — 22 more members: handleTriggerKeyDown, handleClose, closeAndRefocusTrigger, ngAfterViewInit, ngDoCheck, ngOnDestroy, placeTrigger, adopt, release, focusableIndexes, itemElements, elementForIndex, focusActive, constructor, restoreItemFocus, syncMenu, openMenu, destroyMenu, updateMenuWidth, schedulePosition, updatePosition, syncTrigger; the full declaration is in node_modules/@molecule/app-ui-angular/dist/components/dropdown.component.d.ts
|
|
5090
5122
|
```
|
|
5091
5123
|
|
|
5092
5124
|
_(Member comments are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/dropdown.component.d.ts`.)_
|
|
@@ -5296,6 +5328,82 @@ export class EmptyState implements HasElement<HTMLDivElement> {
|
|
|
5296
5328
|
}
|
|
5297
5329
|
```
|
|
5298
5330
|
|
|
5331
|
+
#### `FileField`
|
|
5332
|
+
|
|
5333
|
+
Renders one focusable target and emits portable file selections.
|
|
5334
|
+
|
|
5335
|
+
```typescript
|
|
5336
|
+
@Component({
|
|
5337
|
+
selector: 'div[mol-file-field]',
|
|
5338
|
+
standalone: true,
|
|
5339
|
+
host: {
|
|
5340
|
+
'data-mol-id': 'file-field',
|
|
5341
|
+
'[attr.role]': 'role ?? "button"',
|
|
5342
|
+
'[class]': 'className',
|
|
5343
|
+
'[attr.tabindex]': 'disabled ? -1 : 0',
|
|
5344
|
+
'[attr.aria-disabled]': 'disabled ?? null',
|
|
5345
|
+
'(click)': 'handlers.onClick($event)',
|
|
5346
|
+
'(keydown)': 'handlers.onKeyDown($event)',
|
|
5347
|
+
'(dragover)': 'onDragOver($event)',
|
|
5348
|
+
'(drop)': 'handlers.onDrop($event)',
|
|
5349
|
+
},
|
|
5350
|
+
template: `<input
|
|
5351
|
+
#fileInput
|
|
5352
|
+
type="file"
|
|
5353
|
+
hidden
|
|
5354
|
+
[attr.accept]="accept ?? null"
|
|
5355
|
+
[multiple]="multiple"
|
|
5356
|
+
[disabled]="disabled ?? false"
|
|
5357
|
+
(change)="handlers.onChange()"
|
|
5358
|
+
/><ng-content />`,
|
|
5359
|
+
})
|
|
5360
|
+
export class FileField {
|
|
5361
|
+
/** Comma-separated accepted types and extensions. */
|
|
5362
|
+
@Input() accept?: string
|
|
5363
|
+
/** ClassMap classes for the host. */
|
|
5364
|
+
@Input() className?: string
|
|
5365
|
+
/** Prevents picking and delivering files. */
|
|
5366
|
+
@Input() disabled?: boolean
|
|
5367
|
+
/** Inclusive per-file limit in bytes. */
|
|
5368
|
+
@Input() maxSize?: number
|
|
5369
|
+
/** Delivers all accepted files in selection order. */
|
|
5370
|
+
@Input({ transform: booleanAttribute }) multiple = false
|
|
5371
|
+
/** Optional accessibility role for the host. */
|
|
5372
|
+
@Input() role?: FileFieldProps['role']
|
|
5373
|
+
/** The accepted files. */
|
|
5374
|
+
@Output() readonly valueChange = new EventEmitter<readonly PickedFile[]>()
|
|
5375
|
+
/** The files rejected by type or size. */
|
|
5376
|
+
@Output() readonly rejected = new EventEmitter<readonly PickedFile[]>()
|
|
5377
|
+
/** A failure opening or reading the chooser. */
|
|
5378
|
+
@Output() readonly pickError = new EventEmitter<Error>()
|
|
5379
|
+
|
|
5380
|
+
@ViewChild('fileInput') private fileInput?: ElementRef<HTMLInputElement>
|
|
5381
|
+
|
|
5382
|
+
/** Shared DOM event handlers for this host and its input. */
|
|
5383
|
+
protected readonly handlers = createBrowserFileInput(
|
|
5384
|
+
() => this.fileInput?.nativeElement,
|
|
5385
|
+
() => ({
|
|
5386
|
+
accept: this.accept,
|
|
5387
|
+
disabled: this.disabled,
|
|
5388
|
+
maxSize: this.maxSize,
|
|
5389
|
+
multiple: this.multiple,
|
|
5390
|
+
onFiles: (files) => this.valueChange.emit(files),
|
|
5391
|
+
onRejected: (files) => this.rejected.emit(files),
|
|
5392
|
+
onPickError: (error) => this.pickError.emit(error),
|
|
5393
|
+
}),
|
|
5394
|
+
fromBrowserFile,
|
|
5395
|
+
)
|
|
5396
|
+
|
|
5397
|
+
/**
|
|
5398
|
+
* Enables dropping on the host when the field is enabled.
|
|
5399
|
+
* @param event - The native drag event.
|
|
5400
|
+
*/
|
|
5401
|
+
protected onDragOver(event: DragEvent): void {
|
|
5402
|
+
this.handlers.onDragOver(event)
|
|
5403
|
+
}
|
|
5404
|
+
}
|
|
5405
|
+
```
|
|
5406
|
+
|
|
5299
5407
|
#### `FloatingInput`
|
|
5300
5408
|
|
|
5301
5409
|
FloatingInput component.
|
|
@@ -5315,6 +5423,8 @@ uncontrolled (internal state seeded from `defaultValue`).
|
|
|
5315
5423
|
'value',
|
|
5316
5424
|
'defaultValue',
|
|
5317
5425
|
'id',
|
|
5426
|
+
'automationId',
|
|
5427
|
+
'dataMolId: data-mol-id',
|
|
5318
5428
|
'onFocus',
|
|
5319
5429
|
'onBlur',
|
|
5320
5430
|
'onKeyDown',
|
|
@@ -5327,6 +5437,7 @@ uncontrolled (internal state seeded from `defaultValue`).
|
|
|
5327
5437
|
[attr.placeholder]="placeholder"
|
|
5328
5438
|
[class]="classes()"
|
|
5329
5439
|
[attr.value]="currentValue()"
|
|
5440
|
+
[attr.data-mol-id]="molId()"
|
|
5330
5441
|
(input)="handleInput($event)"
|
|
5331
5442
|
(change)="stopPropagation($event)"
|
|
5332
5443
|
(focusin)="onFocus?.($event)"
|
|
@@ -5338,7 +5449,9 @@ uncontrolled (internal state seeded from `defaultValue`).
|
|
|
5338
5449
|
<label [attr.for]="inputId()" [class]="cm().floatingLabel">{{ placeholder }}</label>
|
|
5339
5450
|
}`,
|
|
5340
5451
|
})
|
|
5341
|
-
export class FloatingInput
|
|
5452
|
+
export class FloatingInput
|
|
5453
|
+
implements OnInit, AfterViewInit, AfterViewChecked, HasElement<HTMLInputElement>
|
|
5454
|
+
{
|
|
5342
5455
|
/** Placeholder text, also rendered as the floating label. */
|
|
5343
5456
|
placeholder?: string
|
|
5344
5457
|
/** Extra classes joined onto the input classes. */
|
|
@@ -5349,6 +5462,10 @@ export class FloatingInput implements OnInit, AfterViewInit, HasElement<HTMLInpu
|
|
|
5349
5462
|
defaultValue?: string
|
|
5350
5463
|
/** Explicit input id. */
|
|
5351
5464
|
id?: string
|
|
5465
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
5466
|
+
automationId?: string
|
|
5467
|
+
/** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
|
|
5468
|
+
dataMolId?: string
|
|
5352
5469
|
|
|
5353
5470
|
/** React's `onFocus`, which React spreads onto the <input>: its `currentTarget` is that element. */
|
|
5354
5471
|
onFocus?: FocusEventHandler
|
|
@@ -5377,6 +5494,8 @@ export class FloatingInput implements OnInit, AfterViewInit, HasElement<HTMLInpu
|
|
|
5377
5494
|
/** The per-instance id used when the caller gives none (React's `useId`). */
|
|
5378
5495
|
private readonly generatedId = nextInstanceId()
|
|
5379
5496
|
private internalValue = ''
|
|
5497
|
+
/** The `data-mol-id` a caller bound on the host (React spreads it onto the input). */
|
|
5498
|
+
private externalMolId: string | undefined
|
|
5380
5499
|
|
|
5381
5500
|
/**
|
|
5382
5501
|
* The current class map.
|
|
@@ -5395,6 +5514,14 @@ export class FloatingInput implements OnInit, AfterViewInit, HasElement<HTMLInpu
|
|
|
5395
5514
|
return this.id || this.generatedId
|
|
5396
5515
|
}
|
|
5397
5516
|
|
|
5517
|
+
/**
|
|
5518
|
+
* The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
|
|
5519
|
+
* @returns The attribute value.
|
|
5520
|
+
*/
|
|
5521
|
+
molId(): string | undefined {
|
|
5522
|
+
return this.automationId ?? this.dataMolId ?? this.externalMolId
|
|
5523
|
+
}
|
|
5524
|
+
|
|
5398
5525
|
/**
|
|
5399
5526
|
* Computes the input class list.
|
|
5400
5527
|
* @returns The class string.
|
|
@@ -5453,8 +5580,29 @@ export class FloatingInput implements OnInit, AfterViewInit, HasElement<HTMLInpu
|
|
|
5453
5580
|
* spread puts them.
|
|
5454
5581
|
*/
|
|
5455
5582
|
ngAfterViewInit(): void {
|
|
5583
|
+
this.adoptHostMolId()
|
|
5456
5584
|
moveRestAttributes(this.host.nativeElement, this.inputEl?.nativeElement)
|
|
5457
5585
|
}
|
|
5586
|
+
|
|
5587
|
+
/**
|
|
5588
|
+
* Puts a `data-mol-id` bound on the host onto the input in the pass that bound it (the host
|
|
5589
|
+
* attribute is written after this component's view is checked).
|
|
5590
|
+
*/
|
|
5591
|
+
ngAfterViewChecked(): void {
|
|
5592
|
+
this.adoptHostMolId()
|
|
5593
|
+
}
|
|
5594
|
+
|
|
5595
|
+
/** Takes a `data-mol-id` off the host and keeps it for the input's binding. */
|
|
5596
|
+
private adoptHostMolId(): void {
|
|
5597
|
+
adoptHostDataMolId(
|
|
5598
|
+
this.host.nativeElement,
|
|
5599
|
+
this.inputEl?.nativeElement,
|
|
5600
|
+
(id) => {
|
|
5601
|
+
this.externalMolId = id
|
|
5602
|
+
},
|
|
5603
|
+
() => this.molId(),
|
|
5604
|
+
)
|
|
5605
|
+
}
|
|
5458
5606
|
}
|
|
5459
5607
|
```
|
|
5460
5608
|
|
|
@@ -5907,11 +6055,18 @@ export class Form implements HasElement<HTMLFormElement> {
|
|
|
5907
6055
|
const form = event.currentTarget instanceof HTMLFormElement ? event.currentTarget : null
|
|
5908
6056
|
if (this.onFormSubmit) {
|
|
5909
6057
|
event.preventDefault()
|
|
5910
|
-
const
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
6058
|
+
const entries = Array.from(new FormData(form ?? undefined))
|
|
6059
|
+
// `Object.fromEntries` defines every name as an own key: a repeated name
|
|
6060
|
+
// keeps its last value, and `__proto__` stays an ordinary field instead
|
|
6061
|
+
// of replacing the object's prototype.
|
|
6062
|
+
const data: Record<string, unknown> = Object.fromEntries(entries)
|
|
6063
|
+
// React reads `process.env.NODE_ENV`; Angular's CLI defines no such
|
|
6064
|
+
// global, and `isDevMode()` is false in its optimized (production) builds.
|
|
6065
|
+
if (isDevMode() && Object.keys(data).length < entries.length) {
|
|
6066
|
+
console.error(
|
|
6067
|
+
"Form.onFormSubmit received repeated field names and keeps only their last values. Use the form's onSubmit handler for repeated entries.",
|
|
6068
|
+
)
|
|
6069
|
+
}
|
|
5915
6070
|
call(() => this.onFormSubmit?.(data))
|
|
5916
6071
|
}
|
|
5917
6072
|
call(() => this.onSubmit?.(event))
|
|
@@ -6108,7 +6263,8 @@ export class Icon implements OnChanges {
|
|
|
6108
6263
|
|
|
6109
6264
|
Input component.
|
|
6110
6265
|
|
|
6111
|
-
The host is the
|
|
6266
|
+
The host is the field's outer wrapper React renders (the shared field layout's
|
|
6267
|
+
`root`, a flex column). React's text-input
|
|
6112
6268
|
`onChange` fires on `input` events; a controlled `value` is restored after
|
|
6113
6269
|
user input exactly like React's controlled-input state restore.
|
|
6114
6270
|
|
|
@@ -6151,7 +6307,7 @@ DOM whenever React would render nothing (`setElementPresent`).
|
|
|
6151
6307
|
'onKeyDown',
|
|
6152
6308
|
],
|
|
6153
6309
|
host: {
|
|
6154
|
-
'[class]': '
|
|
6310
|
+
'[class]': 'field().root',
|
|
6155
6311
|
},
|
|
6156
6312
|
template: `@if (label) {
|
|
6157
6313
|
<label
|
|
@@ -6160,7 +6316,7 @@ DOM whenever React would render nothing (`setElementPresent`).
|
|
|
6160
6316
|
>{{ label }}</label
|
|
6161
6317
|
>
|
|
6162
6318
|
}
|
|
6163
|
-
<div [class]="
|
|
6319
|
+
<div [class]="field().inner">
|
|
6164
6320
|
<div [class]="cm().inputLeftElement" #leftSlot>
|
|
6165
6321
|
<ng-content select="[slot=leftElement]"></ng-content>
|
|
6166
6322
|
@if (asTemplate(leftElement); as tpl) {
|
|
@@ -6194,7 +6350,8 @@ DOM whenever React would render nothing (`setElementPresent`).
|
|
|
6194
6350
|
@if (clearable && value) {
|
|
6195
6351
|
<button
|
|
6196
6352
|
type="button"
|
|
6197
|
-
|
|
6353
|
+
[disabled]="disabled"
|
|
6354
|
+
(click)="handleClear($event)"
|
|
6198
6355
|
[class]="cm().inputClearButton"
|
|
6199
6356
|
[attr.aria-label]="clearText()"
|
|
6200
6357
|
>
|
|
@@ -6247,6 +6404,7 @@ export class Input implements AfterViewChecked, HasElement<HTMLInputElement> {
|
|
|
6247
6404
|
onKeyDown?: KeyboardEventHandler
|
|
6248
6405
|
|
|
6249
6406
|
@Output() readonly change = new EventEmitter<Event>()
|
|
6407
|
+
@Output() readonly valueChange = new EventEmitter<string>()
|
|
6250
6408
|
@Output() readonly clear = new EventEmitter<Event>()
|
|
6251
6409
|
|
|
6252
6410
|
inputEl?: ElementRef<HTMLInputElement>
|
|
@@ -6283,6 +6441,10 @@ export class Input implements AfterViewChecked, HasElement<HTMLInputElement> {
|
|
|
6283
6441
|
return getClassMap()
|
|
6284
6442
|
}
|
|
6285
6443
|
|
|
6444
|
+
field(): ReturnType<typeof fieldLayout> {
|
|
6445
|
+
return fieldLayout(this.cm())
|
|
6446
|
+
}
|
|
6447
|
+
|
|
6286
6448
|
inputId(): string {
|
|
6287
6449
|
return this.id || this.fieldContext()?.id || this.name || this.generatedId
|
|
6288
6450
|
}
|
|
@@ -6336,10 +6498,16 @@ export class Input implements AfterViewChecked, HasElement<HTMLInputElement> {
|
|
|
6336
6498
|
event.stopPropagation()
|
|
6337
6499
|
this.change.emit(event)
|
|
6338
6500
|
const input = this.inputEl?.nativeElement
|
|
6501
|
+
if (input) this.valueChange.emit(input.value)
|
|
6339
6502
|
if (this.value !== undefined && input && input.value !== String(this.value))
|
|
6340
6503
|
input.value = String(this.value)
|
|
6341
6504
|
}
|
|
6342
6505
|
|
|
6506
|
+
handleClear(event: MouseEvent): void {
|
|
6507
|
+
this.clear.emit(event)
|
|
6508
|
+
this.valueChange.emit('')
|
|
6509
|
+
}
|
|
6510
|
+
|
|
6343
6511
|
handleChange(event: Event): void {
|
|
6344
6512
|
event.stopPropagation()
|
|
6345
6513
|
}
|
|
@@ -6451,6 +6619,8 @@ button in React; here they land on the host and are moved onto it.
|
|
|
6451
6619
|
'display',
|
|
6452
6620
|
'className',
|
|
6453
6621
|
'style',
|
|
6622
|
+
'testId',
|
|
6623
|
+
'automationId',
|
|
6454
6624
|
'renderTrigger',
|
|
6455
6625
|
],
|
|
6456
6626
|
template: `@if (asTemplate(renderTrigger); as customTrigger) {
|
|
@@ -6462,7 +6632,8 @@ button in React; here they land on the host and are moved onto it.
|
|
|
6462
6632
|
<button
|
|
6463
6633
|
#trigger
|
|
6464
6634
|
type="button"
|
|
6465
|
-
data-mol-id="language-picker-trigger"
|
|
6635
|
+
[attr.data-mol-id]="automationId ?? 'language-picker-trigger'"
|
|
6636
|
+
[attr.data-testid]="testId"
|
|
6466
6637
|
[attr.aria-label]="ariaLabel()"
|
|
6467
6638
|
(click)="open()"
|
|
6468
6639
|
[class]="classes()"
|
|
@@ -6515,6 +6686,10 @@ export class LanguagePicker {
|
|
|
6515
6686
|
className?: LanguagePickerProps['className']
|
|
6516
6687
|
/** Inline style object for the trigger button (React camelCase). */
|
|
6517
6688
|
style?: LanguagePickerProps['style']
|
|
6689
|
+
/** `data-testid` for the trigger button. */
|
|
6690
|
+
testId?: LanguagePickerProps['testId']
|
|
6691
|
+
/** `data-mol-id` for the trigger button (React's `automationId`). */
|
|
6692
|
+
automationId?: LanguagePickerProps['automationId']
|
|
6518
6693
|
/** Optional trigger replacement (a node value rendered as a template). */
|
|
6519
6694
|
renderTrigger?: LanguagePickerProps['renderTrigger']
|
|
6520
6695
|
|
|
@@ -7137,9 +7312,10 @@ paragraph and the retry row render only when React would render them.
|
|
|
7137
7312
|
standalone: true,
|
|
7138
7313
|
hostDirectives: [MolPlacement],
|
|
7139
7314
|
imports: [Alert, MolTemplateOutlet],
|
|
7140
|
-
inputs: ['message', 'detail', 'retryLabel', 'retryMolId', 'onRetry'],
|
|
7315
|
+
inputs: ['message', 'detail', 'retryLabel', 'retryMolId', 'onRetry', 'testId', 'automationId'],
|
|
7141
7316
|
host: {
|
|
7142
7317
|
'[class]': 'className',
|
|
7318
|
+
'[attr.data-testid]': 'testId',
|
|
7143
7319
|
},
|
|
7144
7320
|
template: `<div mol-alert [status]="'error'" [live]="false">
|
|
7145
7321
|
<div [class]="cm().stack(2)">
|
|
@@ -7173,7 +7349,7 @@ paragraph and the retry row render only when React would render them.
|
|
|
7173
7349
|
</div>
|
|
7174
7350
|
</div>`,
|
|
7175
7351
|
})
|
|
7176
|
-
export class LoadErrorBanner {
|
|
7352
|
+
export class LoadErrorBanner implements AfterViewChecked {
|
|
7177
7353
|
/** The primary error line (node-valued prop). */
|
|
7178
7354
|
message?: LoadErrorBannerProps['message']
|
|
7179
7355
|
/** Secondary line under the message (node-valued prop). */
|
|
@@ -7186,6 +7362,10 @@ export class LoadErrorBanner {
|
|
|
7186
7362
|
onRetry?: LoadErrorBannerProps['onRetry']
|
|
7187
7363
|
/** Extra classes for the root (React's rest `className`). */
|
|
7188
7364
|
className?: LoadErrorBannerProps['className']
|
|
7365
|
+
/** `data-testid` for the root. */
|
|
7366
|
+
testId?: LoadErrorBannerProps['testId']
|
|
7367
|
+
/** `data-mol-id` for the root (React's `automationId`). */
|
|
7368
|
+
automationId?: LoadErrorBannerProps['automationId']
|
|
7189
7369
|
|
|
7190
7370
|
/** Template helpers (templates see only class members). */
|
|
7191
7371
|
readonly asTemplate = asTemplate
|
|
@@ -7211,6 +7391,29 @@ export class LoadErrorBanner {
|
|
|
7211
7391
|
*/
|
|
7212
7392
|
private readonly i18n = useTranslation()
|
|
7213
7393
|
|
|
7394
|
+
/** The host element, which is React's root `<div>`. */
|
|
7395
|
+
private readonly host: ElementRef<HTMLElement> = inject(ElementRef)
|
|
7396
|
+
|
|
7397
|
+
/** The `data-mol-id` this component last wrote (React's `automationId` wins over a rest `data-mol-id`). */
|
|
7398
|
+
private lastWrittenMolId: string | null = null
|
|
7399
|
+
|
|
7400
|
+
/**
|
|
7401
|
+
* Applies React's `rootProps` precedence on the root: a rest `data-mol-id`
|
|
7402
|
+
* bound on the tag stays, and `automationId` overrides it when given (and
|
|
7403
|
+
* leaves no stale value once cleared).
|
|
7404
|
+
*/
|
|
7405
|
+
ngAfterViewChecked(): void {
|
|
7406
|
+
const host = this.host.nativeElement
|
|
7407
|
+
const current = host.getAttribute('data-mol-id')
|
|
7408
|
+
if (this.automationId !== undefined) {
|
|
7409
|
+
if (current !== this.automationId) host.setAttribute('data-mol-id', this.automationId)
|
|
7410
|
+
this.lastWrittenMolId = this.automationId
|
|
7411
|
+
return
|
|
7412
|
+
}
|
|
7413
|
+
if (current !== null && current === this.lastWrittenMolId) host.removeAttribute('data-mol-id')
|
|
7414
|
+
this.lastWrittenMolId = null
|
|
7415
|
+
}
|
|
7416
|
+
|
|
7214
7417
|
/** Whether the projected retry label exists (a signal the placement function sets). */
|
|
7215
7418
|
private readonly hasRetryLabel = signal(false)
|
|
7216
7419
|
|
|
@@ -7319,6 +7522,11 @@ WAI-ARIA APG modal dialog pattern (focus
|
|
|
7319
7522
|
into the dialog on open, trapped Tab, focus restored on close, Escape for
|
|
7320
7523
|
the topmost dialog only, reference-counted body scroll lock).
|
|
7321
7524
|
|
|
7525
|
+
Projected content is created with the consumer's view, so a closed modal's body and footer exist
|
|
7526
|
+
while hidden: their components, effects and fetches run. React mounts them only while shown, and
|
|
7527
|
+
again each time they show. Write content with state as `*molLazy` (`MolLazy` from
|
|
7528
|
+
`@molecule/app-angular`): it is created when it shows and destroyed when it hides, as React's is.
|
|
7529
|
+
|
|
7322
7530
|
```typescript
|
|
7323
7531
|
@Component({
|
|
7324
7532
|
selector: 'mol-modal',
|
|
@@ -7336,6 +7544,7 @@ the topmost dialog only, reference-counted body scroll lock).
|
|
|
7336
7544
|
'centered',
|
|
7337
7545
|
'closeLabel',
|
|
7338
7546
|
'preventScroll',
|
|
7547
|
+
'initialFocus',
|
|
7339
7548
|
'className',
|
|
7340
7549
|
'style',
|
|
7341
7550
|
'testId',
|
|
@@ -7402,18 +7611,27 @@ the topmost dialog only, reference-counted body scroll lock).
|
|
|
7402
7611
|
export class Modal
|
|
7403
7612
|
implements AfterViewInit, AfterViewChecked, DoCheck, OnDestroy, HasElement<HTMLDivElement>
|
|
7404
7613
|
{
|
|
7614
|
+
/** Whether the dialog is open. */
|
|
7405
7615
|
open = false
|
|
7616
|
+
/** The dialog title. */
|
|
7406
7617
|
title?: string
|
|
7618
|
+
/** Dialog width preset. */
|
|
7407
7619
|
size: ModalSize = 'md'
|
|
7408
7620
|
showCloseButton = true
|
|
7409
7621
|
closeOnOverlayClick = true
|
|
7622
|
+
/** Whether Escape closes the dialog. */
|
|
7410
7623
|
closeOnEscape = true
|
|
7624
|
+
/** Footer content (node-valued prop). */
|
|
7411
7625
|
footer?: unknown
|
|
7412
7626
|
centered = true
|
|
7627
|
+
/** The close button's accessible label. */
|
|
7413
7628
|
closeLabel?: string
|
|
7414
7629
|
preventScroll = true
|
|
7630
|
+
initialFocus?: OverlayTarget
|
|
7631
|
+
/** Extra classes for the dialog. */
|
|
7415
7632
|
className?: string
|
|
7416
7633
|
style?: Record<string, unknown>
|
|
7634
|
+
/** `data-testid` for the dialog. */
|
|
7417
7635
|
testId?: string
|
|
7418
7636
|
automationId?: string
|
|
7419
7637
|
dataMolId?: string
|
|
@@ -7423,15 +7641,18 @@ export class Modal
|
|
|
7423
7641
|
|
|
7424
7642
|
@ViewChild('overlay') overlay?: ElementRef<HTMLDivElement>
|
|
7425
7643
|
@ViewChild('wrapper') wrapper?: ElementRef<HTMLDivElement>
|
|
7426
|
-
|
|
7644
|
+
/** The dialog element. */
|
|
7645
|
+
@ViewChild('dialog', { static: true }) dialog?: ElementRef<HTMLDivElement>
|
|
7427
7646
|
@ViewChild('footerSlot') footerSlot?: ElementRef<HTMLDivElement>
|
|
7428
7647
|
|
|
7429
7648
|
readonly titleId = `mol-modal-title-${++modalInstance}`
|
|
7430
|
-
private readonly stackId = modalInstance
|
|
7431
|
-
|
|
7432
7649
|
private readonly host: ElementRef<HTMLElement> = inject(ElementRef)
|
|
7433
|
-
private readonly
|
|
7650
|
+
private readonly browser = isPlatformBrowser(inject(PLATFORM_ID))
|
|
7434
7651
|
private readonly environmentInjector = inject(EnvironmentInjector)
|
|
7652
|
+
private readonly layer = new OverlayLayer((focus) => {
|
|
7653
|
+
if (!this.environmentInjector.destroyed)
|
|
7654
|
+
afterNextRender({ read: focus }, { injector: this.environmentInjector })
|
|
7655
|
+
})
|
|
7435
7656
|
private readonly inner = signal<HTMLDivElement | null>(null)
|
|
7436
7657
|
readonly element = this.inner.asReadonly()
|
|
7437
7658
|
|
|
@@ -7441,22 +7662,21 @@ export class Modal
|
|
|
7441
7662
|
|
|
7442
7663
|
private readonly i18n = useTranslation()
|
|
7443
7664
|
|
|
7444
|
-
private
|
|
7445
|
-
private lastOpen = false
|
|
7665
|
+
private lastOpen: boolean | undefined
|
|
7446
7666
|
private lastFooter = false
|
|
7447
|
-
private previouslyFocused: HTMLElement | null = null
|
|
7448
|
-
private listeners: (() => void)[] = []
|
|
7449
|
-
private locked = false
|
|
7450
7667
|
private externalMolId: string | undefined
|
|
7451
7668
|
|
|
7669
|
+
/** The current class map. */
|
|
7452
7670
|
cm(): UIClassMap {
|
|
7453
7671
|
return getClassMap()
|
|
7454
7672
|
}
|
|
7455
7673
|
|
|
7674
|
+
/** The dialog class list. */
|
|
7456
7675
|
dialogClasses(): string {
|
|
7457
7676
|
return this.cm().cn(this.cm().modal({ size: this.size }), this.className)
|
|
7458
7677
|
}
|
|
7459
7678
|
|
|
7679
|
+
/** Serializes the dialog's inline style. */
|
|
7460
7680
|
dialogStyle(): string | null {
|
|
7461
7681
|
return styleText(this.style)
|
|
7462
7682
|
}
|
|
@@ -7469,10 +7689,12 @@ export class Modal
|
|
|
7469
7689
|
return styleText(this.centered ? undefined : { alignItems: 'flex-start' })
|
|
7470
7690
|
}
|
|
7471
7691
|
|
|
7692
|
+
/** The close button's accessible label. */
|
|
7472
7693
|
closeText(): string {
|
|
7473
7694
|
return this.closeLabel ?? this.i18n.t('ui.modal.close', undefined, { defaultValue: 'Close' })
|
|
7474
7695
|
}
|
|
7475
7696
|
|
|
7697
|
+
/** The close button's X glyph. */
|
|
7476
7698
|
closeIcon(): ResolvedIcon {
|
|
7477
7699
|
return resolveIcon('x-mark', this.cm().iconMd)
|
|
7478
7700
|
}
|
|
@@ -7482,7 +7704,7 @@ export class Modal
|
|
|
7482
7704
|
event.stopPropagation()
|
|
7483
7705
|
return
|
|
7484
7706
|
}
|
|
7485
|
-
|
|
7707
|
+
this.layer.dismissBackdrop()
|
|
7486
7708
|
}
|
|
7487
7709
|
|
|
7488
7710
|
requestClose(): void {
|
|
@@ -7494,8 +7716,6 @@ export class Modal
|
|
|
7494
7716
|
}
|
|
7495
7717
|
|
|
7496
7718
|
ngAfterViewInit(): void {
|
|
7497
|
-
const overlay = this.overlay?.nativeElement
|
|
7498
|
-
const wrapper = this.wrapper?.nativeElement
|
|
7499
7719
|
const dialog = this.dialog?.nativeElement
|
|
7500
7720
|
if (dialog) {
|
|
7501
7721
|
adoptHostDataMolId(
|
|
@@ -7507,26 +7727,11 @@ export class Modal
|
|
|
7507
7727
|
() => this.molId(),
|
|
7508
7728
|
)
|
|
7509
7729
|
}
|
|
7510
|
-
|
|
7511
|
-
if (open) {
|
|
7512
|
-
this.previouslyFocused = (document.activeElement as HTMLElement | null) ?? null
|
|
7513
|
-
pushModalStack(this.stackId)
|
|
7514
|
-
if (overlay && wrapper) this.attachPortal()
|
|
7515
|
-
this.focusFirstInDialog()
|
|
7516
|
-
this.addListeners()
|
|
7517
|
-
} else if (overlay && wrapper) {
|
|
7518
|
-
this.detachPortal()
|
|
7519
|
-
}
|
|
7520
|
-
this.syncScrollLock()
|
|
7521
|
-
this.lastOpen = open
|
|
7730
|
+
this.syncOpen()
|
|
7522
7731
|
}
|
|
7732
|
+
|
|
7523
7733
|
ngDoCheck(): void {
|
|
7524
|
-
|
|
7525
|
-
if (open !== this.lastOpen) {
|
|
7526
|
-
this.lastOpen = open
|
|
7527
|
-
this.transition(open)
|
|
7528
|
-
}
|
|
7529
|
-
this.syncScrollLock()
|
|
7734
|
+
this.syncOpen()
|
|
7530
7735
|
}
|
|
7531
7736
|
|
|
7532
7737
|
ngAfterViewChecked(): void {
|
|
@@ -7541,67 +7746,74 @@ export class Modal
|
|
|
7541
7746
|
}
|
|
7542
7747
|
|
|
7543
7748
|
ngOnDestroy(): void {
|
|
7544
|
-
this.
|
|
7545
|
-
popModalStack(this.stackId)
|
|
7546
|
-
const toRestore = this.lastOpen ? this.previouslyFocused : null
|
|
7547
|
-
if (toRestore && !this.environmentInjector.destroyed)
|
|
7548
|
-
afterNextRender(
|
|
7549
|
-
() => {
|
|
7550
|
-
if (document.contains(toRestore)) toRestore.focus()
|
|
7551
|
-
},
|
|
7552
|
-
{ injector: this.environmentInjector },
|
|
7553
|
-
)
|
|
7554
|
-
if (this.locked) {
|
|
7555
|
-
this.sync.unlock()
|
|
7556
|
-
this.locked = false
|
|
7557
|
-
}
|
|
7749
|
+
this.layer.release()
|
|
7558
7750
|
}
|
|
7559
7751
|
|
|
7560
7752
|
private reconcileFooter(hasContent: SlotReader): void {
|
|
7561
7753
|
this.lastFooter = hasContent(this.footerSlot?.nativeElement)
|
|
7562
7754
|
setElementPresent(this.footerSlot?.nativeElement, this.lastFooter)
|
|
7563
7755
|
setElementPresent(this.host.nativeElement, false)
|
|
7564
|
-
setHostRoot(this.host.nativeElement, this.dialog?.nativeElement
|
|
7756
|
+
setHostRoot(this.host.nativeElement, this.wrapper ? this.dialog?.nativeElement : null, {
|
|
7757
|
+
except: ['data-mol-id'],
|
|
7758
|
+
})
|
|
7565
7759
|
}
|
|
7566
7760
|
|
|
7567
|
-
private
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7761
|
+
private syncOpen(): void {
|
|
7762
|
+
const dialog = this.dialog?.nativeElement
|
|
7763
|
+
if (!dialog) return
|
|
7764
|
+
const open = !!this.open
|
|
7765
|
+
if (open && this.browser) this.syncLayer(dialog)
|
|
7766
|
+
if (!this.wrapper) return
|
|
7767
|
+
|
|
7768
|
+
if (open !== this.lastOpen) {
|
|
7769
|
+
this.lastOpen = open
|
|
7770
|
+
if (open) this.attachPortal()
|
|
7771
|
+
else {
|
|
7772
|
+
this.layer.release()
|
|
7773
|
+
this.detachPortal()
|
|
7774
|
+
}
|
|
7775
|
+
}
|
|
7776
|
+
}
|
|
7777
|
+
|
|
7778
|
+
private syncLayer(dialog: HTMLDivElement): void {
|
|
7779
|
+
this.layer.sync({
|
|
7780
|
+
open: true,
|
|
7781
|
+
kind: 'modal',
|
|
7782
|
+
surface: { current: dialog },
|
|
7783
|
+
dismissKey: this.closeOnEscape,
|
|
7784
|
+
dismissBackdrop: this.closeOnOverlayClick,
|
|
7785
|
+
focus: { trap: true, initial: this.initialFocus, restore: 'opener' },
|
|
7786
|
+
lockScroll: this.preventScroll,
|
|
7787
|
+
onDismiss: () => this.requestClose(),
|
|
7788
|
+
})
|
|
7789
|
+
}
|
|
7790
|
+
|
|
7791
|
+
private attachPortal(): void {
|
|
7792
|
+
const overlay = this.overlay?.nativeElement
|
|
7793
|
+
const wrapper = this.wrapper?.nativeElement
|
|
7794
|
+
if (!overlay || !wrapper) return
|
|
7795
|
+
if (this.browser) {
|
|
7796
|
+
const { body } = wrapper.ownerDocument
|
|
7797
|
+
placeElement(overlay, body)
|
|
7798
|
+
placeElement(wrapper, body)
|
|
7574
7799
|
} else {
|
|
7575
|
-
|
|
7576
|
-
this.
|
|
7577
|
-
this.detachPortal()
|
|
7578
|
-
const toRestore = this.previouslyFocused
|
|
7579
|
-
if (toRestore)
|
|
7580
|
-
afterNextRender(
|
|
7581
|
-
() => {
|
|
7582
|
-
if (document.contains(toRestore)) toRestore.focus()
|
|
7583
|
-
},
|
|
7584
|
-
{ injector: this.injector },
|
|
7585
|
-
)
|
|
7800
|
+
placeElementBefore(overlay, this.host.nativeElement)
|
|
7801
|
+
placeElementBefore(wrapper, this.host.nativeElement)
|
|
7586
7802
|
}
|
|
7587
|
-
this.
|
|
7803
|
+
this.inner.set(this.dialog?.nativeElement ?? null)
|
|
7588
7804
|
}
|
|
7589
7805
|
|
|
7590
|
-
private
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
;(focusables[0] ?? dialog).focus()
|
|
7597
|
-
},
|
|
7598
|
-
{ injector: this.injector },
|
|
7599
|
-
)
|
|
7806
|
+
private detachPortal(): void {
|
|
7807
|
+
placeElement(this.overlay?.nativeElement, null)
|
|
7808
|
+
setElementPresent(this.overlay?.nativeElement, false)
|
|
7809
|
+
placeElement(this.wrapper?.nativeElement, null)
|
|
7810
|
+
setElementPresent(this.wrapper?.nativeElement, false)
|
|
7811
|
+
this.inner.set(null)
|
|
7600
7812
|
}
|
|
7601
|
-
|
|
7813
|
+
}
|
|
7602
7814
|
```
|
|
7603
7815
|
|
|
7604
|
-
_(Member comments are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/modal.component.d.ts`.)_
|
|
7816
|
+
_(Member comments are shortened to their first sentence, and the 37 longest are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/modal.component.d.ts`.)_
|
|
7605
7817
|
|
|
7606
7818
|
#### `MoleculeAlert`
|
|
7607
7819
|
|
|
@@ -8001,13 +8213,13 @@ Angular Input UI component with UIClassMap-driven styling.
|
|
|
8001
8213
|
standalone: true,
|
|
8002
8214
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8003
8215
|
template: `
|
|
8004
|
-
<div [class]="
|
|
8216
|
+
<div [class]="field.root">
|
|
8005
8217
|
@if (label) {
|
|
8006
8218
|
<label [attr.for]="inputId" [class]="labelClasses">
|
|
8007
8219
|
{{ label }}
|
|
8008
8220
|
</label>
|
|
8009
8221
|
}
|
|
8010
|
-
<div [class]="
|
|
8222
|
+
<div [class]="field.inner">
|
|
8011
8223
|
<input
|
|
8012
8224
|
[type]="type"
|
|
8013
8225
|
[id]="inputId"
|
|
@@ -8105,6 +8317,15 @@ export class MoleculeInput {
|
|
|
8105
8317
|
return getClassMap()
|
|
8106
8318
|
}
|
|
8107
8319
|
|
|
8320
|
+
/**
|
|
8321
|
+
* The classes of the field's two wrappers, from the shared field layout: `root` for the
|
|
8322
|
+
* outer wrapper, `inner` for the row that holds the control.
|
|
8323
|
+
* @returns The outer wrapper's classes and the control row's classes.
|
|
8324
|
+
*/
|
|
8325
|
+
get field(): ReturnType<typeof fieldLayout> {
|
|
8326
|
+
return fieldLayout(this.cm)
|
|
8327
|
+
}
|
|
8328
|
+
|
|
8108
8329
|
/**
|
|
8109
8330
|
* Computes the accessible clear button label.
|
|
8110
8331
|
* @returns The localized aria-label for the clear button.
|
|
@@ -8569,13 +8790,13 @@ Angular Select UI component with UIClassMap-driven styling.
|
|
|
8569
8790
|
standalone: true,
|
|
8570
8791
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8571
8792
|
template: `
|
|
8572
|
-
<div [class]="
|
|
8793
|
+
<div [class]="field.root">
|
|
8573
8794
|
@if (label) {
|
|
8574
8795
|
<label [attr.for]="selectId" [class]="labelClasses">
|
|
8575
8796
|
{{ label }}
|
|
8576
8797
|
</label>
|
|
8577
8798
|
}
|
|
8578
|
-
<div [class]="
|
|
8799
|
+
<div [class]="field.inner">
|
|
8579
8800
|
<select
|
|
8580
8801
|
[id]="selectId"
|
|
8581
8802
|
[name]="name"
|
|
@@ -8645,6 +8866,15 @@ export class MoleculeSelect {
|
|
|
8645
8866
|
return getClassMap()
|
|
8646
8867
|
}
|
|
8647
8868
|
|
|
8869
|
+
/**
|
|
8870
|
+
* The classes of the field's two wrappers, from the shared field layout: `root` for the
|
|
8871
|
+
* outer wrapper, `inner` for the row that holds the control.
|
|
8872
|
+
* @returns The outer wrapper's classes and the control row's classes.
|
|
8873
|
+
*/
|
|
8874
|
+
get field(): ReturnType<typeof fieldLayout> {
|
|
8875
|
+
return fieldLayout(this.cm)
|
|
8876
|
+
}
|
|
8877
|
+
|
|
8648
8878
|
/**
|
|
8649
8879
|
* Retrieves the CSS class for form error messages.
|
|
8650
8880
|
* @returns The form error class name string.
|
|
@@ -9522,6 +9752,7 @@ from the DOM — the projected nodes need an always-mounted capture point.
|
|
|
9522
9752
|
selector: 'div[mol-page-header]',
|
|
9523
9753
|
standalone: true,
|
|
9524
9754
|
hostDirectives: [MolPlacement],
|
|
9755
|
+
imports: [Link],
|
|
9525
9756
|
inputs: ['title', 'description', 'breadcrumbs', 'className', 'style', 'testId', 'automationId'],
|
|
9526
9757
|
host: {
|
|
9527
9758
|
// `title` is this component's heading, which React renders as text; Angular would also keep a
|
|
@@ -9539,7 +9770,7 @@ from the DOM — the projected nodes need an always-mounted capture point.
|
|
|
9539
9770
|
<span [class]="cm().pageHeaderBreadcrumbSeparator" aria-hidden="true">/</span>
|
|
9540
9771
|
}
|
|
9541
9772
|
@if (crumb.href) {
|
|
9542
|
-
<a [
|
|
9773
|
+
<a [molLink]="crumb.href" [class]="cm().pageHeaderBreadcrumbItem">{{ crumb.label }}</a>
|
|
9543
9774
|
} @else {
|
|
9544
9775
|
<span [class]="cm().pageHeaderBreadcrumbItem">{{ crumb.label }}</span>
|
|
9545
9776
|
}
|
|
@@ -10370,6 +10601,7 @@ leaves the page and the portal renders in `document.body`.
|
|
|
10370
10601
|
template: `<mol-modal
|
|
10371
10602
|
#modal
|
|
10372
10603
|
[open]="open"
|
|
10604
|
+
[initialFocus]="inputTarget"
|
|
10373
10605
|
(close)="onModalClose()"
|
|
10374
10606
|
[attr.aria-labelledby]="ariaLabelledBy()"
|
|
10375
10607
|
[attr.aria-describedby]="rendersNode(description) ? descriptionId : null"
|
|
@@ -10442,7 +10674,7 @@ leaves the page and the portal renders in `document.body`.
|
|
|
10442
10674
|
</form></mol-modal
|
|
10443
10675
|
>`,
|
|
10444
10676
|
})
|
|
10445
|
-
export class PromptDialog implements AfterViewInit,
|
|
10677
|
+
export class PromptDialog implements AfterViewInit, DoCheck {
|
|
10446
10678
|
/** Whether the dialog is open. */
|
|
10447
10679
|
open: PromptDialogProps['open'] = false
|
|
10448
10680
|
/** Dialog heading (node-valued prop). */
|
|
@@ -10451,8 +10683,11 @@ export class PromptDialog implements AfterViewInit, AfterViewChecked, DoCheck {
|
|
|
10451
10683
|
/** Input placeholder. */
|
|
10452
10684
|
placeholder?: PromptDialogProps['placeholder']
|
|
10453
10685
|
initialValue?: PromptDialogProps['initialValue'] = ''
|
|
10686
|
+
/** Called with the entered value on confirm. */
|
|
10454
10687
|
onSubmit?: PromptDialogProps['onSubmit']
|
|
10688
|
+
/** Confirm-button label (node-valued prop). */
|
|
10455
10689
|
confirmLabel?: PromptDialogProps['confirmLabel']
|
|
10690
|
+
/** Cancel-button label (node-valued prop). */
|
|
10456
10691
|
cancelLabel?: PromptDialogProps['cancelLabel']
|
|
10457
10692
|
destructive?: PromptDialogProps['destructive'] = false
|
|
10458
10693
|
/** `data-mol-id` for the text input. */
|
|
@@ -10463,9 +10698,11 @@ export class PromptDialog implements AfterViewInit, AfterViewChecked, DoCheck {
|
|
|
10463
10698
|
cancelMolId?: PromptDialogProps['cancelMolId']
|
|
10464
10699
|
|
|
10465
10700
|
readonly asTemplate = asTemplate
|
|
10701
|
+
/** Renders a plain-string/number node value. */
|
|
10466
10702
|
readonly nodeText = nodeText
|
|
10467
10703
|
/** Whether a node-valued prop was given. */
|
|
10468
10704
|
readonly isGiven = isGiven
|
|
10705
|
+
/** Whether a node-valued prop renders anything. */
|
|
10469
10706
|
readonly rendersNode = rendersNode
|
|
10470
10707
|
|
|
10471
10708
|
@Output() readonly close = new EventEmitter<unknown>()
|
|
@@ -10491,8 +10728,8 @@ export class PromptDialog implements AfterViewInit, AfterViewChecked, DoCheck {
|
|
|
10491
10728
|
|
|
10492
10729
|
private lastOpen = false
|
|
10493
10730
|
private lastInitial = ''
|
|
10494
|
-
|
|
10495
|
-
|
|
10731
|
+
|
|
10732
|
+
readonly inputTarget = elementTarget(() => this.inputComponent?.inputEl?.nativeElement)
|
|
10496
10733
|
|
|
10497
10734
|
constructor() {
|
|
10498
10735
|
usePlacement((hasContent) => {
|
|
@@ -10545,16 +10782,9 @@ export class PromptDialog implements AfterViewInit, AfterViewChecked, DoCheck {
|
|
|
10545
10782
|
if (this.open) {
|
|
10546
10783
|
this.value.set(this.initialValue ?? '')
|
|
10547
10784
|
this.pending.set(false)
|
|
10548
|
-
this.pendingInputFocus = true
|
|
10549
10785
|
}
|
|
10550
10786
|
}
|
|
10551
10787
|
|
|
10552
|
-
ngAfterViewChecked(): void {
|
|
10553
|
-
if (!this.pendingInputFocus) return
|
|
10554
|
-
this.pendingInputFocus = false
|
|
10555
|
-
afterNextRender(() => this.focusInput(), { injector: this.injector })
|
|
10556
|
-
}
|
|
10557
|
-
|
|
10558
10788
|
ngDoCheck(): void {
|
|
10559
10789
|
const open = !!this.open
|
|
10560
10790
|
if (open !== this.lastOpen || (open && this.initialValue !== this.lastInitial)) {
|
|
@@ -10563,15 +10793,10 @@ export class PromptDialog implements AfterViewInit, AfterViewChecked, DoCheck {
|
|
|
10563
10793
|
if (open) {
|
|
10564
10794
|
this.value.set(this.initialValue ?? '')
|
|
10565
10795
|
this.pending.set(false)
|
|
10566
|
-
this.pendingInputFocus = true
|
|
10567
10796
|
}
|
|
10568
10797
|
}
|
|
10569
10798
|
}
|
|
10570
10799
|
|
|
10571
|
-
focusInput(): void {
|
|
10572
|
-
this.inputComponent?.inputEl?.nativeElement.focus()
|
|
10573
|
-
}
|
|
10574
|
-
|
|
10575
10800
|
private applyInputLabel(hasContent: SlotReader): void {
|
|
10576
10801
|
const input = this.inputComponent?.inputEl?.nativeElement
|
|
10577
10802
|
if (!input) return
|
|
@@ -10593,19 +10818,20 @@ export class PromptDialog implements AfterViewInit, AfterViewChecked, DoCheck {
|
|
|
10593
10818
|
event.preventDefault()
|
|
10594
10819
|
if (this.pending()) return
|
|
10595
10820
|
this.pending.set(true)
|
|
10596
|
-
void
|
|
10597
|
-
|
|
10821
|
+
void (async (): Promise<void> => {
|
|
10822
|
+
try {
|
|
10823
|
+
await this.onSubmit?.(this.value())
|
|
10598
10824
|
this.pending.set(false)
|
|
10599
10825
|
this.close.emit()
|
|
10600
|
-
})
|
|
10601
|
-
.catch((_error: unknown) => {
|
|
10826
|
+
} catch (_error: unknown) {
|
|
10602
10827
|
this.pending.set(false)
|
|
10603
|
-
}
|
|
10828
|
+
}
|
|
10829
|
+
})()
|
|
10604
10830
|
}
|
|
10605
10831
|
}
|
|
10606
10832
|
```
|
|
10607
10833
|
|
|
10608
|
-
_(Member comments are shortened to their first sentence, and the
|
|
10834
|
+
_(Member comments are shortened to their first sentence, and the 25 longest are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/prompt-dialog.component.d.ts`.)_
|
|
10609
10835
|
|
|
10610
10836
|
#### `RadioGroup`
|
|
10611
10837
|
|
|
@@ -11246,6 +11472,11 @@ export class ResponsiveAppShellSidebar implements OnInit {
|
|
|
11246
11472
|
The mobile nav drawer (<768px): a left-anchored dialog panel over a
|
|
11247
11473
|
backdrop, portaled into `document.body`.
|
|
11248
11474
|
|
|
11475
|
+
Projected content is created with the consumer's view, so a closed drawer's content exists while
|
|
11476
|
+
hidden: its components, effects and fetches run. React mounts it only while shown, and again each
|
|
11477
|
+
time it shows. Write content with state as `*molLazy` (`MolLazy` from `@molecule/app-angular`):
|
|
11478
|
+
it is created when it shows and destroyed when it hides, as React's is.
|
|
11479
|
+
|
|
11249
11480
|
```typescript
|
|
11250
11481
|
@Component({
|
|
11251
11482
|
selector: 'mol-responsive-app-shell-drawer',
|
|
@@ -11338,16 +11569,21 @@ export class ResponsiveAppShellDrawer implements OnInit, AfterViewInit, DoCheck,
|
|
|
11338
11569
|
navLabel?: ResponsiveAppShellDrawerProps['navLabel']
|
|
11339
11570
|
footer?: ResponsiveAppShellDrawerProps['footer']
|
|
11340
11571
|
showCloseButton?: ResponsiveAppShellDrawerProps['showCloseButton'] = true
|
|
11572
|
+
/** Extra classes on the dialog panel. */
|
|
11341
11573
|
className?: ResponsiveAppShellDrawerProps['className']
|
|
11342
11574
|
dataMolId?: ResponsiveAppShellDrawerProps['dataMolId'] = 'shell-drawer'
|
|
11343
11575
|
closeDataMolId?: ResponsiveAppShellDrawerProps['closeDataMolId'] = 'shell-drawer-close'
|
|
11576
|
+
/** `data-testid` for the panel. */
|
|
11344
11577
|
testId?: ResponsiveAppShellDrawerProps['testId']
|
|
11345
11578
|
|
|
11346
11579
|
readonly asTemplate = asTemplate
|
|
11347
11580
|
readonly nodeText = nodeText
|
|
11348
11581
|
|
|
11582
|
+
/** The backdrop element. */
|
|
11349
11583
|
@ViewChild('overlay') overlay?: ElementRef<HTMLDivElement>
|
|
11584
|
+
/** The fixed wrapper. */
|
|
11350
11585
|
@ViewChild('wrapper') wrapper?: ElementRef<HTMLDivElement>
|
|
11586
|
+
/** The dialog panel. */
|
|
11351
11587
|
@ViewChild('panel') panel?: ElementRef<HTMLDivElement>
|
|
11352
11588
|
@ViewChild('headerRow') headerRow?: ElementRef<HTMLDivElement>
|
|
11353
11589
|
@ViewChild('headerSlot') headerSlot?: ElementRef<HTMLDivElement>
|
|
@@ -11359,14 +11595,14 @@ export class ResponsiveAppShellDrawer implements OnInit, AfterViewInit, DoCheck,
|
|
|
11359
11595
|
|
|
11360
11596
|
private readonly i18n = useTranslation()
|
|
11361
11597
|
|
|
11362
|
-
private readonly
|
|
11598
|
+
private readonly browser = isPlatformBrowser(inject(PLATFORM_ID))
|
|
11363
11599
|
private readonly environmentInjector = inject(EnvironmentInjector)
|
|
11364
|
-
private readonly
|
|
11600
|
+
private readonly layer = new OverlayLayer((focus) => {
|
|
11601
|
+
if (!this.environmentInjector.destroyed)
|
|
11602
|
+
afterNextRender({ read: focus }, { injector: this.environmentInjector })
|
|
11603
|
+
})
|
|
11365
11604
|
private hasFooter = false
|
|
11366
|
-
private
|
|
11367
|
-
private lastOpen = false
|
|
11368
|
-
private previouslyFocused: HTMLElement | null = null
|
|
11369
|
-
private listeners: (() => void)[] = []
|
|
11605
|
+
private lastOpen: boolean | undefined
|
|
11370
11606
|
|
|
11371
11607
|
constructor() {
|
|
11372
11608
|
usePlacement((hasContent) => {
|
|
@@ -11376,6 +11612,7 @@ export class ResponsiveAppShellDrawer implements OnInit, AfterViewInit, DoCheck,
|
|
|
11376
11612
|
})
|
|
11377
11613
|
}
|
|
11378
11614
|
|
|
11615
|
+
/** The nearest shell context. */
|
|
11379
11616
|
shell(): ShellContextValue {
|
|
11380
11617
|
return this.readContext() ?? contextOrDefault(null)
|
|
11381
11618
|
}
|
|
@@ -11384,10 +11621,12 @@ export class ResponsiveAppShellDrawer implements OnInit, AfterViewInit, DoCheck,
|
|
|
11384
11621
|
return ShellDomContext.find(this.host.nativeElement) ?? null
|
|
11385
11622
|
}
|
|
11386
11623
|
|
|
11624
|
+
/** The current class map. */
|
|
11387
11625
|
cm(): UIClassMap {
|
|
11388
11626
|
return getClassMap()
|
|
11389
11627
|
}
|
|
11390
11628
|
|
|
11629
|
+
/** The panel class list. */
|
|
11391
11630
|
panelClasses(): string {
|
|
11392
11631
|
return this.cm().cn(this.cm().flex({ direction: 'col' }), this.cm().surface, this.className)
|
|
11393
11632
|
}
|
|
@@ -11404,6 +11643,7 @@ export class ResponsiveAppShellDrawer implements OnInit, AfterViewInit, DoCheck,
|
|
|
11404
11643
|
return styleText({ zIndex: 41 })
|
|
11405
11644
|
}
|
|
11406
11645
|
|
|
11646
|
+
/** The close button's class list. */
|
|
11407
11647
|
closeClasses(): string {
|
|
11408
11648
|
return this.cm().cn(
|
|
11409
11649
|
this.cm().flex({ align: 'center', justify: 'center' }),
|
|
@@ -11416,6 +11656,7 @@ export class ResponsiveAppShellDrawer implements OnInit, AfterViewInit, DoCheck,
|
|
|
11416
11656
|
)
|
|
11417
11657
|
}
|
|
11418
11658
|
|
|
11659
|
+
/** The nav/dialog accessible label. */
|
|
11419
11660
|
navLabelText(): string {
|
|
11420
11661
|
return (
|
|
11421
11662
|
this.navLabel ??
|
|
@@ -11423,10 +11664,12 @@ export class ResponsiveAppShellDrawer implements OnInit, AfterViewInit, DoCheck,
|
|
|
11423
11664
|
)
|
|
11424
11665
|
}
|
|
11425
11666
|
|
|
11667
|
+
/** The close button's accessible label. */
|
|
11426
11668
|
closeLabel(): string {
|
|
11427
11669
|
return this.i18n.t('appShell.closeMenu', {}, { defaultValue: 'Close navigation menu' })
|
|
11428
11670
|
}
|
|
11429
11671
|
|
|
11672
|
+
/** The close glyph. */
|
|
11430
11673
|
closeIcon(): ResolvedIcon {
|
|
11431
11674
|
return resolveIcon('x-mark', this.cm().iconMd)
|
|
11432
11675
|
}
|
|
@@ -11436,7 +11679,7 @@ export class ResponsiveAppShellDrawer implements OnInit, AfterViewInit, DoCheck,
|
|
|
11436
11679
|
event.stopPropagation()
|
|
11437
11680
|
return
|
|
11438
11681
|
}
|
|
11439
|
-
this.
|
|
11682
|
+
this.layer.dismissBackdrop()
|
|
11440
11683
|
}
|
|
11441
11684
|
|
|
11442
11685
|
ngOnInit(): void {
|
|
@@ -11445,10 +11688,7 @@ export class ResponsiveAppShellDrawer implements OnInit, AfterViewInit, DoCheck,
|
|
|
11445
11688
|
|
|
11446
11689
|
ngAfterViewInit(): void {
|
|
11447
11690
|
this.shell().registerDrawer(true)
|
|
11448
|
-
|
|
11449
|
-
this.lastOpen = open
|
|
11450
|
-
if (open) this.openPanel()
|
|
11451
|
-
else this.detachPortal()
|
|
11691
|
+
this.syncOpen()
|
|
11452
11692
|
}
|
|
11453
11693
|
|
|
11454
11694
|
ngDoCheck(): void {
|
|
@@ -11457,19 +11697,7 @@ export class ResponsiveAppShellDrawer implements OnInit, AfterViewInit, DoCheck,
|
|
|
11457
11697
|
|
|
11458
11698
|
ngOnDestroy(): void {
|
|
11459
11699
|
this.shell().registerDrawer(false)
|
|
11460
|
-
this.
|
|
11461
|
-
const toRestore = this.lastOpen ? this.previouslyFocused : null
|
|
11462
|
-
if (toRestore && !this.environmentInjector.destroyed)
|
|
11463
|
-
afterNextRender(
|
|
11464
|
-
() => {
|
|
11465
|
-
if (document.contains(toRestore)) toRestore.focus()
|
|
11466
|
-
},
|
|
11467
|
-
{ injector: this.environmentInjector },
|
|
11468
|
-
)
|
|
11469
|
-
if (this.locked) {
|
|
11470
|
-
this.scrollLock.unlock()
|
|
11471
|
-
this.locked = false
|
|
11472
|
-
}
|
|
11700
|
+
this.layer.release()
|
|
11473
11701
|
}
|
|
11474
11702
|
|
|
11475
11703
|
private syncWrappers(hasContent: SlotReader): void {
|
|
@@ -11485,32 +11713,39 @@ export class ResponsiveAppShellDrawer implements OnInit, AfterViewInit, DoCheck,
|
|
|
11485
11713
|
}
|
|
11486
11714
|
|
|
11487
11715
|
private syncOpen(): void {
|
|
11488
|
-
const
|
|
11489
|
-
|
|
11716
|
+
const shell = this.shell()
|
|
11717
|
+
const open = this.browser && shell.drawerOpen && !shell.isDesktop
|
|
11718
|
+
const panel = this.panel?.nativeElement
|
|
11719
|
+
const overlay = this.overlay?.nativeElement
|
|
11720
|
+
const wrapper = this.wrapper?.nativeElement
|
|
11721
|
+
if (!panel || !overlay || !wrapper || open === this.lastOpen) return
|
|
11490
11722
|
this.lastOpen = open
|
|
11491
11723
|
if (open) {
|
|
11492
|
-
|
|
11724
|
+
const { body } = panel.ownerDocument
|
|
11725
|
+
placeElement(overlay, body)
|
|
11726
|
+
placeElement(wrapper, body)
|
|
11727
|
+
this.layer.sync({
|
|
11728
|
+
open: true,
|
|
11729
|
+
kind: 'modal',
|
|
11730
|
+
surface: { current: panel },
|
|
11731
|
+
dismissKey: true,
|
|
11732
|
+
dismissBackdrop: true,
|
|
11733
|
+
focus: { trap: true, restore: 'opener' },
|
|
11734
|
+
lockScroll: true,
|
|
11735
|
+
onDismiss: () => shell.closeDrawer(),
|
|
11736
|
+
})
|
|
11493
11737
|
} else {
|
|
11494
|
-
this.
|
|
11495
|
-
|
|
11496
|
-
|
|
11497
|
-
|
|
11498
|
-
|
|
11499
|
-
}
|
|
11500
|
-
const toRestore = this.previouslyFocused
|
|
11501
|
-
if (toRestore)
|
|
11502
|
-
afterNextRender(
|
|
11503
|
-
() => {
|
|
11504
|
-
if (document.contains(toRestore)) toRestore.focus()
|
|
11505
|
-
},
|
|
11506
|
-
{ injector: this.injector },
|
|
11507
|
-
)
|
|
11738
|
+
this.layer.release()
|
|
11739
|
+
placeElement(overlay, null)
|
|
11740
|
+
setElementPresent(overlay, false)
|
|
11741
|
+
placeElement(wrapper, null)
|
|
11742
|
+
setElementPresent(wrapper, false)
|
|
11508
11743
|
}
|
|
11509
11744
|
}
|
|
11510
|
-
|
|
11745
|
+
}
|
|
11511
11746
|
```
|
|
11512
11747
|
|
|
11513
|
-
_(Member comments are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/responsive-app-shell.component.d.ts`.)_
|
|
11748
|
+
_(Member comments are shortened to their first sentence, and the 34 longest are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/responsive-app-shell.component.d.ts`.)_
|
|
11514
11749
|
|
|
11515
11750
|
#### `ResponsiveAppShellContent`
|
|
11516
11751
|
|
|
@@ -11569,7 +11804,8 @@ export class ResponsiveAppShellContent {
|
|
|
11569
11804
|
|
|
11570
11805
|
Select component.
|
|
11571
11806
|
|
|
11572
|
-
The host is the
|
|
11807
|
+
The host is the field's outer wrapper React renders (the shared field layout's
|
|
11808
|
+
`root`, a flex column). React's select value is
|
|
11573
11809
|
written through the value PROPERTY (a `select` has no value attribute);
|
|
11574
11810
|
a controlled `value` is restored after a change exactly like React's
|
|
11575
11811
|
controlled-input state restore.
|
|
@@ -11603,7 +11839,7 @@ controlled-input state restore.
|
|
|
11603
11839
|
'onKeyDown',
|
|
11604
11840
|
],
|
|
11605
11841
|
host: {
|
|
11606
|
-
'[class]': '
|
|
11842
|
+
'[class]': 'field().root',
|
|
11607
11843
|
},
|
|
11608
11844
|
template: `@if (label) {
|
|
11609
11845
|
<label
|
|
@@ -11612,7 +11848,7 @@ controlled-input state restore.
|
|
|
11612
11848
|
>{{ label }}</label
|
|
11613
11849
|
>
|
|
11614
11850
|
}
|
|
11615
|
-
<div [class]="
|
|
11851
|
+
<div [class]="field().inner">
|
|
11616
11852
|
<select
|
|
11617
11853
|
[attr.id]="selectId()"
|
|
11618
11854
|
[attr.name]="name"
|
|
@@ -11682,7 +11918,6 @@ export class Select implements AfterViewInit, AfterViewChecked, HasElement<HTMLS
|
|
|
11682
11918
|
hint?: string
|
|
11683
11919
|
clearable?: boolean
|
|
11684
11920
|
className?: string
|
|
11685
|
-
/** Inline style object (React camelCase). */
|
|
11686
11921
|
style?: Record<string, unknown>
|
|
11687
11922
|
/** `data-testid` for the select. */
|
|
11688
11923
|
testId?: string
|
|
@@ -11729,6 +11964,10 @@ export class Select implements AfterViewInit, AfterViewChecked, HasElement<HTMLS
|
|
|
11729
11964
|
return getClassMap()
|
|
11730
11965
|
}
|
|
11731
11966
|
|
|
11967
|
+
field(): ReturnType<typeof fieldLayout> {
|
|
11968
|
+
return fieldLayout(this.cm())
|
|
11969
|
+
}
|
|
11970
|
+
|
|
11732
11971
|
selectId(): string {
|
|
11733
11972
|
return this.id || this.fieldContext()?.id || this.name || this.generatedId
|
|
11734
11973
|
}
|
|
@@ -11847,7 +12086,7 @@ export class Select implements AfterViewInit, AfterViewChecked, HasElement<HTMLS
|
|
|
11847
12086
|
}
|
|
11848
12087
|
```
|
|
11849
12088
|
|
|
11850
|
-
_(Member comments are shortened to their first sentence, and the
|
|
12089
|
+
_(Member comments are shortened to their first sentence, and the 38 longest are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/select.component.d.ts`.)_
|
|
11851
12090
|
|
|
11852
12091
|
#### `Separator`
|
|
11853
12092
|
|
|
@@ -11962,6 +12201,7 @@ matching props override it.
|
|
|
11962
12201
|
'ariaLabelDefault',
|
|
11963
12202
|
'dataMolId',
|
|
11964
12203
|
'className',
|
|
12204
|
+
'testId',
|
|
11965
12205
|
],
|
|
11966
12206
|
template: `<button
|
|
11967
12207
|
#trigger
|
|
@@ -11969,6 +12209,7 @@ matching props override it.
|
|
|
11969
12209
|
(click)="isOpen.set(true)"
|
|
11970
12210
|
[attr.aria-label]="ariaLabel()"
|
|
11971
12211
|
[attr.data-mol-id]="dataMolId"
|
|
12212
|
+
[attr.data-testid]="testId"
|
|
11972
12213
|
[class]="triggerClasses()"
|
|
11973
12214
|
>
|
|
11974
12215
|
@if (displayAvatar(); as avatar) {
|
|
@@ -12008,6 +12249,8 @@ export class SidebarUserCard {
|
|
|
12008
12249
|
dataMolId?: SidebarUserCardProps['dataMolId'] = 'sidebar-user-card'
|
|
12009
12250
|
/** Extra classes for the trigger. */
|
|
12010
12251
|
className?: SidebarUserCardProps['className']
|
|
12252
|
+
/** `data-testid` for the trigger. */
|
|
12253
|
+
testId?: SidebarUserCardProps['testId']
|
|
12011
12254
|
|
|
12012
12255
|
/** Whether the drawer is open. */
|
|
12013
12256
|
readonly isOpen = signal(false)
|
|
@@ -12610,6 +12853,8 @@ export class Switch implements AfterViewChecked, HasElement<HTMLButtonElement> {
|
|
|
12610
12853
|
|
|
12611
12854
|
/** The genuine native `change` event of the hidden checkbox. */
|
|
12612
12855
|
@Output() readonly change = new EventEmitter<Event>()
|
|
12856
|
+
/** Fires with the new checked state. */
|
|
12857
|
+
@Output() readonly checkedChange = new EventEmitter<boolean>()
|
|
12613
12858
|
|
|
12614
12859
|
/** The hidden native checkbox. */
|
|
12615
12860
|
@ViewChild('hiddenInput') hiddenInput?: ElementRef<HTMLInputElement>
|
|
@@ -12725,8 +12970,10 @@ export class Switch implements AfterViewChecked, HasElement<HTMLButtonElement> {
|
|
|
12725
12970
|
*/
|
|
12726
12971
|
handleChange(event: Event): void {
|
|
12727
12972
|
event.stopPropagation()
|
|
12728
|
-
this.change.emit(event)
|
|
12729
12973
|
const input = this.hiddenInput?.nativeElement
|
|
12974
|
+
const next = input?.checked
|
|
12975
|
+
this.change.emit(event)
|
|
12976
|
+
if (next !== undefined) this.checkedChange.emit(next)
|
|
12730
12977
|
if (input) input.checked = !!this.checked
|
|
12731
12978
|
}
|
|
12732
12979
|
|
|
@@ -13285,7 +13532,8 @@ _(Member comments are shortened to their first sentence, and the 4 longest are l
|
|
|
13285
13532
|
|
|
13286
13533
|
Textarea component.
|
|
13287
13534
|
|
|
13288
|
-
The host is the
|
|
13535
|
+
The host is the field's outer wrapper React renders (the shared field layout's
|
|
13536
|
+
`root`, a flex column). React's textarea
|
|
13289
13537
|
`onChange` fires on `input` events; a controlled `value` is restored after
|
|
13290
13538
|
user input exactly like React's controlled-input state restore.
|
|
13291
13539
|
`autoResize` recomputes the inline height after every check and on real
|
|
@@ -13321,7 +13569,7 @@ user input exactly like React's controlled-input state restore.
|
|
|
13321
13569
|
'onKeyDown',
|
|
13322
13570
|
],
|
|
13323
13571
|
host: {
|
|
13324
|
-
'[class]': '
|
|
13572
|
+
'[class]': 'field().root',
|
|
13325
13573
|
},
|
|
13326
13574
|
template: `@if (label) {
|
|
13327
13575
|
<label
|
|
@@ -13404,10 +13652,11 @@ export class Textarea implements AfterViewInit, AfterViewChecked, HasElement<HTM
|
|
|
13404
13652
|
|
|
13405
13653
|
/** Fires the raw `input` event (React's textarea onChange). */
|
|
13406
13654
|
@Output() readonly change = new EventEmitter<Event>()
|
|
13655
|
+
/** Fires with the edited text. */
|
|
13656
|
+
@Output() readonly valueChange = new EventEmitter<string>()
|
|
13407
13657
|
|
|
13408
13658
|
/** The native textarea (React's `...rest` spread target). */
|
|
13409
13659
|
private textareaEl?: ElementRef<HTMLTextAreaElement>
|
|
13410
|
-
/** The native textarea view query; also feeds the caller's ref element. */
|
|
13411
13660
|
@ViewChild('textareaEl')
|
|
13412
13661
|
set textareaElQuery(ref: ElementRef<HTMLTextAreaElement> | undefined) {
|
|
13413
13662
|
this.textareaEl = ref
|
|
@@ -13425,7 +13674,6 @@ export class Textarea implements AfterViewInit, AfterViewChecked, HasElement<HTM
|
|
|
13425
13674
|
/** Reactive translation, read in the injection context. */
|
|
13426
13675
|
private readonly i18n = useTranslation()
|
|
13427
13676
|
|
|
13428
|
-
/** The `aria-describedby` the caller spread onto the host (React's rest). */
|
|
13429
13677
|
private restDescribedBy: string | null = null
|
|
13430
13678
|
/** Whether the rest-describedby value was captured. */
|
|
13431
13679
|
private restDescribedByCaptured = false
|
|
@@ -13436,6 +13684,10 @@ export class Textarea implements AfterViewInit, AfterViewChecked, HasElement<HTM
|
|
|
13436
13684
|
return getClassMap()
|
|
13437
13685
|
}
|
|
13438
13686
|
|
|
13687
|
+
field(): ReturnType<typeof fieldLayout> {
|
|
13688
|
+
return fieldLayout(this.cm())
|
|
13689
|
+
}
|
|
13690
|
+
|
|
13439
13691
|
textareaId(): string {
|
|
13440
13692
|
return this.id || this.fieldContext()?.id || this.name || this.generatedId
|
|
13441
13693
|
}
|
|
@@ -13465,11 +13717,20 @@ export class Textarea implements AfterViewInit, AfterViewChecked, HasElement<HTM
|
|
|
13465
13717
|
)
|
|
13466
13718
|
}
|
|
13467
13719
|
|
|
13720
|
+
/** Serializes the inline style for the textarea. */
|
|
13468
13721
|
hostStyle(): string | null {
|
|
13469
|
-
return styleText(
|
|
13722
|
+
return styleText(
|
|
13723
|
+
this.autoResize
|
|
13724
|
+
? {
|
|
13725
|
+
resize: 'none',
|
|
13726
|
+
...this.style,
|
|
13727
|
+
minHeight: `${Math.min(this.minRows ?? 3, this.maxRows ?? Infinity)}lh`,
|
|
13728
|
+
...(this.maxRows === undefined ? {} : { maxHeight: `${this.maxRows}lh` }),
|
|
13729
|
+
}
|
|
13730
|
+
: this.style,
|
|
13731
|
+
)
|
|
13470
13732
|
}
|
|
13471
13733
|
|
|
13472
|
-
/** The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`). */
|
|
13473
13734
|
molId(): string | undefined {
|
|
13474
13735
|
return this.automationId ?? this.dataMolId ?? this.externalMolId
|
|
13475
13736
|
}
|
|
@@ -13478,6 +13739,7 @@ export class Textarea implements AfterViewInit, AfterViewChecked, HasElement<HTM
|
|
|
13478
13739
|
event.stopPropagation()
|
|
13479
13740
|
this.change.emit(event)
|
|
13480
13741
|
const textarea = this.textareaEl?.nativeElement
|
|
13742
|
+
if (textarea) this.valueChange.emit(textarea.value)
|
|
13481
13743
|
if (this.value !== undefined && textarea && textarea.value !== this.value)
|
|
13482
13744
|
textarea.value = this.value
|
|
13483
13745
|
this.resize()
|
|
@@ -13487,15 +13749,12 @@ export class Textarea implements AfterViewInit, AfterViewChecked, HasElement<HTM
|
|
|
13487
13749
|
event.stopPropagation()
|
|
13488
13750
|
}
|
|
13489
13751
|
|
|
13752
|
+
/** Sizes the box to its content. */
|
|
13490
13753
|
resize(): void {
|
|
13491
13754
|
const element = this.textareaEl?.nativeElement
|
|
13492
13755
|
if (!this.autoResize || !element) return
|
|
13493
13756
|
element.style.height = 'auto'
|
|
13494
|
-
|
|
13495
|
-
const minHeight = (this.minRows ?? 3) * lineHeight
|
|
13496
|
-
const maxHeight = this.maxRows ? this.maxRows * lineHeight : Infinity
|
|
13497
|
-
const newHeight = Math.min(Math.max(element.scrollHeight, minHeight), maxHeight)
|
|
13498
|
-
element.style.height = `${newHeight}px`
|
|
13757
|
+
element.style.height = `${element.scrollHeight}px`
|
|
13499
13758
|
}
|
|
13500
13759
|
|
|
13501
13760
|
ngAfterViewInit(): void {
|
|
@@ -13517,7 +13776,6 @@ export class Textarea implements AfterViewInit, AfterViewChecked, HasElement<HTM
|
|
|
13517
13776
|
}
|
|
13518
13777
|
|
|
13519
13778
|
ngAfterViewChecked(): void {
|
|
13520
|
-
// Registering this view against the locale: a switch marks it for check,
|
|
13521
13779
|
// so this hook runs and the reapply below moves the caller's re-bound
|
|
13522
13780
|
// rest attribute onto the textarea. Without the read, zoneless change
|
|
13523
13781
|
// detection never re-checks this view — the parent's re-bound
|
|
@@ -13549,7 +13807,7 @@ export class Textarea implements AfterViewInit, AfterViewChecked, HasElement<HTM
|
|
|
13549
13807
|
}
|
|
13550
13808
|
```
|
|
13551
13809
|
|
|
13552
|
-
_(Member comments are shortened to their first sentence, and the
|
|
13810
|
+
_(Member comments are shortened to their first sentence, and the 18 longest are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/textarea.component.d.ts`.)_
|
|
13553
13811
|
|
|
13554
13812
|
#### `ThemeToggle`
|
|
13555
13813
|
|
|
@@ -13568,10 +13826,20 @@ directly, so the browser suppresses the click exactly as React does.
|
|
|
13568
13826
|
selector: 'button[mol-theme-toggle]',
|
|
13569
13827
|
standalone: true,
|
|
13570
13828
|
imports: [Icon],
|
|
13571
|
-
inputs: [
|
|
13829
|
+
inputs: [
|
|
13830
|
+
'ariaLabelKey',
|
|
13831
|
+
'ariaLabelDefault',
|
|
13832
|
+
'darkIcon',
|
|
13833
|
+
'lightIcon',
|
|
13834
|
+
'iconSize',
|
|
13835
|
+
'className',
|
|
13836
|
+
'testId',
|
|
13837
|
+
'automationId',
|
|
13838
|
+
],
|
|
13572
13839
|
host: {
|
|
13573
13840
|
type: 'button',
|
|
13574
|
-
'data-mol-id': '
|
|
13841
|
+
'[attr.data-mol-id]': 'molId()',
|
|
13842
|
+
'[attr.data-testid]': 'testId',
|
|
13575
13843
|
'[attr.data-mode]': 'mode()',
|
|
13576
13844
|
'[attr.aria-pressed]': 'mode() === "dark" ? "true" : "false"',
|
|
13577
13845
|
'[attr.aria-label]': 'labelText()',
|
|
@@ -13597,6 +13865,10 @@ export class ThemeToggle {
|
|
|
13597
13865
|
iconSize?: ThemeToggleProps['iconSize']
|
|
13598
13866
|
/** Extra classes joined onto the toggle classes. */
|
|
13599
13867
|
className?: ThemeToggleProps['className']
|
|
13868
|
+
/** `data-testid` for the button. */
|
|
13869
|
+
testId?: ThemeToggleProps['testId']
|
|
13870
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
13871
|
+
automationId?: ThemeToggleProps['automationId']
|
|
13600
13872
|
|
|
13601
13873
|
/** Theme state and actions, read in the component's injection context. */
|
|
13602
13874
|
readonly theme = useTheme()
|
|
@@ -13639,6 +13911,14 @@ export class ThemeToggle {
|
|
|
13639
13911
|
return cm.cn(cm.themeToggleButton, this.className)
|
|
13640
13912
|
}
|
|
13641
13913
|
|
|
13914
|
+
/**
|
|
13915
|
+
* The `data-mol-id` value (`automationId` wins over the default).
|
|
13916
|
+
* @returns The automation id.
|
|
13917
|
+
*/
|
|
13918
|
+
molId(): string {
|
|
13919
|
+
return this.automationId ?? 'theme-toggle'
|
|
13920
|
+
}
|
|
13921
|
+
|
|
13642
13922
|
/**
|
|
13643
13923
|
* The rendered icon pixel size.
|
|
13644
13924
|
* @returns The size (default 20 when a later-bound write left it unset).
|
|
@@ -13678,6 +13958,8 @@ with the remaining time; the announced role follows `status`
|
|
|
13678
13958
|
'automationId',
|
|
13679
13959
|
'dataMolId: data-mol-id',
|
|
13680
13960
|
'id',
|
|
13961
|
+
'roleOverride: role',
|
|
13962
|
+
'live: aria-live',
|
|
13681
13963
|
],
|
|
13682
13964
|
outputs: ['dismiss'],
|
|
13683
13965
|
host: {
|
|
@@ -13689,11 +13971,12 @@ with the remaining time; the announced role follows `status`
|
|
|
13689
13971
|
'[attr.data-mol-id]': 'molId()',
|
|
13690
13972
|
'[attr.id]': 'id',
|
|
13691
13973
|
'[attr.role]': 'role()',
|
|
13974
|
+
'[attr.aria-live]': 'live',
|
|
13692
13975
|
'[attr.data-state]': 'visible() ? "open" : null',
|
|
13693
|
-
'(mouseenter)': '
|
|
13694
|
-
'(mouseleave)': '
|
|
13695
|
-
'(focusin)': '
|
|
13696
|
-
'(focusout)': '
|
|
13976
|
+
'(mouseenter)': 'setHovered(true)',
|
|
13977
|
+
'(mouseleave)': 'setHovered(false)',
|
|
13978
|
+
'(focusin)': 'setFocused(true)',
|
|
13979
|
+
'(focusout)': 'leaveFocus($event)',
|
|
13697
13980
|
},
|
|
13698
13981
|
template: `@if (statusIcon(); as icon) {
|
|
13699
13982
|
<span [class]="cm().toastIconWrapper"><svg mol-icon [data]="icon" /></span>
|
|
@@ -13724,6 +14007,7 @@ with the remaining time; the announced role follows `status`
|
|
|
13724
14007
|
export class Toast implements AfterViewInit, DoCheck, OnDestroy, HasElement<HTMLDivElement> {
|
|
13725
14008
|
/** The toast title. */
|
|
13726
14009
|
title?: string
|
|
14010
|
+
/** The toast description (a string or a node value rendered as a template). */
|
|
13727
14011
|
description?: unknown
|
|
13728
14012
|
/** The toast status. */
|
|
13729
14013
|
status: ColorVariant = 'info'
|
|
@@ -13745,9 +14029,15 @@ export class Toast implements AfterViewInit, DoCheck, OnDestroy, HasElement<HTML
|
|
|
13745
14029
|
automationId?: string
|
|
13746
14030
|
dataMolId?: string
|
|
13747
14031
|
id?: string
|
|
14032
|
+
/** Overrides the status-derived role. */
|
|
14033
|
+
roleOverride?: ToastProps['role']
|
|
14034
|
+
/** Overrides the live-region priority, including `off`. */
|
|
14035
|
+
live?: ToastProps['aria-live']
|
|
13748
14036
|
|
|
14037
|
+
/** Fires when the toast dismisses itself or its close button is pressed. */
|
|
13749
14038
|
@Output() readonly dismiss = new EventEmitter<void>()
|
|
13750
14039
|
|
|
14040
|
+
/** The description wrapper (always in the template; detached when empty). */
|
|
13751
14041
|
@ViewChild('descriptionSlot') descriptionSlot?: ElementRef<HTMLDivElement>
|
|
13752
14042
|
/** The children capture point. */
|
|
13753
14043
|
@ViewChild('childrenSlot') childrenSlot?: ElementRef<HTMLSpanElement>
|
|
@@ -13764,9 +14054,10 @@ export class Toast implements AfterViewInit, DoCheck, OnDestroy, HasElement<HTML
|
|
|
13764
14054
|
private readonly i18n = useTranslation()
|
|
13765
14055
|
|
|
13766
14056
|
private readonly host: HTMLElement = this.el.nativeElement
|
|
13767
|
-
private
|
|
13768
|
-
|
|
13769
|
-
|
|
14057
|
+
private readonly countdown = new ToastCountdown(() => {
|
|
14058
|
+
this.visible.set(false)
|
|
14059
|
+
this.dismiss.emit()
|
|
14060
|
+
})
|
|
13770
14061
|
private lastDuration: number
|
|
13771
14062
|
private hasChildren = false
|
|
13772
14063
|
|
|
@@ -13774,7 +14065,6 @@ export class Toast implements AfterViewInit, DoCheck, OnDestroy, HasElement<HTML
|
|
|
13774
14065
|
constructor() {
|
|
13775
14066
|
usePlacement((hasContent) => this.reconcile(hasContent))
|
|
13776
14067
|
useHostPresence(() => this.visible())
|
|
13777
|
-
this.remaining = this.duration
|
|
13778
14068
|
this.lastDuration = this.duration
|
|
13779
14069
|
}
|
|
13780
14070
|
|
|
@@ -13798,13 +14088,17 @@ export class Toast implements AfterViewInit, DoCheck, OnDestroy, HasElement<HTML
|
|
|
13798
14088
|
return styleText(this.style)
|
|
13799
14089
|
}
|
|
13800
14090
|
|
|
14091
|
+
/** The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`). */
|
|
13801
14092
|
molId(): string | undefined {
|
|
13802
14093
|
return this.automationId ?? this.dataMolId ?? this.host.getAttribute('data-mol-id') ?? undefined
|
|
13803
14094
|
}
|
|
13804
14095
|
|
|
13805
14096
|
/** The announced role: assertive for warnings/errors, polite otherwise. */
|
|
13806
|
-
role():
|
|
13807
|
-
return
|
|
14097
|
+
role(): string {
|
|
14098
|
+
return (
|
|
14099
|
+
this.roleOverride ??
|
|
14100
|
+
(this.variant() === 'warning' || this.variant() === 'error' ? 'alert' : 'status')
|
|
14101
|
+
)
|
|
13808
14102
|
}
|
|
13809
14103
|
|
|
13810
14104
|
/** The status glyph, when the variant has one. */
|
|
@@ -13835,62 +14129,38 @@ export class Toast implements AfterViewInit, DoCheck, OnDestroy, HasElement<HTML
|
|
|
13835
14129
|
|
|
13836
14130
|
/** Dismisses the toast and calls the callback (React's `handleDismiss`). */
|
|
13837
14131
|
handleDismiss(): void {
|
|
13838
|
-
this.
|
|
13839
|
-
|
|
14132
|
+
this.countdown.dismiss()
|
|
14133
|
+
}
|
|
14134
|
+
|
|
14135
|
+
/** Tracks the pointer's presence on the notification. */
|
|
14136
|
+
setHovered(hovered: boolean): void {
|
|
14137
|
+
this.countdown.setPaused('hover', hovered)
|
|
13840
14138
|
}
|
|
13841
14139
|
|
|
13842
|
-
/**
|
|
13843
|
-
|
|
13844
|
-
|
|
13845
|
-
const elapsed = Date.now() - this.startedAt
|
|
13846
|
-
this.remaining = Math.max(0, this.remaining - elapsed)
|
|
13847
|
-
this.clearTimer()
|
|
14140
|
+
/** Tracks focus anywhere inside the notification. */
|
|
14141
|
+
setFocused(focused: boolean): void {
|
|
14142
|
+
this.countdown.setPaused('focus', focused)
|
|
13848
14143
|
}
|
|
13849
14144
|
|
|
13850
|
-
|
|
13851
|
-
|
|
14145
|
+
/** Keeps the countdown paused when focus moves to another toast control. */
|
|
14146
|
+
leaveFocus(event: FocusEvent): void {
|
|
14147
|
+
if (!focusStaysWithin(event)) this.setFocused(false)
|
|
13852
14148
|
}
|
|
13853
14149
|
|
|
13854
14150
|
ngAfterViewInit(): void {
|
|
13855
|
-
this.
|
|
14151
|
+
this.countdown.start(this.duration)
|
|
13856
14152
|
}
|
|
13857
14153
|
|
|
13858
14154
|
ngDoCheck(): void {
|
|
13859
14155
|
if (this.duration !== this.lastDuration) {
|
|
13860
14156
|
this.lastDuration = this.duration
|
|
13861
|
-
this.
|
|
14157
|
+
this.countdown.start(this.duration)
|
|
13862
14158
|
}
|
|
13863
14159
|
}
|
|
13864
14160
|
|
|
13865
14161
|
/** Stops the countdown (React's unmount cleanup). */
|
|
13866
14162
|
ngOnDestroy(): void {
|
|
13867
|
-
this.
|
|
13868
|
-
}
|
|
13869
|
-
|
|
13870
|
-
/** React's effect body: reset the remaining time and start counting. */
|
|
13871
|
-
private restart(): void {
|
|
13872
|
-
this.remaining = this.duration
|
|
13873
|
-
this.startTimer(this.duration)
|
|
13874
|
-
}
|
|
13875
|
-
|
|
13876
|
-
/** Clears the running timer (React's `clearTimer`). */
|
|
13877
|
-
private clearTimer(): void {
|
|
13878
|
-
if (this.timer) {
|
|
13879
|
-
clearTimeout(this.timer)
|
|
13880
|
-
this.timer = undefined
|
|
13881
|
-
}
|
|
13882
|
-
this.startedAt = null
|
|
13883
|
-
}
|
|
13884
|
-
|
|
13885
|
-
/** Starts the countdown (React's `startTimer`). */
|
|
13886
|
-
private startTimer(ms: number): void {
|
|
13887
|
-
this.clearTimer()
|
|
13888
|
-
if (ms <= 0) return
|
|
13889
|
-
this.startedAt = Date.now()
|
|
13890
|
-
this.timer = setTimeout(() => {
|
|
13891
|
-
this.visible.set(false)
|
|
13892
|
-
this.dismiss.emit()
|
|
13893
|
-
}, ms)
|
|
14163
|
+
this.countdown.stop()
|
|
13894
14164
|
}
|
|
13895
14165
|
|
|
13896
14166
|
private reconcile(hasContent: SlotReader): void {
|
|
@@ -13919,7 +14189,7 @@ export class Toast implements AfterViewInit, DoCheck, OnDestroy, HasElement<HTML
|
|
|
13919
14189
|
}
|
|
13920
14190
|
```
|
|
13921
14191
|
|
|
13922
|
-
_(Member comments are shortened to their first sentence, and the
|
|
14192
|
+
_(Member comments are shortened to their first sentence, and the 8 longest are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/toast.component.d.ts`.)_
|
|
13923
14193
|
|
|
13924
14194
|
#### `ToastContainer`
|
|
13925
14195
|
|
|
@@ -14021,6 +14291,8 @@ children now belong to.
|
|
|
14021
14291
|
[testId]="toast.testId"
|
|
14022
14292
|
[automationId]="toast.automationId"
|
|
14023
14293
|
[id]="toast.id"
|
|
14294
|
+
[role]="toast.role"
|
|
14295
|
+
[aria-live]="toast['aria-live']"
|
|
14024
14296
|
(dismiss)="removeToast(toast.id)"
|
|
14025
14297
|
></div>
|
|
14026
14298
|
}
|
|
@@ -14116,6 +14388,11 @@ React's. A single-element trigger receives `aria-describedby` while the
|
|
|
14116
14388
|
tooltip shows; show/hide are coordinated across instances exactly like
|
|
14117
14389
|
React's module-level `activeTooltips` map.
|
|
14118
14390
|
|
|
14391
|
+
Projected content is created with the consumer's view, so a tooltip's `[slot=content]` exists
|
|
14392
|
+
while hidden: its components, effects and fetches run. React mounts it only while shown, and
|
|
14393
|
+
again each time it shows. Write content with state as `*molLazy` (`MolLazy` from
|
|
14394
|
+
`@molecule/app-angular`): it is created when it shows and destroyed when it hides, as React's is.
|
|
14395
|
+
|
|
14119
14396
|
```typescript
|
|
14120
14397
|
@Component({
|
|
14121
14398
|
selector: 'mol-tooltip',
|
|
@@ -14208,14 +14485,12 @@ export class Tooltip
|
|
|
14208
14485
|
private showTimer: ReturnType<typeof setTimeout> | undefined
|
|
14209
14486
|
private hideTimer: ReturnType<typeof setTimeout> | undefined
|
|
14210
14487
|
private readonly hideListener = (): void => this.hide()
|
|
14211
|
-
private readonly
|
|
14212
|
-
|
|
14213
|
-
}
|
|
14214
|
-
private escapeBound = false
|
|
14488
|
+
private readonly layer = new OverlayLayer()
|
|
14489
|
+
private owner?: Document
|
|
14215
14490
|
private lastVisible = false
|
|
14216
14491
|
private lastContentText: string | null = null
|
|
14217
14492
|
private lastPlacement: TooltipPlacement | null = null
|
|
14218
|
-
private associateEl:
|
|
14493
|
+
private associateEl: Element | null = null
|
|
14219
14494
|
private externalMolId: string | undefined
|
|
14220
14495
|
|
|
14221
14496
|
constructor() {
|
|
@@ -14232,8 +14507,7 @@ export class Tooltip
|
|
|
14232
14507
|
placeContent(capture, wrap)
|
|
14233
14508
|
setElementPresent(capture, false)
|
|
14234
14509
|
const children = hasContent.nodes(capture)
|
|
14235
|
-
const only =
|
|
14236
|
-
children.length === 1 && children[0].nodeType === 1 ? (children[0] as HTMLElement) : null
|
|
14510
|
+
const only = children.length === 1 ? slotElement(children[0]) : null
|
|
14237
14511
|
if (only === this.associateEl) return
|
|
14238
14512
|
if (this.visible()) {
|
|
14239
14513
|
this.associateEl?.removeAttribute('aria-describedby')
|
|
@@ -14277,10 +14551,13 @@ export class Tooltip
|
|
|
14277
14551
|
}
|
|
14278
14552
|
|
|
14279
14553
|
show(): void {
|
|
14280
|
-
|
|
14281
|
-
|
|
14554
|
+
const doc = this.triggerWrap?.nativeElement.ownerDocument
|
|
14555
|
+
if (doc) {
|
|
14556
|
+
this.releaseOwner()
|
|
14557
|
+
this.owner = doc
|
|
14558
|
+
const previous = activeTooltips.get(doc)
|
|
14282
14559
|
if (previous !== this.hideListener) previous?.()
|
|
14283
|
-
activeTooltips.set(
|
|
14560
|
+
activeTooltips.set(doc, this.hideListener)
|
|
14284
14561
|
}
|
|
14285
14562
|
clearTimeout(this.hideTimer)
|
|
14286
14563
|
clearTimeout(this.showTimer)
|
|
@@ -14298,9 +14575,7 @@ export class Tooltip
|
|
|
14298
14575
|
hide(): void {
|
|
14299
14576
|
clearTimeout(this.showTimer)
|
|
14300
14577
|
clearTimeout(this.hideTimer)
|
|
14301
|
-
|
|
14302
|
-
activeTooltips.delete(document)
|
|
14303
|
-
}
|
|
14578
|
+
this.releaseOwner()
|
|
14304
14579
|
this.visible.set(false)
|
|
14305
14580
|
this.cdr.markForCheck()
|
|
14306
14581
|
}
|
|
@@ -14324,7 +14599,7 @@ export class Tooltip
|
|
|
14324
14599
|
}
|
|
14325
14600
|
|
|
14326
14601
|
handleKeyDown(event: KeyboardEvent): void {
|
|
14327
|
-
if (event.key === 'Escape') this.hide()
|
|
14602
|
+
if (!this.visible() && event.key === 'Escape') this.hide()
|
|
14328
14603
|
}
|
|
14329
14604
|
|
|
14330
14605
|
ngAfterViewInit(): void {
|
|
@@ -14362,24 +14637,34 @@ export class Tooltip
|
|
|
14362
14637
|
ngOnDestroy(): void {
|
|
14363
14638
|
clearTimeout(this.showTimer)
|
|
14364
14639
|
clearTimeout(this.hideTimer)
|
|
14365
|
-
|
|
14366
|
-
|
|
14367
|
-
}
|
|
14368
|
-
if (this.escapeBound) document.removeEventListener('keydown', this.escapeListener)
|
|
14640
|
+
this.releaseOwner()
|
|
14641
|
+
this.layer.release()
|
|
14369
14642
|
this.associateEl = null
|
|
14370
14643
|
}
|
|
14371
14644
|
|
|
14645
|
+
private releaseOwner(): void {
|
|
14646
|
+
if (this.owner && activeTooltips.get(this.owner) === this.hideListener)
|
|
14647
|
+
activeTooltips.delete(this.owner)
|
|
14648
|
+
this.owner = undefined
|
|
14649
|
+
}
|
|
14650
|
+
|
|
14372
14651
|
private attachPortal(): void {
|
|
14373
14652
|
const portal = this.portalWrap?.nativeElement
|
|
14374
|
-
|
|
14375
|
-
|
|
14376
|
-
|
|
14653
|
+
const trigger = this.triggerWrap?.nativeElement
|
|
14654
|
+
if (!portal || !trigger) return
|
|
14655
|
+
placeElement(portal, trigger.ownerDocument.body)
|
|
14656
|
+
const surface = this.contentEl?.nativeElement ?? null
|
|
14657
|
+
this.inner.set(surface)
|
|
14377
14658
|
this.updatePosition()
|
|
14378
14659
|
this.associateEl?.setAttribute('aria-describedby', this.boxId())
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
-
|
|
14382
|
-
|
|
14660
|
+
this.layer.sync({
|
|
14661
|
+
open: true,
|
|
14662
|
+
kind: 'tooltip',
|
|
14663
|
+
surface: { current: surface },
|
|
14664
|
+
anchor: { current: trigger },
|
|
14665
|
+
dismissKey: true,
|
|
14666
|
+
onDismiss: this.hideListener,
|
|
14667
|
+
})
|
|
14383
14668
|
}
|
|
14384
14669
|
// … truncated — 2 more members: detachPortal, updatePosition; the full declaration is in node_modules/@molecule/app-ui-angular/dist/components/tooltip.component.d.ts
|
|
14385
14670
|
```
|
|
@@ -14423,8 +14708,11 @@ export class UserMenuPopover implements AfterViewInit, DoCheck, OnDestroy {
|
|
|
14423
14708
|
|
|
14424
14709
|
private readonly host: ElementRef<HTMLElement> = inject(ElementRef)
|
|
14425
14710
|
private readonly cdr = inject(ChangeDetectorRef)
|
|
14426
|
-
private
|
|
14427
|
-
private
|
|
14711
|
+
private readonly layer = new OverlayLayer()
|
|
14712
|
+
private readonly close = (): void => {
|
|
14713
|
+
this.isOpen.set(false)
|
|
14714
|
+
this.cdr.markForCheck()
|
|
14715
|
+
}
|
|
14428
14716
|
private lastOpen = false
|
|
14429
14717
|
private lastRoute: string | null = null
|
|
14430
14718
|
/** Closes the popover on any route change (React's location effect). */
|
|
@@ -14482,60 +14770,34 @@ export class UserMenuPopover implements AfterViewInit, DoCheck, OnDestroy {
|
|
|
14482
14770
|
this.cdr.markForCheck()
|
|
14483
14771
|
}
|
|
14484
14772
|
|
|
14485
|
-
/**
|
|
14773
|
+
/** Observes the host window's history, including navigation to the same URL. */
|
|
14486
14774
|
ngAfterViewInit(): void {
|
|
14487
|
-
|
|
14488
|
-
this.isOpen.set(false)
|
|
14489
|
-
this.lastOpen = false
|
|
14775
|
+
this.host.nativeElement.ownerDocument.defaultView?.addEventListener('popstate', this.close)
|
|
14490
14776
|
}
|
|
14491
14777
|
|
|
14492
|
-
/**
|
|
14778
|
+
/** Registers the mounted disclosure with the document stack while open. */
|
|
14493
14779
|
ngDoCheck(): void {
|
|
14494
14780
|
const open = this.isOpen()
|
|
14495
|
-
if (open
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14781
|
+
if (open === this.lastOpen) return
|
|
14782
|
+
this.lastOpen = open
|
|
14783
|
+
const target = { current: this.host.nativeElement }
|
|
14784
|
+
this.layer.sync({
|
|
14785
|
+
open,
|
|
14786
|
+
kind: 'popover',
|
|
14787
|
+
surface: target,
|
|
14788
|
+
anchor: target,
|
|
14789
|
+
dismissKey: true,
|
|
14790
|
+
outside: { inside: [target], phase: 'start' },
|
|
14791
|
+
onDismiss: this.close,
|
|
14792
|
+
})
|
|
14500
14793
|
}
|
|
14501
14794
|
|
|
14502
14795
|
/** Removes listeners and the context registration (unmount). */
|
|
14503
14796
|
ngOnDestroy(): void {
|
|
14504
|
-
this.
|
|
14797
|
+
this.host.nativeElement.ownerDocument.defaultView?.removeEventListener('popstate', this.close)
|
|
14798
|
+
this.layer.release()
|
|
14505
14799
|
PopoverDomContext.remove(this.host.nativeElement)
|
|
14506
14800
|
}
|
|
14507
|
-
|
|
14508
|
-
/** Adds the outside-click and Escape dismiss listeners while open. */
|
|
14509
|
-
private addDocumentListeners(): void {
|
|
14510
|
-
this.removeDocumentListeners()
|
|
14511
|
-
if (this.openListener) return
|
|
14512
|
-
this.openListener = true
|
|
14513
|
-
const onMouseDown = (event: MouseEvent): void => {
|
|
14514
|
-
if (!this.host.nativeElement.contains(event.target as Node)) {
|
|
14515
|
-
this.isOpen.set(false)
|
|
14516
|
-
this.cdr.markForCheck()
|
|
14517
|
-
}
|
|
14518
|
-
}
|
|
14519
|
-
const onKeyDown = (event: KeyboardEvent): void => {
|
|
14520
|
-
if (event.key === 'Escape') {
|
|
14521
|
-
this.isOpen.set(false)
|
|
14522
|
-
this.cdr.markForCheck()
|
|
14523
|
-
}
|
|
14524
|
-
}
|
|
14525
|
-
document.addEventListener('mousedown', onMouseDown)
|
|
14526
|
-
document.addEventListener('keydown', onKeyDown)
|
|
14527
|
-
this.listeners.push(
|
|
14528
|
-
() => document.removeEventListener('mousedown', onMouseDown),
|
|
14529
|
-
() => document.removeEventListener('keydown', onKeyDown),
|
|
14530
|
-
)
|
|
14531
|
-
}
|
|
14532
|
-
|
|
14533
|
-
/** Removes the document listeners. */
|
|
14534
|
-
private removeDocumentListeners(): void {
|
|
14535
|
-
for (const off of this.listeners) off()
|
|
14536
|
-
this.listeners = []
|
|
14537
|
-
this.openListener = false
|
|
14538
|
-
}
|
|
14539
14801
|
}
|
|
14540
14802
|
```
|
|
14541
14803
|
|
|
@@ -14712,6 +14974,11 @@ and a `<nav>` wrapping the caller's items. The host element is the card
|
|
|
14712
14974
|
(React's one `<div>`), and it is out of the DOM while the popover is closed
|
|
14713
14975
|
(React renders `null`).
|
|
14714
14976
|
|
|
14977
|
+
Projected content is created with the consumer's view, so a closed popover's items exist while
|
|
14978
|
+
hidden: their components, effects and fetches run. React mounts them only while shown, and again
|
|
14979
|
+
each time they show. Write content with state as `*molLazy` (`MolLazy` from
|
|
14980
|
+
`@molecule/app-angular`): it is created when it shows and destroyed when it hides, as React's is.
|
|
14981
|
+
|
|
14715
14982
|
```typescript
|
|
14716
14983
|
@Component({
|
|
14717
14984
|
selector: 'div[mol-user-menu-popover-panel]',
|
|
@@ -15099,7 +15366,7 @@ The rules are React's spread:
|
|
|
15099
15366
|
suffix → capture phase, `onDoubleClick` → `dblclick`); a non-function
|
|
15100
15367
|
value removes the listener, and so does dropping the key.
|
|
15101
15368
|
- `className` and `class` compose into one `class` attribute with `cn`.
|
|
15102
|
-
- An object `style` is serialized with `
|
|
15369
|
+
- An object `style` is serialized with `reactStyleText`.
|
|
15103
15370
|
- Every other key becomes an attribute: `null`/`undefined` removes it,
|
|
15104
15371
|
`false` removes it (except text booleans, which write `"false"`), and
|
|
15105
15372
|
`true` writes `""` (text booleans write `"true"`). Any other value is
|
|
@@ -15144,7 +15411,7 @@ class ElementPropsWriter {
|
|
|
15144
15411
|
if (skip?.has(key)) continue
|
|
15145
15412
|
if (key === 'className' || key === 'class') continue
|
|
15146
15413
|
if (key === 'style') {
|
|
15147
|
-
next.set('style',
|
|
15414
|
+
next.set('style', reactStyleText(value, ' '))
|
|
15148
15415
|
continue
|
|
15149
15416
|
}
|
|
15150
15417
|
next.set(key, value)
|
|
@@ -15320,6 +15587,112 @@ export class MolIconSvg implements OnChanges {
|
|
|
15320
15587
|
}
|
|
15321
15588
|
```
|
|
15322
15589
|
|
|
15590
|
+
#### `WebDragDirective`
|
|
15591
|
+
|
|
15592
|
+
Binds an HTML or SVG element to the web kits' shared drag gesture. Import
|
|
15593
|
+
`WebDragDirective` into a standalone component and bind `[molDrag]="handlers"`.
|
|
15594
|
+
Pass undefined to disable the gesture.
|
|
15595
|
+
|
|
15596
|
+
```typescript
|
|
15597
|
+
@Directive({
|
|
15598
|
+
selector: '[molDrag]',
|
|
15599
|
+
standalone: true,
|
|
15600
|
+
host: { '(pointerdown)': 'onPointerDown($event)' },
|
|
15601
|
+
})
|
|
15602
|
+
export class WebDragDirective implements OnDestroy {
|
|
15603
|
+
private readonly host = inject<ElementRef<HTMLElement | SVGElement>>(ElementRef).nativeElement
|
|
15604
|
+
private readonly gesture = createWebDrag()
|
|
15605
|
+
|
|
15606
|
+
/** The current handlers for this host. */
|
|
15607
|
+
@Input()
|
|
15608
|
+
set molDrag(drag: ElementDrag | undefined) {
|
|
15609
|
+
this.gesture.update(drag)
|
|
15610
|
+
}
|
|
15611
|
+
|
|
15612
|
+
/**
|
|
15613
|
+
* Offers a primary pointer press to this directive's element.
|
|
15614
|
+
*
|
|
15615
|
+
* @param event - The native bubbling pointer event.
|
|
15616
|
+
*/
|
|
15617
|
+
onPointerDown(event: PointerEvent): void {
|
|
15618
|
+
this.gesture.start(this.host, event)
|
|
15619
|
+
}
|
|
15620
|
+
|
|
15621
|
+
/** Cancels the gesture when Angular destroys its host. */
|
|
15622
|
+
ngOnDestroy(): void {
|
|
15623
|
+
this.gesture.cancel()
|
|
15624
|
+
}
|
|
15625
|
+
}
|
|
15626
|
+
```
|
|
15627
|
+
|
|
15628
|
+
#### `WebHoverDirective`
|
|
15629
|
+
|
|
15630
|
+
Handles shared mouse and pen hover. Import `WebHoverDirective` into a
|
|
15631
|
+
standalone component, add `molHover` to the host and listen for
|
|
15632
|
+
`(molHoverEnter)` and `(molHoverLeave)`. Bind `[molHover]="false"`
|
|
15633
|
+
to disable hover.
|
|
15634
|
+
|
|
15635
|
+
```typescript
|
|
15636
|
+
@Directive({
|
|
15637
|
+
selector: '[molHover]',
|
|
15638
|
+
standalone: true,
|
|
15639
|
+
outputs: ['molHoverEnter', 'molHoverLeave'],
|
|
15640
|
+
})
|
|
15641
|
+
export class WebHoverDirective implements OnDestroy {
|
|
15642
|
+
/** Emits when a mouse or pen enters the host. */
|
|
15643
|
+
readonly molHoverEnter = new EventEmitter<MouseEvent>()
|
|
15644
|
+
|
|
15645
|
+
/** Emits when the hovering mouse or pen leaves the host. */
|
|
15646
|
+
readonly molHoverLeave = new EventEmitter<MouseEvent>()
|
|
15647
|
+
|
|
15648
|
+
private readonly binding = bindWebHover(
|
|
15649
|
+
inject<ElementRef<HTMLElement | SVGElement>>(ElementRef).nativeElement,
|
|
15650
|
+
)
|
|
15651
|
+
|
|
15652
|
+
private readonly handlers = {
|
|
15653
|
+
onEnter: (event: MouseEvent) => this.molHoverEnter.emit(event),
|
|
15654
|
+
onLeave: (event: MouseEvent) => this.molHoverLeave.emit(event),
|
|
15655
|
+
}
|
|
15656
|
+
|
|
15657
|
+
/** Enables the gesture on this host. */
|
|
15658
|
+
@Input({ transform: booleanAttribute })
|
|
15659
|
+
set molHover(enabled: boolean) {
|
|
15660
|
+
this.binding.update(enabled ? this.handlers : undefined)
|
|
15661
|
+
}
|
|
15662
|
+
|
|
15663
|
+
/** Removes the hover listeners when Angular destroys the host. */
|
|
15664
|
+
ngOnDestroy(): void {
|
|
15665
|
+
this.binding.destroy()
|
|
15666
|
+
}
|
|
15667
|
+
}
|
|
15668
|
+
```
|
|
15669
|
+
|
|
15670
|
+
#### `WebWheelZoomDirective`
|
|
15671
|
+
|
|
15672
|
+
Handles shared Ctrl-wheel zoom steps. Import `WebWheelZoomDirective`
|
|
15673
|
+
into a standalone component and bind `[molWheelZoom]="onStep"`.
|
|
15674
|
+
Pass undefined to leave the wheel to the browser.
|
|
15675
|
+
|
|
15676
|
+
```typescript
|
|
15677
|
+
@Directive({ selector: '[molWheelZoom]', standalone: true })
|
|
15678
|
+
export class WebWheelZoomDirective implements OnDestroy {
|
|
15679
|
+
private readonly binding = bindWebWheelZoom(
|
|
15680
|
+
inject<ElementRef<HTMLElement | SVGElement>>(ElementRef).nativeElement,
|
|
15681
|
+
)
|
|
15682
|
+
|
|
15683
|
+
/** Sets the callback that receives each handled zoom step. */
|
|
15684
|
+
@Input()
|
|
15685
|
+
set molWheelZoom(onStep: WebWheelZoomHandler | undefined) {
|
|
15686
|
+
this.binding.update(onStep)
|
|
15687
|
+
}
|
|
15688
|
+
|
|
15689
|
+
/** Removes the wheel listener when Angular destroys the host. */
|
|
15690
|
+
ngOnDestroy(): void {
|
|
15691
|
+
this.binding.destroy()
|
|
15692
|
+
}
|
|
15693
|
+
}
|
|
15694
|
+
```
|
|
15695
|
+
|
|
15323
15696
|
### Functions
|
|
15324
15697
|
|
|
15325
15698
|
#### `hasNodes(el)` _(deprecated)_
|
|
@@ -15525,6 +15898,20 @@ function hostElement<E extends Element>(host: ElementRef<E>): Signal<E | null>
|
|
|
15525
15898
|
|
|
15526
15899
|
**Returns:** A read-only signal holding the host element.
|
|
15527
15900
|
|
|
15901
|
+
#### `elementTarget(read)`
|
|
15902
|
+
|
|
15903
|
+
A target that reads an element each time an overlay asks for it, such as a Modal's
|
|
15904
|
+
`initialFocus` naming a control in the dialog's content. A class field can build it, since the
|
|
15905
|
+
arrow keeps `this`: `readonly emailTarget = elementTarget(() => this.email?.nativeElement)`.
|
|
15906
|
+
|
|
15907
|
+
```typescript
|
|
15908
|
+
function elementTarget(read: () => ElementHandle | null | undefined): OverlayTarget
|
|
15909
|
+
```
|
|
15910
|
+
|
|
15911
|
+
- `read` — Returns the element, or `null` or `undefined` while it is not rendered.
|
|
15912
|
+
|
|
15913
|
+
**Returns:** The target, whose `current` is the element or `null`.
|
|
15914
|
+
|
|
15528
15915
|
#### `getFocusableElements(container)`
|
|
15529
15916
|
|
|
15530
15917
|
Returns the tab-stop elements inside a container, in DOM (tab) order.
|
|
@@ -15805,34 +16192,18 @@ function adoptHostDataMolId(
|
|
|
15805
16192
|
- `store` — Keeps the taken host id for the component's `molId()`.
|
|
15806
16193
|
- `molId` — The id the component renders, read after `store`.
|
|
15807
16194
|
|
|
15808
|
-
#### `kebab(key)`
|
|
15809
|
-
|
|
15810
|
-
Converts a camelCase CSS property name to kebab-case.
|
|
15811
|
-
|
|
15812
|
-
```typescript
|
|
15813
|
-
function kebab(key: string): string
|
|
15814
|
-
```
|
|
15815
|
-
|
|
15816
|
-
- `key` — The camelCase property name.
|
|
15817
|
-
|
|
15818
|
-
**Returns:** The kebab-case CSS property name.
|
|
15819
|
-
|
|
15820
16195
|
#### `styleText(style)`
|
|
15821
16196
|
|
|
15822
|
-
Serializes a React-
|
|
15823
|
-
|
|
15824
|
-
unitless, and declaration order follows object key order (the conformance
|
|
15825
|
-
normalizer sorts declarations anyway). A shorthand and a longhand it covers
|
|
15826
|
-
that Angular's sorted style binding would apply out of order come back
|
|
15827
|
-
resolved, as the CSSOM applies them in object order.
|
|
16197
|
+
Serializes a React-shaped style object for Angular's `[style]` binding.
|
|
16198
|
+
Resolves overlapping properties that Angular would apply out of order.
|
|
15828
16199
|
|
|
15829
16200
|
```typescript
|
|
15830
16201
|
function styleText(style: Record<string, unknown> | undefined | null): string | null
|
|
15831
16202
|
```
|
|
15832
16203
|
|
|
15833
|
-
- `style` — The style object
|
|
16204
|
+
- `style` — The style object, or an absent value.
|
|
15834
16205
|
|
|
15835
|
-
**Returns:**
|
|
16206
|
+
**Returns:** CSS declaration text, or null when there are no declarations.
|
|
15836
16207
|
|
|
15837
16208
|
#### `cn(inputs)`
|
|
15838
16209
|
|
|
@@ -15846,6 +16217,44 @@ function cn(...inputs: (string | undefined | null | false)[]): string
|
|
|
15846
16217
|
|
|
15847
16218
|
**Returns:** The resulting string.
|
|
15848
16219
|
|
|
16220
|
+
#### `kebab(name)`
|
|
16221
|
+
|
|
16222
|
+
Converts a React property name to its CSS spelling.
|
|
16223
|
+
|
|
16224
|
+
```typescript
|
|
16225
|
+
function kebab(name: string): string
|
|
16226
|
+
```
|
|
16227
|
+
|
|
16228
|
+
- `name` — A camelCase, vendor-prefixed or custom property name.
|
|
16229
|
+
|
|
16230
|
+
**Returns:** The CSS property name.
|
|
16231
|
+
|
|
16232
|
+
#### `reactStyleText(style, space)`
|
|
16233
|
+
|
|
16234
|
+
Serializes a React-shaped style object as React DOM's style attribute value.
|
|
16235
|
+
The renderer escapes the value when it writes HTML.
|
|
16236
|
+
|
|
16237
|
+
```typescript
|
|
16238
|
+
function reactStyleText(style: unknown, space?: '' | ' '): string | undefined
|
|
16239
|
+
```
|
|
16240
|
+
|
|
16241
|
+
- `style` — The style object, or an absent value.
|
|
16242
|
+
- `space` — An optional space after separators for existing bindings that use spaced CSS.
|
|
16243
|
+
|
|
16244
|
+
**Returns:** The CSS declaration text, or undefined when there are no declarations.
|
|
16245
|
+
|
|
16246
|
+
#### `toStyleProps(style)`
|
|
16247
|
+
|
|
16248
|
+
Normalizes a React-shaped style object for renderers that accept a CSS property map.
|
|
16249
|
+
|
|
16250
|
+
```typescript
|
|
16251
|
+
function toStyleProps(style: unknown): Record<string, string> | undefined
|
|
16252
|
+
```
|
|
16253
|
+
|
|
16254
|
+
- `style` — The style object, or an absent value.
|
|
16255
|
+
|
|
16256
|
+
**Returns:** CSS property names and string values, or undefined for an absent object.
|
|
16257
|
+
|
|
15849
16258
|
### Constants
|
|
15850
16259
|
|
|
15851
16260
|
#### `FOCUSABLE_SELECTOR`
|
|
@@ -15873,10 +16282,11 @@ Peer dependencies:
|
|
|
15873
16282
|
- `@angular/common` ^22.0.0
|
|
15874
16283
|
- `@angular/core` ^22.0.0
|
|
15875
16284
|
- `@angular/platform-browser` ^22.0.0
|
|
15876
|
-
- `@molecule/app-angular` ^3.
|
|
16285
|
+
- `@molecule/app-angular` ^3.16.1
|
|
16286
|
+
- `@molecule/app-filesystem` ^1.1.0
|
|
15877
16287
|
- `@molecule/app-i18n` ^1.0.1
|
|
15878
16288
|
- `@molecule/app-icons` ^1.0.1
|
|
15879
|
-
- `@molecule/app-ui` ^1.
|
|
16289
|
+
- `@molecule/app-ui` ^1.12.0
|
|
15880
16290
|
|
|
15881
16291
|
### Runtime Dependencies
|
|
15882
16292
|
|
|
@@ -15884,8 +16294,12 @@ Peer dependencies:
|
|
|
15884
16294
|
- `@angular/core`
|
|
15885
16295
|
- `@angular/platform-browser`
|
|
15886
16296
|
- `@molecule/app-angular`
|
|
16297
|
+
- `@molecule/app-filesystem`
|
|
15887
16298
|
- `@molecule/app-i18n`
|
|
15888
16299
|
- `@molecule/app-icons`
|
|
16300
|
+
- `@molecule/app-inline-style-dom`
|
|
16301
|
+
- `@molecule/app-overlay-dom`
|
|
16302
|
+
- `@molecule/app-pointer-events-dom`
|
|
15889
16303
|
- `@molecule/app-ui`
|
|
15890
16304
|
|
|
15891
16305
|
- **`setClassMap()` must run before any component renders** — every component resolves its
|
|
@@ -15906,6 +16320,10 @@ Peer dependencies:
|
|
|
15906
16320
|
- The original first-pass components remain exported under their `Molecule*` names
|
|
15907
16321
|
(`MoleculeButton`, `MoleculeInput`, `MoleculeModal`, …) as deprecated aliases.
|
|
15908
16322
|
|
|
16323
|
+
Import `WebDragDirective`, `WebHoverDirective`, or `WebWheelZoomDirective` into a
|
|
16324
|
+
standalone component. Bind `[molDrag]` or `[molWheelZoom]` to the current handler,
|
|
16325
|
+
or add `molHover` and listen for `(molHoverEnter)` and `(molHoverLeave)`.
|
|
16326
|
+
|
|
15909
16327
|
## Translations
|
|
15910
16328
|
|
|
15911
16329
|
Translation strings are provided by `@molecule/app-locales-ui`.
|