@symbiote-native/angular 1.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -10
- package/babel-register-composed.cjs +41 -19
- package/bin/symbiote-angular-dev.cjs +16 -4
- package/build/angular/anchor-host-registry.js +1 -17
- package/build/angular/anchor-host-registry.js.map +1 -1
- package/build/angular/change-detection-flush.d.ts +31 -0
- package/build/angular/change-detection-flush.js +110 -0
- package/build/angular/change-detection-flush.js.map +1 -0
- package/build/angular/components/activity-indicator-props.d.ts +2 -0
- package/build/angular/components/activity-indicator-props.js +2 -0
- package/build/angular/components/activity-indicator-props.js.map +1 -0
- package/build/angular/components/button-props.d.ts +2 -0
- package/build/angular/components/button-props.js +2 -0
- package/build/angular/components/button-props.js.map +1 -0
- package/build/angular/components/flat-list/index.d.ts +2 -1
- package/build/angular/components/flat-list/index.js +22 -10
- package/build/angular/components/flat-list/index.js.map +1 -1
- package/build/angular/components/image-background-props.d.ts +6 -0
- package/build/angular/components/image-background-props.js +2 -0
- package/build/angular/components/image-background-props.js.map +1 -0
- package/build/angular/components/{image/shared.d.ts → image-shared.d.ts} +1 -1
- package/build/angular/components/{image/shared.js → image-shared.js} +7 -2
- package/build/angular/components/image-shared.js.map +1 -0
- package/build/angular/components/input-accessory-view-props.d.ts +7 -0
- package/build/angular/components/input-accessory-view-props.js +9 -0
- package/build/angular/components/input-accessory-view-props.js.map +1 -0
- package/build/angular/components/keyboard-avoiding-view/index.js +11 -17
- package/build/angular/components/keyboard-avoiding-view/index.js.map +1 -1
- package/build/angular/components/modal/index.d.ts +1 -0
- package/build/angular/components/modal/index.js +19 -12
- package/build/angular/components/modal/index.js.map +1 -1
- package/build/angular/components/pressable-props.d.ts +32 -0
- package/build/angular/components/pressable-props.js +11 -0
- package/build/angular/components/pressable-props.js.map +1 -0
- package/build/angular/components/refresh-control-props.d.ts +16 -0
- package/build/angular/components/refresh-control-props.js +14 -0
- package/build/angular/components/refresh-control-props.js.map +1 -0
- package/build/angular/components/safe-area-view-props.d.ts +7 -0
- package/build/angular/components/safe-area-view-props.js +11 -0
- package/build/angular/components/safe-area-view-props.js.map +1 -0
- package/build/angular/components/scroll-view-props.d.ts +76 -0
- package/build/angular/components/scroll-view-props.js +18 -0
- package/build/angular/components/scroll-view-props.js.map +1 -0
- package/build/angular/components/text-input-props.d.ts +45 -0
- package/build/angular/components/text-input-props.js +18 -0
- package/build/angular/components/text-input-props.js.map +1 -0
- package/build/angular/components/touchable-native-feedback/touchable-native-feedback-props.d.ts +6 -0
- package/build/angular/components/touchable-native-feedback/touchable-native-feedback-props.js +2 -0
- package/build/angular/components/touchable-native-feedback/touchable-native-feedback-props.js.map +1 -0
- package/build/angular/components/touchable-props.d.ts +14 -0
- package/build/angular/components/touchable-props.js +13 -0
- package/build/angular/components/touchable-props.js.map +1 -0
- package/build/angular/components/touchable-without-feedback/touchable-without-feedback-props.d.ts +3 -0
- package/build/angular/components/touchable-without-feedback/touchable-without-feedback-props.js +2 -0
- package/build/angular/components/touchable-without-feedback/touchable-without-feedback-props.js.map +1 -0
- package/build/angular/components/virtualized-list/index.d.ts +5 -1
- package/build/angular/components/virtualized-list/index.js +366 -280
- package/build/angular/components/virtualized-list/index.js.map +1 -1
- package/build/angular/components.d.ts +20 -26
- package/build/angular/components.js +12 -14
- package/build/angular/components.js.map +1 -1
- package/build/angular/create-portal/index.d.ts +2 -2
- package/build/angular/create-portal/index.js +5 -5
- package/build/angular/create-tunnel/index.js +1 -1
- package/build/angular/element-props.d.ts +53 -0
- package/build/angular/element-props.js +2 -0
- package/build/angular/element-props.js.map +1 -0
- package/build/angular/elements.d.ts +528 -0
- package/build/angular/elements.js +1444 -0
- package/build/angular/elements.js.map +1 -0
- package/build/angular/host-instance/index.js +1 -1
- package/build/angular/index.d.ts +4 -2
- package/build/angular/index.js +15 -1
- package/build/angular/index.js.map +1 -1
- package/build/angular/modules/animated/create-animated-component.d.ts +5 -6
- package/build/angular/modules/animated/create-animated-component.js +60 -73
- package/build/angular/modules/animated/create-animated-component.js.map +1 -1
- package/build/angular/modules/animated/index.js +1 -1
- package/build/angular/modules/animated/index.js.map +1 -1
- package/build/angular/modules/image/index.d.ts +3 -0
- package/build/angular/modules/image/index.js +16 -0
- package/build/angular/modules/image/index.js.map +1 -0
- package/build/angular/primitives/index.d.ts +18 -18
- package/build/angular/primitives/index.js +40 -36
- package/build/angular/primitives/index.js.map +1 -1
- package/build/angular/primitives/shared.d.ts +2 -3
- package/build/angular/primitives/shared.js +8 -53
- package/build/angular/primitives/shared.js.map +1 -1
- package/build/angular/register.d.ts +1 -1
- package/build/angular/register.js +12 -31
- package/build/angular/register.js.map +1 -1
- package/build/angular/render/index.js +3 -3
- package/build/angular/render/index.js.map +1 -1
- package/build/angular/renderer/index.js +113 -67
- package/build/angular/renderer/index.js.map +1 -1
- package/build/angular/renderer/value-change.d.ts +2 -0
- package/build/angular/renderer/value-change.js +9 -0
- package/build/angular/renderer/value-change.js.map +1 -0
- package/metro-config.cjs +54 -20
- package/metro-css-parser.cjs +2 -1
- package/package.json +5 -14
- package/src/anchor-host-registry.ts +1 -17
- package/src/change-detection-flush.ts +120 -0
- package/src/components/activity-indicator-props.ts +21 -0
- package/src/components/button-props.ts +26 -0
- package/src/components/flat-list/index.ts +12 -4
- package/src/components/image-background-props.ts +24 -0
- package/src/components/{image/shared.ts → image-shared.ts} +6 -1
- package/src/components/input-accessory-view-props.ts +21 -0
- package/src/components/keyboard-avoiding-view/index.ts +6 -9
- package/src/components/modal/index.ts +15 -7
- package/src/components/pressable-props.ts +73 -0
- package/src/components/refresh-control-props.ts +43 -0
- package/src/components/safe-area-view-props.ts +28 -0
- package/src/components/scroll-view-props.ts +109 -0
- package/src/components/text-input-props.ts +72 -0
- package/src/components/touchable-native-feedback/touchable-native-feedback-props.ts +23 -0
- package/src/components/touchable-props.ts +30 -0
- package/src/components/touchable-without-feedback/touchable-without-feedback-props.ts +21 -0
- package/src/components/virtualized-list/index.ts +239 -156
- package/src/components.ts +84 -35
- package/src/create-portal/index.ts +5 -5
- package/src/create-tunnel/index.ts +1 -1
- package/src/diagnostics.ts +1 -1
- package/src/element-props.ts +90 -0
- package/src/elements.ts +919 -0
- package/src/host-instance/index.ts +1 -1
- package/src/index.ts +52 -15
- package/src/modules/animated/create-animated-component.ts +50 -55
- package/src/modules/animated/index.ts +1 -1
- package/src/modules/image/index.ts +18 -0
- package/src/primitives/index.ts +22 -18
- package/src/primitives/shared.ts +11 -44
- package/src/register.ts +12 -40
- package/src/render/index.ts +3 -3
- package/src/renderer/index.ts +122 -73
- package/src/renderer/value-change.ts +8 -0
- package/babel-lower-host-primitives.cjs +0 -636
- package/build/angular/components/activity-indicator/index.android.d.ts +0 -13
- package/build/angular/components/activity-indicator/index.android.js +0 -29
- package/build/angular/components/activity-indicator/index.android.js.map +0 -1
- package/build/angular/components/activity-indicator/index.d.ts +0 -1
- package/build/angular/components/activity-indicator/index.ios.d.ts +0 -9
- package/build/angular/components/activity-indicator/index.ios.js +0 -26
- package/build/angular/components/activity-indicator/index.ios.js.map +0 -1
- package/build/angular/components/activity-indicator/index.js +0 -4
- package/build/angular/components/activity-indicator/index.js.map +0 -1
- package/build/angular/components/activity-indicator/shared.d.ts +0 -67
- package/build/angular/components/activity-indicator/shared.js +0 -260
- package/build/angular/components/activity-indicator/shared.js.map +0 -1
- package/build/angular/components/button.d.ts +0 -68
- package/build/angular/components/button.js +0 -360
- package/build/angular/components/button.js.map +0 -1
- package/build/angular/components/image/index.android.d.ts +0 -15
- package/build/angular/components/image/index.android.js +0 -83
- package/build/angular/components/image/index.android.js.map +0 -1
- package/build/angular/components/image/index.d.ts +0 -1
- package/build/angular/components/image/index.ios.d.ts +0 -15
- package/build/angular/components/image/index.ios.js +0 -83
- package/build/angular/components/image/index.ios.js.map +0 -1
- package/build/angular/components/image/index.js +0 -3
- package/build/angular/components/image/index.js.map +0 -1
- package/build/angular/components/image/shared.js.map +0 -1
- package/build/angular/components/image-background.d.ts +0 -85
- package/build/angular/components/image-background.js +0 -443
- package/build/angular/components/image-background.js.map +0 -1
- package/build/angular/components/input-accessory-view/index.d.ts +0 -66
- package/build/angular/components/input-accessory-view/index.js +0 -287
- package/build/angular/components/input-accessory-view/index.js.map +0 -1
- package/build/angular/components/pressable/index.d.ts +0 -134
- package/build/angular/components/pressable/index.js +0 -514
- package/build/angular/components/pressable/index.js.map +0 -1
- package/build/angular/components/refresh-control/index.d.ts +0 -91
- package/build/angular/components/refresh-control/index.js +0 -382
- package/build/angular/components/refresh-control/index.js.map +0 -1
- package/build/angular/components/safe-area-view/index.d.ts +0 -64
- package/build/angular/components/safe-area-view/index.js +0 -287
- package/build/angular/components/safe-area-view/index.js.map +0 -1
- package/build/angular/components/scroll-view/index.android.d.ts +0 -20
- package/build/angular/components/scroll-view/index.android.js +0 -262
- package/build/angular/components/scroll-view/index.android.js.map +0 -1
- package/build/angular/components/scroll-view/index.d.ts +0 -3
- package/build/angular/components/scroll-view/index.ios.d.ts +0 -8
- package/build/angular/components/scroll-view/index.ios.js +0 -92
- package/build/angular/components/scroll-view/index.ios.js.map +0 -1
- package/build/angular/components/scroll-view/index.js +0 -6
- package/build/angular/components/scroll-view/index.js.map +0 -1
- package/build/angular/components/scroll-view/projection.d.ts +0 -67
- package/build/angular/components/scroll-view/projection.js +0 -560
- package/build/angular/components/scroll-view/projection.js.map +0 -1
- package/build/angular/components/scroll-view/shared.d.ts +0 -241
- package/build/angular/components/scroll-view/shared.js +0 -848
- package/build/angular/components/scroll-view/shared.js.map +0 -1
- package/build/angular/components/scroll-view/sticky-header.d.ts +0 -40
- package/build/angular/components/scroll-view/sticky-header.js +0 -224
- package/build/angular/components/scroll-view/sticky-header.js.map +0 -1
- package/build/angular/components/switch/index.android.d.ts +0 -24
- package/build/angular/components/switch/index.android.js +0 -112
- package/build/angular/components/switch/index.android.js.map +0 -1
- package/build/angular/components/switch/index.d.ts +0 -1
- package/build/angular/components/switch/index.ios.d.ts +0 -23
- package/build/angular/components/switch/index.ios.js +0 -111
- package/build/angular/components/switch/index.ios.js.map +0 -1
- package/build/angular/components/switch/index.js +0 -4
- package/build/angular/components/switch/index.js.map +0 -1
- package/build/angular/components/switch/shared.d.ts +0 -49
- package/build/angular/components/switch/shared.js +0 -191
- package/build/angular/components/switch/shared.js.map +0 -1
- package/build/angular/components/text-input.d.ts +0 -167
- package/build/angular/components/text-input.js +0 -684
- package/build/angular/components/text-input.js.map +0 -1
- package/build/angular/components/touchable/index.d.ts +0 -283
- package/build/angular/components/touchable/index.js +0 -1453
- package/build/angular/components/touchable/index.js.map +0 -1
- package/build/angular/components/touchable-native-feedback/index.d.ts +0 -87
- package/build/angular/components/touchable-native-feedback/index.js +0 -409
- package/build/angular/components/touchable-native-feedback/index.js.map +0 -1
- package/build/angular/state-style.d.ts +0 -9
- package/build/angular/state-style.js +0 -39
- package/build/angular/state-style.js.map +0 -1
- package/metro-transformer.cjs +0 -69
- package/src/components/activity-indicator/index.android.ts +0 -23
- package/src/components/activity-indicator/index.ios.ts +0 -21
- package/src/components/activity-indicator/index.ts +0 -4
- package/src/components/activity-indicator/shared.ts +0 -225
- package/src/components/button.ts +0 -237
- package/src/components/image/index.android.ts +0 -95
- package/src/components/image/index.ios.ts +0 -95
- package/src/components/image/index.ts +0 -3
- package/src/components/image-background.ts +0 -308
- package/src/components/input-accessory-view/index.ts +0 -246
- package/src/components/pressable/index.ts +0 -522
- package/src/components/refresh-control/index.ts +0 -349
- package/src/components/safe-area-view/index.ts +0 -247
- package/src/components/scroll-view/index.android.ts +0 -205
- package/src/components/scroll-view/index.ios.ts +0 -81
- package/src/components/scroll-view/index.ts +0 -7
- package/src/components/scroll-view/projection.ts +0 -713
- package/src/components/scroll-view/shared.ts +0 -1093
- package/src/components/scroll-view/sticky-header.ts +0 -267
- package/src/components/switch/index.android.ts +0 -113
- package/src/components/switch/index.ios.ts +0 -112
- package/src/components/switch/index.ts +0 -4
- package/src/components/switch/shared.ts +0 -284
- package/src/components/text-input.ts +0 -669
- package/src/components/touchable/index.ts +0 -956
- package/src/components/touchable-native-feedback/index.ts +0 -327
- package/src/state-style.ts +0 -39
package/src/elements.ts
ADDED
|
@@ -0,0 +1,919 @@
|
|
|
1
|
+
// One `@Directive` per intrinsic tag, so an app can hand-write `<view>` / `<text>` /
|
|
2
|
+
// `<text-input>` in an ordinary Angular template and have ngtsc check it.
|
|
3
|
+
//
|
|
4
|
+
// WHY A DIRECTIVE AND NOT A SCHEMA. `CUSTOM_ELEMENTS_SCHEMA` admits an unknown element only when
|
|
5
|
+
// the name is a valid CUSTOM ELEMENT name, and the HTML spec requires a HYPHEN — so half our tag
|
|
6
|
+
// alphabet (`view`, `text`, `image`, `switch`, `modal`, `pressable`) is NG8001 under it.
|
|
7
|
+
// `NO_ERRORS_SCHEMA` compiles them at the cost of every element and property check in the app.
|
|
8
|
+
// A matching directive makes the element known with NO schema, and gives strictly MORE than either
|
|
9
|
+
// schema ever could: both schemas return `true` for every property on a tag they admit
|
|
10
|
+
// (`dom_element_schema_registry.ts:407`, "we don't know which properties a custom element will
|
|
11
|
+
// get"), while a declared input has a TYPE. Measured in `bare-intrinsic-tag-aot.test.ts`.
|
|
12
|
+
//
|
|
13
|
+
// WHY EVERY BOUND PROP MUST BE DECLARED HERE. Matching a directive turns every binding on the tag
|
|
14
|
+
// into an input lookup, so a prop this file does not declare is `Can't bind to 'x'` — the cost of
|
|
15
|
+
// the route, and the reason the surface below is exhaustive rather than convenient.
|
|
16
|
+
//
|
|
17
|
+
// WHY THE PROPS ARE FIELDS AND NOT A DERIVED NAME LIST. `@Directive({ inputs: [...SHARED] })`
|
|
18
|
+
// compiles fine against a shared const array (measured; `@Directive.inputs` is a mutable-array
|
|
19
|
+
// type, so a `readonly`/`as const` array must be spread), and it would have made this file
|
|
20
|
+
// nineteen one-liners. It also makes every such input UNTYPED: ngtsc reads an input's type from a
|
|
21
|
+
// real class-member declaration node, and a merged `interface X extends IProps {}` — which does
|
|
22
|
+
// put the property on the class's TYPE — leaves `<view [testID]="42">` compiling clean. Since the
|
|
23
|
+
// type check is the whole reason to prefer this route over `NO_ERRORS_SCHEMA`, the names are
|
|
24
|
+
// fields. What is derived is each field's TYPE, indexed off the shared prop interface, so a type
|
|
25
|
+
// that changes upstream cannot drift here.
|
|
26
|
+
//
|
|
27
|
+
// EVENTS ARE NOT DECLARED. `(press)` / `(layout)` on a tag a directive matches still compiles and
|
|
28
|
+
// still reaches `Renderer2.listen` -> the engine; an `@Output` would CONSUME the binding the same
|
|
29
|
+
// way an `@Input` consumes a prop. Measured both halves — see `elements.test.ts`. The cost is that
|
|
30
|
+
// `$event` types as the DOM `Event` there, since ngtsc falls back to the DOM schema for an event no
|
|
31
|
+
// directive claims; the typed spelling of the same handler is the flat-bag `@Input` beside it
|
|
32
|
+
// (`[onPressMove]="fn"`, where `fn` keeps its `ISymbioteEvent` parameter).
|
|
33
|
+
//
|
|
34
|
+
// `valueChange` is the ONE exception, and it is forced rather than chosen: see ValueChangeElement.
|
|
35
|
+
import {
|
|
36
|
+
ChangeDetectorRef,
|
|
37
|
+
Directive,
|
|
38
|
+
ElementRef,
|
|
39
|
+
EventEmitter,
|
|
40
|
+
Input,
|
|
41
|
+
Output,
|
|
42
|
+
Renderer2,
|
|
43
|
+
forwardRef,
|
|
44
|
+
inject,
|
|
45
|
+
} from '@angular/core';
|
|
46
|
+
import type {
|
|
47
|
+
OnChanges,
|
|
48
|
+
OnDestroy,
|
|
49
|
+
OnInit,
|
|
50
|
+
SimpleChanges,
|
|
51
|
+
} from '@angular/core';
|
|
52
|
+
import { NG_VALUE_ACCESSOR, type ControlValueAccessor } from '@angular/forms';
|
|
53
|
+
import { VALUE_CHANGE_EVENT } from './renderer/value-change';
|
|
54
|
+
import {
|
|
55
|
+
createCallbackWrapper,
|
|
56
|
+
registerViewFlush,
|
|
57
|
+
unregisterViewFlush,
|
|
58
|
+
} from './change-detection-flush';
|
|
59
|
+
import type {
|
|
60
|
+
IActivityIndicatorProps,
|
|
61
|
+
IImageProps,
|
|
62
|
+
INativeFeedbackBackground,
|
|
63
|
+
IInputAccessoryViewViewProps,
|
|
64
|
+
IModalViewProps,
|
|
65
|
+
ISwitchProps,
|
|
66
|
+
ITextInputProps,
|
|
67
|
+
} from '@symbiote-native/components';
|
|
68
|
+
import type {
|
|
69
|
+
IElementProps,
|
|
70
|
+
IStickyHeaderElementProps,
|
|
71
|
+
ITextElementProps,
|
|
72
|
+
} from './element-props';
|
|
73
|
+
import type { IAngularImageBackgroundProps } from './components/image-background-props';
|
|
74
|
+
import type { IAngularPressableProps } from './components/pressable-props';
|
|
75
|
+
import type {
|
|
76
|
+
IAngularTouchableHighlightProps,
|
|
77
|
+
IAngularTouchableOpacityProps,
|
|
78
|
+
} from './components/touchable-props';
|
|
79
|
+
// Type-only, so none of these components enters the bundle of an app that writes bare tags.
|
|
80
|
+
import type { IAngularRefreshControlProps } from './components/refresh-control-props';
|
|
81
|
+
import type { IAngularScrollViewProps } from './components/scroll-view-props';
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The shared half of every element directive: the prop surface all tags accept, and the ONE
|
|
85
|
+
* generic forward that puts a claimed binding back on the engine node.
|
|
86
|
+
*
|
|
87
|
+
* The forward is the deciding fact of this whole route. A binding claimed by a directive input
|
|
88
|
+
* never reaches `Renderer2.setProperty` on its own — Angular writes it to the directive instance
|
|
89
|
+
* — so without this loop a bare tag commits nothing at all. It stays generic on purpose: per-prop
|
|
90
|
+
* forwarding code is a component wrapper by another name, which is what this migration removes.
|
|
91
|
+
* `renderer.setProperty` lands in the adapter's own renderer, which routes the value through the
|
|
92
|
+
* engine's `routeProp` and applies the `id` -> `nativeID` and `symbioteStyle` -> `style` aliases.
|
|
93
|
+
*/
|
|
94
|
+
@Directive()
|
|
95
|
+
export abstract class SymbioteElement implements OnChanges {
|
|
96
|
+
private readonly renderer = inject(Renderer2);
|
|
97
|
+
protected readonly host = inject(ElementRef);
|
|
98
|
+
protected readonly detector = inject(ChangeDetectorRef);
|
|
99
|
+
|
|
100
|
+
// An `onX` PROP is called by the engine, so Angular is never told it fired. Shared with the
|
|
101
|
+
// component path's `SymbioteHostPropsDirective`, which has the identical deficit — see
|
|
102
|
+
// `createCallbackWrapper`.
|
|
103
|
+
private readonly wrapCallback = createCallbackWrapper(
|
|
104
|
+
this.detector,
|
|
105
|
+
this.host.nativeElement,
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
@Input() testID?: IElementProps['testID'];
|
|
109
|
+
@Input() nativeID?: IElementProps['nativeID'];
|
|
110
|
+
@Input() id?: IElementProps['id'];
|
|
111
|
+
@Input() accessible?: IElementProps['accessible'];
|
|
112
|
+
@Input() accessibilityLabel?: IElementProps['accessibilityLabel'];
|
|
113
|
+
@Input() accessibilityHint?: IElementProps['accessibilityHint'];
|
|
114
|
+
@Input() accessibilityRole?: IElementProps['accessibilityRole'];
|
|
115
|
+
@Input() accessibilityState?: IElementProps['accessibilityState'];
|
|
116
|
+
@Input() accessibilityValue?: IElementProps['accessibilityValue'];
|
|
117
|
+
@Input() accessibilityActions?: IElementProps['accessibilityActions'];
|
|
118
|
+
@Input() accessibilityLabelledBy?: IElementProps['accessibilityLabelledBy'];
|
|
119
|
+
@Input()
|
|
120
|
+
importantForAccessibility?: IElementProps['importantForAccessibility'];
|
|
121
|
+
@Input() accessibilityLiveRegion?: IElementProps['accessibilityLiveRegion'];
|
|
122
|
+
@Input() screenReaderFocusable?: IElementProps['screenReaderFocusable'];
|
|
123
|
+
@Input() accessibilityViewIsModal?: IElementProps['accessibilityViewIsModal'];
|
|
124
|
+
@Input()
|
|
125
|
+
accessibilityElementsHidden?: IElementProps['accessibilityElementsHidden'];
|
|
126
|
+
@Input()
|
|
127
|
+
accessibilityIgnoresInvertColors?: IElementProps['accessibilityIgnoresInvertColors'];
|
|
128
|
+
@Input() accessibilityLanguage?: IElementProps['accessibilityLanguage'];
|
|
129
|
+
@Input()
|
|
130
|
+
accessibilityRespondsToUserInteraction?: IElementProps['accessibilityRespondsToUserInteraction'];
|
|
131
|
+
@Input()
|
|
132
|
+
accessibilityShowsLargeContentViewer?: IElementProps['accessibilityShowsLargeContentViewer'];
|
|
133
|
+
@Input()
|
|
134
|
+
accessibilityLargeContentTitle?: IElementProps['accessibilityLargeContentTitle'];
|
|
135
|
+
@Input() onAccessibilityAction?: IElementProps['onAccessibilityAction'];
|
|
136
|
+
@Input() onAccessibilityTap?: IElementProps['onAccessibilityTap'];
|
|
137
|
+
@Input() onMagicTap?: IElementProps['onMagicTap'];
|
|
138
|
+
@Input() onAccessibilityEscape?: IElementProps['onAccessibilityEscape'];
|
|
139
|
+
|
|
140
|
+
// The web aliases. Native reads only `accessibility*`; the engine folds these on the way in.
|
|
141
|
+
@Input() role?: IElementProps['role'];
|
|
142
|
+
@Input() 'aria-label'?: IElementProps['aria-label'];
|
|
143
|
+
@Input() 'aria-labelledby'?: IElementProps['aria-labelledby'];
|
|
144
|
+
@Input() 'aria-live'?: IElementProps['aria-live'];
|
|
145
|
+
@Input() 'aria-hidden'?: IElementProps['aria-hidden'];
|
|
146
|
+
@Input() 'aria-busy'?: IElementProps['aria-busy'];
|
|
147
|
+
@Input() 'aria-checked'?: IElementProps['aria-checked'];
|
|
148
|
+
@Input() 'aria-disabled'?: IElementProps['aria-disabled'];
|
|
149
|
+
@Input() 'aria-expanded'?: IElementProps['aria-expanded'];
|
|
150
|
+
@Input() 'aria-selected'?: IElementProps['aria-selected'];
|
|
151
|
+
@Input() 'aria-modal'?: IElementProps['aria-modal'];
|
|
152
|
+
@Input() 'aria-valuemax'?: IElementProps['aria-valuemax'];
|
|
153
|
+
@Input() 'aria-valuemin'?: IElementProps['aria-valuemin'];
|
|
154
|
+
@Input() 'aria-valuenow'?: IElementProps['aria-valuenow'];
|
|
155
|
+
@Input() 'aria-valuetext'?: IElementProps['aria-valuetext'];
|
|
156
|
+
|
|
157
|
+
// The responder gates return a boolean, which an Angular `(event)` binding cannot carry back to
|
|
158
|
+
// the caller — so the whole family is inputs, never outputs.
|
|
159
|
+
@Input()
|
|
160
|
+
onStartShouldSetResponder?: IElementProps['onStartShouldSetResponder'];
|
|
161
|
+
@Input()
|
|
162
|
+
onStartShouldSetResponderCapture?: IElementProps['onStartShouldSetResponderCapture'];
|
|
163
|
+
@Input() onMoveShouldSetResponder?: IElementProps['onMoveShouldSetResponder'];
|
|
164
|
+
@Input()
|
|
165
|
+
onMoveShouldSetResponderCapture?: IElementProps['onMoveShouldSetResponderCapture'];
|
|
166
|
+
@Input() onResponderGrant?: IElementProps['onResponderGrant'];
|
|
167
|
+
@Input() onResponderReject?: IElementProps['onResponderReject'];
|
|
168
|
+
@Input() onResponderStart?: IElementProps['onResponderStart'];
|
|
169
|
+
@Input() onResponderMove?: IElementProps['onResponderMove'];
|
|
170
|
+
@Input() onResponderEnd?: IElementProps['onResponderEnd'];
|
|
171
|
+
@Input() onResponderRelease?: IElementProps['onResponderRelease'];
|
|
172
|
+
@Input() onResponderTerminate?: IElementProps['onResponderTerminate'];
|
|
173
|
+
@Input()
|
|
174
|
+
onResponderTerminationRequest?: IElementProps['onResponderTerminationRequest'];
|
|
175
|
+
|
|
176
|
+
@Input() pointerEvents?: IElementProps['pointerEvents'];
|
|
177
|
+
@Input() hitSlop?: IElementProps['hitSlop'];
|
|
178
|
+
@Input() focusable?: IElementProps['focusable'];
|
|
179
|
+
@Input() collapsable?: IElementProps['collapsable'];
|
|
180
|
+
@Input() removeClippedSubviews?: IElementProps['removeClippedSubviews'];
|
|
181
|
+
@Input()
|
|
182
|
+
renderToHardwareTextureAndroid?: IElementProps['renderToHardwareTextureAndroid'];
|
|
183
|
+
@Input() shouldRasterizeIOS?: IElementProps['shouldRasterizeIOS'];
|
|
184
|
+
@Input()
|
|
185
|
+
needsOffscreenAlphaCompositing?: IElementProps['needsOffscreenAlphaCompositing'];
|
|
186
|
+
@Input() symbioteStyle?: IElementProps['symbioteStyle'];
|
|
187
|
+
// Declared, and the reason is the one `element-props.ts` used to give for NOT declaring it —
|
|
188
|
+
// reversed by measurement. `[style]` on an element with no directive input reaches Angular's own
|
|
189
|
+
// CSS styling engine (`ɵɵstyleMap`), which cannot represent an RN StyleProp: an ARRAY decomposes
|
|
190
|
+
// into numeric-index keys and a FUNCTION — the press-state callback this ecosystem writes — dies
|
|
191
|
+
// in `toStylingKeyValueArray` as "ASSERTION ERROR: Unsupported styling type: function", taking
|
|
192
|
+
// the whole enclosing template update with it. Device-reported 2026-09-11: every `ActionButton`
|
|
193
|
+
// in examples/angular painted as an empty bordered box, because the throw aborted the update
|
|
194
|
+
// before its `<text>` child was ever reached.
|
|
195
|
+
//
|
|
196
|
+
// A declared input CLAIMS the binding at compile time, so it never reaches the styling engine —
|
|
197
|
+
// the same mechanism the primitive host COMPONENTS have always relied on
|
|
198
|
+
// (`primitives/shared.ts`), which is why `<Pressable [style]>` worked and its replacement tag did
|
|
199
|
+
// not. `[style.borderWidth.px]` is a different instruction (`ɵɵstyleProp`) and is untouched: it
|
|
200
|
+
// still reaches `Renderer2.setStyle`, which merges per key.
|
|
201
|
+
//
|
|
202
|
+
// The press-state callback rides the BASE type rather than `PressableElement` alone: a subclass
|
|
203
|
+
// cannot widen an inherited property, and only the pressables have a `pressed` to read — so on
|
|
204
|
+
// any other tag the engine resolves it at `pressed: false` and the looseness is in the type, not
|
|
205
|
+
// in what commits.
|
|
206
|
+
@Input() style?: IElementProps['style'];
|
|
207
|
+
|
|
208
|
+
// The flat-bag spelling of the events below. `(press)` and `[onPress]` are both supported and
|
|
209
|
+
// land in the same place; an app that already holds a handler bag binds the props.
|
|
210
|
+
@Input() onPress?: IElementProps['onPress'];
|
|
211
|
+
@Input() onPressIn?: IElementProps['onPressIn'];
|
|
212
|
+
@Input() onPressOut?: IElementProps['onPressOut'];
|
|
213
|
+
@Input() onPressMove?: IElementProps['onPressMove'];
|
|
214
|
+
@Input() onLongPress?: IElementProps['onLongPress'];
|
|
215
|
+
@Input() onLayout?: IElementProps['onLayout'];
|
|
216
|
+
@Input() onFocus?: IElementProps['onFocus'];
|
|
217
|
+
@Input() onBlur?: IElementProps['onBlur'];
|
|
218
|
+
|
|
219
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
220
|
+
for (const name of Object.keys(changes)) {
|
|
221
|
+
this.renderer.setProperty(
|
|
222
|
+
this.host.nativeElement,
|
|
223
|
+
name,
|
|
224
|
+
this.wrapCallback(name, changes[name]?.currentValue),
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* The base for a tag whose app callback an engine behavior READS BACK inside the same microtask
|
|
232
|
+
* turn — `<text-input>`, `<switch>`, `<refresh-control>`. Zoneless change detection is a macrotask,
|
|
233
|
+
* so without this the behavior sees the PRE-event value and undoes the user; the full mechanism,
|
|
234
|
+
* and why this is `detectChanges()` on one view rather than `ApplicationRef.tick()`, is in
|
|
235
|
+
* `./change-detection-flush`.
|
|
236
|
+
*
|
|
237
|
+
* The directive is the only thing in the adapter that owns a `ChangeDetectorRef` for the view
|
|
238
|
+
* holding the binding, so it hands one to the renderer keyed on its own node.
|
|
239
|
+
*/
|
|
240
|
+
@Directive()
|
|
241
|
+
abstract class ReadBackElement extends SymbioteElement implements OnDestroy {
|
|
242
|
+
constructor() {
|
|
243
|
+
super();
|
|
244
|
+
const node: unknown = this.host.nativeElement;
|
|
245
|
+
if (typeof node === 'object' && node !== null) {
|
|
246
|
+
registerViewFlush(node, () => this.detector.detectChanges());
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
ngOnDestroy(): void {
|
|
251
|
+
const node: unknown = this.host.nativeElement;
|
|
252
|
+
if (typeof node === 'object' && node !== null) unregisterViewFlush(node);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@Directive({ selector: 'view', standalone: true })
|
|
257
|
+
export class ViewElement extends SymbioteElement {}
|
|
258
|
+
|
|
259
|
+
@Directive({ selector: 'pressable', standalone: true })
|
|
260
|
+
export class PressableElement extends SymbioteElement {
|
|
261
|
+
@Input() disabled?: IAngularPressableProps['disabled'];
|
|
262
|
+
@Input() cancelable?: IAngularPressableProps['cancelable'];
|
|
263
|
+
@Input() delayLongPress?: IAngularPressableProps['delayLongPress'];
|
|
264
|
+
@Input() delayHoverIn?: IAngularPressableProps['delayHoverIn'];
|
|
265
|
+
@Input() delayHoverOut?: IAngularPressableProps['delayHoverOut'];
|
|
266
|
+
@Input() onHoverIn?: IAngularPressableProps['onHoverIn'];
|
|
267
|
+
@Input() onHoverOut?: IAngularPressableProps['onHoverOut'];
|
|
268
|
+
@Input()
|
|
269
|
+
pressRetentionOffset?: IAngularPressableProps['pressRetentionOffset'];
|
|
270
|
+
@Input() unstable_pressDelay?: IAngularPressableProps['unstable_pressDelay'];
|
|
271
|
+
@Input() android_ripple?: IAngularPressableProps['android_ripple'];
|
|
272
|
+
@Input()
|
|
273
|
+
android_disableSound?: IAngularPressableProps['android_disableSound'];
|
|
274
|
+
@Input() hasTVPreferredFocus?: IAngularPressableProps['hasTVPreferredFocus'];
|
|
275
|
+
@Input() nextFocusDown?: IAngularPressableProps['nextFocusDown'];
|
|
276
|
+
@Input() nextFocusForward?: IAngularPressableProps['nextFocusForward'];
|
|
277
|
+
@Input() nextFocusLeft?: IAngularPressableProps['nextFocusLeft'];
|
|
278
|
+
@Input() nextFocusRight?: IAngularPressableProps['nextFocusRight'];
|
|
279
|
+
@Input() nextFocusUp?: IAngularPressableProps['nextFocusUp'];
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// RN's TouchableOpacity is a Pressable that also fades, and both halves are on the engine node —
|
|
283
|
+
// so it takes the same inputs and adds only the fade's own knob.
|
|
284
|
+
@Directive({ selector: 'touchable-opacity', standalone: true })
|
|
285
|
+
export class TouchableOpacityElement extends PressableElement {
|
|
286
|
+
@Input() activeOpacity?: number;
|
|
287
|
+
@Input() delayPressIn?: number;
|
|
288
|
+
@Input() delayPressOut?: number;
|
|
289
|
+
@Input() minPressDuration?: number;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// RN's TouchableHighlight is a Pressable that swaps its own background while pressed
|
|
293
|
+
// (TouchableHighlight.js), and the underlay machine runs on the engine node — so the tag takes the
|
|
294
|
+
// press surface plus the two knobs that describe the underlay. `onShowUnderlay`/`onHideUnderlay`
|
|
295
|
+
// need no @Input: they are events, bound as `(showUnderlay)` through the renderer's own listen.
|
|
296
|
+
@Directive({ selector: 'touchable-highlight', standalone: true })
|
|
297
|
+
export class TouchableHighlightElement extends PressableElement {
|
|
298
|
+
@Input() activeOpacity?: number;
|
|
299
|
+
@Input() underlayColor?: string;
|
|
300
|
+
@Input() delayPressIn?: number;
|
|
301
|
+
@Input() delayPressOut?: number;
|
|
302
|
+
@Input() minPressDuration?: number;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// RN's TouchableNativeFeedback is a Pressable that CLONES onto its single child instead of
|
|
306
|
+
// rendering anything (TouchableNativeFeedback.js:339) — so the tag takes the press surface plus the
|
|
307
|
+
// two props that pick the Android ripple drawable. The tag itself commits no native view; the
|
|
308
|
+
// behavior configures the child, which is why `elements.test.ts` reads it as an anchor.
|
|
309
|
+
@Directive({ selector: 'touchable-native-feedback', standalone: true })
|
|
310
|
+
export class TouchableNativeFeedbackElement extends PressableElement {
|
|
311
|
+
@Input() background?: INativeFeedbackBackground;
|
|
312
|
+
@Input() useForeground?: boolean;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// RN's TouchableWithoutFeedback clones onto its single child the same way
|
|
316
|
+
// (TouchableWithoutFeedback.js:286) and installs no drawable, so it takes the press surface plus the
|
|
317
|
+
// three timing knobs it forwards to Pressability (:186-190) and nothing else. Like the tag above it
|
|
318
|
+
// commits no native view; `elements.test.ts` reads it as an anchor.
|
|
319
|
+
@Directive({ selector: 'touchable-without-feedback', standalone: true })
|
|
320
|
+
export class TouchableWithoutFeedbackElement extends PressableElement {
|
|
321
|
+
@Input() delayPressIn?: number;
|
|
322
|
+
@Input() delayPressOut?: number;
|
|
323
|
+
@Input() minPressDuration?: number;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// RN's Button IS a TouchableOpacity (Button.js:384), and the behavior builds the view and the
|
|
327
|
+
// label under it — so the tag takes the touchable's surface plus the four props Button owns. There
|
|
328
|
+
// is no `style`: RN's Button has no such prop, and the label/background come from `color`.
|
|
329
|
+
@Directive({ selector: 'button', standalone: true })
|
|
330
|
+
export class ButtonElement extends TouchableOpacityElement {
|
|
331
|
+
@Input() title?: string;
|
|
332
|
+
@Input() color?: string;
|
|
333
|
+
@Input() touchSoundDisabled?: boolean;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
@Directive({ selector: 'text', standalone: true })
|
|
337
|
+
export class TextElement extends SymbioteElement {
|
|
338
|
+
// Narrows the inherited input to a TEXT style so `fontSize`/`fontWeight` type-check here. The
|
|
339
|
+
// initializer is what TS2612 asks for to accept a redeclaration as deliberate; `declare` would
|
|
340
|
+
// be the other answer and cannot carry a decorator.
|
|
341
|
+
@Input() override style?: ITextElementProps['style'] = undefined;
|
|
342
|
+
@Input() numberOfLines?: ITextElementProps['numberOfLines'];
|
|
343
|
+
@Input() ellipsizeMode?: ITextElementProps['ellipsizeMode'];
|
|
344
|
+
@Input() selectable?: ITextElementProps['selectable'];
|
|
345
|
+
@Input() adjustsFontSizeToFit?: ITextElementProps['adjustsFontSizeToFit'];
|
|
346
|
+
@Input() minimumFontScale?: ITextElementProps['minimumFontScale'];
|
|
347
|
+
@Input() allowFontScaling?: ITextElementProps['allowFontScaling'];
|
|
348
|
+
@Input() maxFontSizeMultiplier?: ITextElementProps['maxFontSizeMultiplier'];
|
|
349
|
+
@Input() selectionColor?: ITextElementProps['selectionColor'];
|
|
350
|
+
@Input() disabled?: ITextElementProps['disabled'];
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
@Directive({ selector: 'image', standalone: true })
|
|
354
|
+
export class ImageElement extends SymbioteElement {
|
|
355
|
+
@Input() source?: IImageProps['source'];
|
|
356
|
+
@Input() src?: IImageProps['src'];
|
|
357
|
+
@Input() srcSet?: IImageProps['srcSet'];
|
|
358
|
+
@Input() alt?: IImageProps['alt'];
|
|
359
|
+
@Input() width?: IImageProps['width'];
|
|
360
|
+
@Input() height?: IImageProps['height'];
|
|
361
|
+
@Input() resizeMode?: IImageProps['resizeMode'];
|
|
362
|
+
@Input() resizeMethod?: IImageProps['resizeMethod'];
|
|
363
|
+
@Input() defaultSource?: IImageProps['defaultSource'];
|
|
364
|
+
@Input() loadingIndicatorSource?: IImageProps['loadingIndicatorSource'];
|
|
365
|
+
@Input() blurRadius?: IImageProps['blurRadius'];
|
|
366
|
+
@Input() capInsets?: IImageProps['capInsets'];
|
|
367
|
+
@Input() crossOrigin?: IImageProps['crossOrigin'];
|
|
368
|
+
@Input() referrerPolicy?: IImageProps['referrerPolicy'];
|
|
369
|
+
@Input() fadeDuration?: IImageProps['fadeDuration'];
|
|
370
|
+
@Input()
|
|
371
|
+
progressiveRenderingEnabled?: IImageProps['progressiveRenderingEnabled'];
|
|
372
|
+
@Input() tintColor?: IImageProps['tintColor'];
|
|
373
|
+
@Input() onLoad?: IImageProps['onLoad'];
|
|
374
|
+
@Input() onLoadStart?: IImageProps['onLoadStart'];
|
|
375
|
+
@Input() onLoadEnd?: IImageProps['onLoadEnd'];
|
|
376
|
+
@Input() onError?: IImageProps['onError'];
|
|
377
|
+
@Input() onProgress?: IImageProps['onProgress'];
|
|
378
|
+
@Input() onPartialLoad?: IImageProps['onPartialLoad'];
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// The box, not the image. Every Image prop below rides the engine's `slotPropsExcept` redirect onto
|
|
382
|
+
// the absolutely-filled image the behavior builds, exactly as RN's own `...props` spread does
|
|
383
|
+
// (ImageBackground.js:81) — so this directive declares them to make the BINDING legal, and the
|
|
384
|
+
// engine decides which node each lands on.
|
|
385
|
+
@Directive({ selector: 'image-background', standalone: true })
|
|
386
|
+
export class ImageBackgroundElement extends SymbioteElement {
|
|
387
|
+
@Input() imageStyle?: IAngularImageBackgroundProps['imageStyle'];
|
|
388
|
+
@Input() source?: IImageProps['source'];
|
|
389
|
+
@Input() src?: IImageProps['src'];
|
|
390
|
+
@Input() srcSet?: IImageProps['srcSet'];
|
|
391
|
+
@Input() alt?: IImageProps['alt'];
|
|
392
|
+
@Input() width?: IImageProps['width'];
|
|
393
|
+
@Input() height?: IImageProps['height'];
|
|
394
|
+
@Input() resizeMode?: IImageProps['resizeMode'];
|
|
395
|
+
@Input() resizeMethod?: IImageProps['resizeMethod'];
|
|
396
|
+
@Input() defaultSource?: IImageProps['defaultSource'];
|
|
397
|
+
@Input() loadingIndicatorSource?: IImageProps['loadingIndicatorSource'];
|
|
398
|
+
@Input() blurRadius?: IImageProps['blurRadius'];
|
|
399
|
+
@Input() capInsets?: IImageProps['capInsets'];
|
|
400
|
+
@Input() crossOrigin?: IImageProps['crossOrigin'];
|
|
401
|
+
@Input() referrerPolicy?: IImageProps['referrerPolicy'];
|
|
402
|
+
@Input() fadeDuration?: IImageProps['fadeDuration'];
|
|
403
|
+
@Input()
|
|
404
|
+
progressiveRenderingEnabled?: IImageProps['progressiveRenderingEnabled'];
|
|
405
|
+
@Input() tintColor?: IImageProps['tintColor'];
|
|
406
|
+
@Input() onLoad?: IImageProps['onLoad'];
|
|
407
|
+
@Input() onLoadStart?: IImageProps['onLoadStart'];
|
|
408
|
+
@Input() onLoadEnd?: IImageProps['onLoadEnd'];
|
|
409
|
+
@Input() onError?: IImageProps['onError'];
|
|
410
|
+
@Input() onProgress?: IImageProps['onProgress'];
|
|
411
|
+
@Input() onPartialLoad?: IImageProps['onPartialLoad'];
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
@Directive({ selector: 'scroll-view', standalone: true })
|
|
415
|
+
export class ScrollViewElement extends SymbioteElement {
|
|
416
|
+
// No `horizontal` @Input: the axis is the TAG you write, never a prop — see
|
|
417
|
+
// `../components/scroll-view-props.ts`'s header. `HorizontalScrollViewElement` below is the
|
|
418
|
+
// other spelling, not a variant of this one.
|
|
419
|
+
@Input() scrollEnabled?: IAngularScrollViewProps['scrollEnabled'];
|
|
420
|
+
@Input() scrollEventThrottle?: IAngularScrollViewProps['scrollEventThrottle'];
|
|
421
|
+
@Input()
|
|
422
|
+
contentContainerStyle?: IAngularScrollViewProps['contentContainerStyle'];
|
|
423
|
+
@Input() contentInset?: IAngularScrollViewProps['contentInset'];
|
|
424
|
+
@Input()
|
|
425
|
+
contentInsetAdjustmentBehavior?: IAngularScrollViewProps['contentInsetAdjustmentBehavior'];
|
|
426
|
+
@Input() contentOffset?: IAngularScrollViewProps['contentOffset'];
|
|
427
|
+
@Input()
|
|
428
|
+
scrollIndicatorInsets?: IAngularScrollViewProps['scrollIndicatorInsets'];
|
|
429
|
+
@Input()
|
|
430
|
+
showsHorizontalScrollIndicator?: IAngularScrollViewProps['showsHorizontalScrollIndicator'];
|
|
431
|
+
@Input()
|
|
432
|
+
showsVerticalScrollIndicator?: IAngularScrollViewProps['showsVerticalScrollIndicator'];
|
|
433
|
+
@Input()
|
|
434
|
+
alwaysBounceHorizontal?: IAngularScrollViewProps['alwaysBounceHorizontal'];
|
|
435
|
+
@Input()
|
|
436
|
+
alwaysBounceVertical?: IAngularScrollViewProps['alwaysBounceVertical'];
|
|
437
|
+
@Input() bounces?: IAngularScrollViewProps['bounces'];
|
|
438
|
+
@Input() bouncesZoom?: IAngularScrollViewProps['bouncesZoom'];
|
|
439
|
+
@Input() centerContent?: IAngularScrollViewProps['centerContent'];
|
|
440
|
+
@Input() decelerationRate?: IAngularScrollViewProps['decelerationRate'];
|
|
441
|
+
@Input()
|
|
442
|
+
directionalLockEnabled?: IAngularScrollViewProps['directionalLockEnabled'];
|
|
443
|
+
@Input()
|
|
444
|
+
disableIntervalMomentum?: IAngularScrollViewProps['disableIntervalMomentum'];
|
|
445
|
+
@Input() endFillColor?: IAngularScrollViewProps['endFillColor'];
|
|
446
|
+
@Input() fadingEdgeLength?: IAngularScrollViewProps['fadingEdgeLength'];
|
|
447
|
+
@Input() indicatorStyle?: IAngularScrollViewProps['indicatorStyle'];
|
|
448
|
+
@Input() invertStickyHeaders?: IAngularScrollViewProps['invertStickyHeaders'];
|
|
449
|
+
@Input() keyboardDismissMode?: IAngularScrollViewProps['keyboardDismissMode'];
|
|
450
|
+
@Input()
|
|
451
|
+
keyboardShouldPersistTaps?: IAngularScrollViewProps['keyboardShouldPersistTaps'];
|
|
452
|
+
@Input()
|
|
453
|
+
automaticallyAdjustKeyboardInsets?: IAngularScrollViewProps['automaticallyAdjustKeyboardInsets'];
|
|
454
|
+
@Input()
|
|
455
|
+
maintainVisibleContentPosition?: IAngularScrollViewProps['maintainVisibleContentPosition'];
|
|
456
|
+
@Input() maximumZoomScale?: IAngularScrollViewProps['maximumZoomScale'];
|
|
457
|
+
@Input() minimumZoomScale?: IAngularScrollViewProps['minimumZoomScale'];
|
|
458
|
+
@Input() zoomScale?: IAngularScrollViewProps['zoomScale'];
|
|
459
|
+
@Input() nestedScrollEnabled?: IAngularScrollViewProps['nestedScrollEnabled'];
|
|
460
|
+
@Input() overScrollMode?: IAngularScrollViewProps['overScrollMode'];
|
|
461
|
+
@Input() pagingEnabled?: IAngularScrollViewProps['pagingEnabled'];
|
|
462
|
+
@Input() persistentScrollbar?: IAngularScrollViewProps['persistentScrollbar'];
|
|
463
|
+
@Input() pinchGestureEnabled?: IAngularScrollViewProps['pinchGestureEnabled'];
|
|
464
|
+
@Input() snapToAlignment?: IAngularScrollViewProps['snapToAlignment'];
|
|
465
|
+
@Input() snapToEnd?: IAngularScrollViewProps['snapToEnd'];
|
|
466
|
+
@Input() snapToInterval?: IAngularScrollViewProps['snapToInterval'];
|
|
467
|
+
@Input() snapToOffsets?: IAngularScrollViewProps['snapToOffsets'];
|
|
468
|
+
@Input() snapToStart?: IAngularScrollViewProps['snapToStart'];
|
|
469
|
+
@Input() stickyHeaderIndices?: IAngularScrollViewProps['stickyHeaderIndices'];
|
|
470
|
+
@Input() onScroll?: IAngularScrollViewProps['onScroll'];
|
|
471
|
+
@Input() onScrollBeginDrag?: IAngularScrollViewProps['onScrollBeginDrag'];
|
|
472
|
+
@Input() onScrollEndDrag?: IAngularScrollViewProps['onScrollEndDrag'];
|
|
473
|
+
@Input()
|
|
474
|
+
onMomentumScrollBegin?: IAngularScrollViewProps['onMomentumScrollBegin'];
|
|
475
|
+
@Input() onMomentumScrollEnd?: IAngularScrollViewProps['onMomentumScrollEnd'];
|
|
476
|
+
@Input() onScrollToTop?: IAngularScrollViewProps['onScrollToTop'];
|
|
477
|
+
@Input() onContentSizeChange?: IAngularScrollViewProps['onContentSizeChange'];
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
@Directive({ selector: 'horizontal-scroll-view', standalone: true })
|
|
481
|
+
export class HorizontalScrollViewElement extends ScrollViewElement {}
|
|
482
|
+
|
|
483
|
+
@Directive({ selector: 'scroll-content', standalone: true })
|
|
484
|
+
export class ScrollContentElement extends SymbioteElement {}
|
|
485
|
+
|
|
486
|
+
@Directive({ selector: 'horizontal-scroll-content', standalone: true })
|
|
487
|
+
export class HorizontalScrollContentElement extends SymbioteElement {}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* The `[(value)]` half of a controlled tag — `<switch>` and `<text-input>`.
|
|
491
|
+
*
|
|
492
|
+
* The one `@Output` in this file, and it is FORCED rather than chosen. `[(value)]` desugars to
|
|
493
|
+
* `[value]` + `(valueChange)`, and ngtsc requires both halves to resolve to the SAME target: a
|
|
494
|
+
* declared `value` input beside an event no directive claims is NG8007, "the property and event
|
|
495
|
+
* halves are not bound to the same target". So the sugar this adapter documents cannot work without
|
|
496
|
+
* the output existing, whatever the file header says about events in general.
|
|
497
|
+
*
|
|
498
|
+
* The bridge below is NOT what makes the binding work today, and the comment says so because the
|
|
499
|
+
* obvious reading is wrong: the file header's "an `@Output` CONSUMES the binding" holds for a
|
|
500
|
+
* COMPONENT, and an element is the other case — Angular attaches the renderer listener for the
|
|
501
|
+
* event as well, so `Renderer2.listen` still runs and the engine still hears the change. Measured
|
|
502
|
+
* under JIT by deleting this whole hook: every case in `lowered-two-way-value.test.ts` stayed
|
|
503
|
+
* green, delivery included, and exactly ONCE (nothing double-fires when both paths exist).
|
|
504
|
+
*
|
|
505
|
+
* It is kept because the measurement is JIT-only and this adapter has a recorded case of JIT and
|
|
506
|
+
* AOT resolving a binding differently (`test-harness-false-greens.md` §21). If AOT routes the event
|
|
507
|
+
* exclusively to the output, this hook is the only thing keeping `[(value)]` alive; if it routes to
|
|
508
|
+
* both, it is one extra listener on a control an app explicitly bound. Delete it once something
|
|
509
|
+
* executes the LINKED artifact and shows the renderer listener is attached there too.
|
|
510
|
+
*
|
|
511
|
+
* Opened only when something is SUBSCRIBED: the prop's PRESENCE is what a behavior reads to decide
|
|
512
|
+
* it is controlled, so a `<switch>` given a handler nobody asked for changes how it snaps back.
|
|
513
|
+
* `.observed` is readable from `ngOnInit` because Angular subscribes outputs in the creation pass,
|
|
514
|
+
* before the update pass runs the hook — observed directly (true for the two bound tags, false for
|
|
515
|
+
* an unbound one), not assumed.
|
|
516
|
+
*/
|
|
517
|
+
@Directive()
|
|
518
|
+
abstract class ValueChangeElement
|
|
519
|
+
extends ReadBackElement
|
|
520
|
+
implements OnInit, OnDestroy
|
|
521
|
+
{
|
|
522
|
+
private readonly valueRenderer = inject(Renderer2);
|
|
523
|
+
private readonly valueHost = inject(ElementRef);
|
|
524
|
+
private unlistenValue?: () => void;
|
|
525
|
+
|
|
526
|
+
/** `this.valueChange.observed` — the subclass owns the emitter so its payload type stays exact. */
|
|
527
|
+
protected abstract hasValueSubscriber(): boolean;
|
|
528
|
+
|
|
529
|
+
/** Narrows the engine's unwrapped value to the type THIS tag emits, then emits it. */
|
|
530
|
+
protected abstract emitValue(value: unknown): void;
|
|
531
|
+
|
|
532
|
+
ngOnInit(): void {
|
|
533
|
+
if (!this.hasValueSubscriber()) return;
|
|
534
|
+
this.unlistenValue = this.valueRenderer.listen(
|
|
535
|
+
this.valueHost.nativeElement,
|
|
536
|
+
VALUE_CHANGE_EVENT,
|
|
537
|
+
(value: unknown) => {
|
|
538
|
+
this.emitValue(value);
|
|
539
|
+
},
|
|
540
|
+
);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
override ngOnDestroy(): void {
|
|
544
|
+
super.ngOnDestroy();
|
|
545
|
+
this.unlistenValue?.();
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
@Directive({ selector: 'text-input', standalone: true })
|
|
550
|
+
export class TextInputElement extends ValueChangeElement {
|
|
551
|
+
@Input() value?: ITextInputProps['value'];
|
|
552
|
+
@Input() defaultValue?: ITextInputProps['defaultValue'];
|
|
553
|
+
@Input() placeholder?: ITextInputProps['placeholder'];
|
|
554
|
+
@Input() placeholderTextColor?: ITextInputProps['placeholderTextColor'];
|
|
555
|
+
@Input() multiline?: ITextInputProps['multiline'];
|
|
556
|
+
@Input() numberOfLines?: ITextInputProps['numberOfLines'];
|
|
557
|
+
@Input() maxLength?: ITextInputProps['maxLength'];
|
|
558
|
+
@Input() editable?: ITextInputProps['editable'];
|
|
559
|
+
@Input() readOnly?: ITextInputProps['readOnly'];
|
|
560
|
+
@Input() autoFocus?: ITextInputProps['autoFocus'];
|
|
561
|
+
@Input() autoCapitalize?: ITextInputProps['autoCapitalize'];
|
|
562
|
+
@Input() autoComplete?: ITextInputProps['autoComplete'];
|
|
563
|
+
@Input() autoCorrect?: ITextInputProps['autoCorrect'];
|
|
564
|
+
@Input() blurOnSubmit?: ITextInputProps['blurOnSubmit'];
|
|
565
|
+
@Input() submitBehavior?: ITextInputProps['submitBehavior'];
|
|
566
|
+
@Input() cursorColor?: ITextInputProps['cursorColor'];
|
|
567
|
+
@Input() enterKeyHint?: ITextInputProps['enterKeyHint'];
|
|
568
|
+
@Input() returnKeyType?: ITextInputProps['returnKeyType'];
|
|
569
|
+
@Input() inputMode?: ITextInputProps['inputMode'];
|
|
570
|
+
@Input() keyboardType?: ITextInputProps['keyboardType'];
|
|
571
|
+
@Input() inputAccessoryViewID?: ITextInputProps['inputAccessoryViewID'];
|
|
572
|
+
@Input() scrollEnabled?: ITextInputProps['scrollEnabled'];
|
|
573
|
+
@Input() secureTextEntry?: ITextInputProps['secureTextEntry'];
|
|
574
|
+
@Input() selectTextOnFocus?: ITextInputProps['selectTextOnFocus'];
|
|
575
|
+
@Input() selection?: ITextInputProps['selection'];
|
|
576
|
+
@Input() selectionColor?: ITextInputProps['selectionColor'];
|
|
577
|
+
@Input() selectionHandleColor?: ITextInputProps['selectionHandleColor'];
|
|
578
|
+
@Input() showSoftInputOnFocus?: ITextInputProps['showSoftInputOnFocus'];
|
|
579
|
+
@Input() textAlign?: ITextInputProps['textAlign'];
|
|
580
|
+
@Input() textContentType?: ITextInputProps['textContentType'];
|
|
581
|
+
@Input() underlineColorAndroid?: ITextInputProps['underlineColorAndroid'];
|
|
582
|
+
@Input() onValueChange?: ITextInputProps['onValueChange'];
|
|
583
|
+
@Input() onContentSizeChange?: ITextInputProps['onContentSizeChange'];
|
|
584
|
+
@Input() onEndEditing?: ITextInputProps['onEndEditing'];
|
|
585
|
+
@Input() onKeyPress?: ITextInputProps['onKeyPress'];
|
|
586
|
+
@Input() onSelectionChange?: ITextInputProps['onSelectionChange'];
|
|
587
|
+
@Input() onSubmitEditing?: ITextInputProps['onSubmitEditing'];
|
|
588
|
+
|
|
589
|
+
// NonNullable, not the prop type: `[(value)]="name"` binds a `string`, and an emitter that can
|
|
590
|
+
// also emit `undefined` fails the two-way assignability check ngtsc runs on the event half.
|
|
591
|
+
@Output() readonly valueChange = new EventEmitter<
|
|
592
|
+
NonNullable<ITextInputProps['value']>
|
|
593
|
+
>();
|
|
594
|
+
|
|
595
|
+
protected hasValueSubscriber(): boolean {
|
|
596
|
+
return this.valueChange.observed;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
protected emitValue(value: unknown): void {
|
|
600
|
+
if (typeof value === 'string') this.valueChange.emit(value);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
@Directive({ selector: 'text-input-multiline', standalone: true })
|
|
605
|
+
export class MultilineTextInputElement extends TextInputElement {}
|
|
606
|
+
|
|
607
|
+
// The COMPONENT path's spelling of the pair above — same native views, a tag the behavior registry
|
|
608
|
+
// deliberately does not carry (`component-names/shared.ts`). Declared so the tag alphabet is
|
|
609
|
+
// complete; an app writes the plain name.
|
|
610
|
+
@Directive({ selector: 'text-input-managed', standalone: true })
|
|
611
|
+
export class ManagedTextInputElement extends TextInputElement {}
|
|
612
|
+
|
|
613
|
+
@Directive({ selector: 'text-input-multiline-managed', standalone: true })
|
|
614
|
+
export class ManagedMultilineTextInputElement extends TextInputElement {}
|
|
615
|
+
|
|
616
|
+
@Directive({ selector: 'switch', standalone: true })
|
|
617
|
+
export class SwitchElement extends ValueChangeElement {
|
|
618
|
+
@Input() value?: ISwitchProps['value'];
|
|
619
|
+
@Input() disabled?: ISwitchProps['disabled'];
|
|
620
|
+
@Input() trackColor?: ISwitchProps['trackColor'];
|
|
621
|
+
@Input() thumbColor?: ISwitchProps['thumbColor'];
|
|
622
|
+
@Input() ios_backgroundColor?: ISwitchProps['ios_backgroundColor'];
|
|
623
|
+
@Input() onValueChange?: ISwitchProps['onValueChange'];
|
|
624
|
+
|
|
625
|
+
@Output() readonly valueChange = new EventEmitter<
|
|
626
|
+
NonNullable<ISwitchProps['value']>
|
|
627
|
+
>();
|
|
628
|
+
|
|
629
|
+
protected hasValueSubscriber(): boolean {
|
|
630
|
+
return this.valueChange.observed;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
protected emitValue(value: unknown): void {
|
|
634
|
+
if (typeof value === 'boolean') this.valueChange.emit(value);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
@Directive({ selector: 'switch-managed', standalone: true })
|
|
639
|
+
export class ManagedSwitchElement extends SwitchElement {}
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* `[(ngModel)]` / `formControlName` on a `<text-input>` or a `<switch>`.
|
|
643
|
+
*
|
|
644
|
+
* The wrappers provided `NG_VALUE_ACCESSOR` themselves; a tag has no class for @angular/forms to
|
|
645
|
+
* call into, so the accessor moves onto a directive of its own rather than being dropped — the
|
|
646
|
+
* shape Angular's own `DefaultValueAccessor` takes for `<input>`. Providing it unconditionally is
|
|
647
|
+
* safe: @angular/forms looks the accessor up only when an `ngModel` / `formControl*` directive sits
|
|
648
|
+
* on the SAME element, so a plain `<switch [(value)]>` never reaches it.
|
|
649
|
+
*
|
|
650
|
+
* Everything below goes through `Renderer2`, which is the adapter's own — `setProperty` lands in
|
|
651
|
+
* `routeProp` and `listen('valueChange')` is already unwrapped to a bare value there, so this
|
|
652
|
+
* directive holds no fold of its own.
|
|
653
|
+
*/
|
|
654
|
+
@Directive()
|
|
655
|
+
abstract class SymbioteValueAccessor
|
|
656
|
+
implements ControlValueAccessor, OnDestroy
|
|
657
|
+
{
|
|
658
|
+
private readonly renderer = inject(Renderer2);
|
|
659
|
+
private readonly host = inject(ElementRef);
|
|
660
|
+
private unlisten?: () => void;
|
|
661
|
+
|
|
662
|
+
// The prop that spells "not editable" for this tag: RN's TextInput has no `disabled`, it has
|
|
663
|
+
// `editable` (inverted), while Switch takes `disabled` straight.
|
|
664
|
+
protected abstract writeDisabled(isDisabled: boolean): void;
|
|
665
|
+
|
|
666
|
+
protected setProp(name: string, value: unknown): void {
|
|
667
|
+
this.renderer.setProperty(this.host.nativeElement, name, value);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
writeValue(value: unknown): void {
|
|
671
|
+
this.setProp('value', value ?? undefined);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
registerOnChange(fn: (value: unknown) => void): void {
|
|
675
|
+
this.unlisten?.();
|
|
676
|
+
this.unlisten = this.renderer.listen(
|
|
677
|
+
this.host.nativeElement,
|
|
678
|
+
VALUE_CHANGE_EVENT,
|
|
679
|
+
(value: unknown) => {
|
|
680
|
+
fn(value);
|
|
681
|
+
},
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
// Native has no blur-driven "touched" signal distinct from `blur`, and RN's own onBlur is what an
|
|
686
|
+
// app binds — so touched is driven off the same event rather than a second channel.
|
|
687
|
+
registerOnTouched(fn: () => void): void {
|
|
688
|
+
this.setProp('onBlur', () => fn());
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
setDisabledState(isDisabled: boolean): void {
|
|
692
|
+
this.writeDisabled(isDisabled);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
ngOnDestroy(): void {
|
|
696
|
+
this.unlisten?.();
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
@Directive({
|
|
701
|
+
selector:
|
|
702
|
+
'text-input[ngModel], text-input[formControl], text-input[formControlName], text-input-multiline[ngModel], text-input-multiline[formControl], text-input-multiline[formControlName]',
|
|
703
|
+
standalone: true,
|
|
704
|
+
providers: [
|
|
705
|
+
{
|
|
706
|
+
provide: NG_VALUE_ACCESSOR,
|
|
707
|
+
useExisting: forwardRef(() => TextInputValueAccessor),
|
|
708
|
+
multi: true,
|
|
709
|
+
},
|
|
710
|
+
],
|
|
711
|
+
})
|
|
712
|
+
export class TextInputValueAccessor extends SymbioteValueAccessor {
|
|
713
|
+
protected override writeDisabled(isDisabled: boolean): void {
|
|
714
|
+
this.setProp('editable', !isDisabled);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
@Directive({
|
|
719
|
+
selector:
|
|
720
|
+
'switch[ngModel], switch[formControl], switch[formControlName], switch-managed[ngModel], switch-managed[formControl], switch-managed[formControlName]',
|
|
721
|
+
standalone: true,
|
|
722
|
+
providers: [
|
|
723
|
+
{
|
|
724
|
+
provide: NG_VALUE_ACCESSOR,
|
|
725
|
+
useExisting: forwardRef(() => SwitchValueAccessor),
|
|
726
|
+
multi: true,
|
|
727
|
+
},
|
|
728
|
+
],
|
|
729
|
+
})
|
|
730
|
+
export class SwitchValueAccessor extends SymbioteValueAccessor {
|
|
731
|
+
protected override writeDisabled(isDisabled: boolean): void {
|
|
732
|
+
this.setProp('disabled', isDisabled);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
// The HOST — RN's centering RCTView (ActivityIndicator.js:112), which is the tag an app writes.
|
|
737
|
+
// The four spinner props are declared here because that is where the app writes them; the engine's
|
|
738
|
+
// behavior redirects them onto the spinner it builds underneath (`slotProps`).
|
|
739
|
+
@Directive({ selector: 'activity-indicator', standalone: true })
|
|
740
|
+
export class ActivityIndicatorElement extends SymbioteElement {
|
|
741
|
+
@Input() animating?: IActivityIndicatorProps['animating'];
|
|
742
|
+
@Input() color?: IActivityIndicatorProps['color'];
|
|
743
|
+
@Input() size?: IActivityIndicatorProps['size'];
|
|
744
|
+
@Input() hidesWhenStopped?: IActivityIndicatorProps['hidesWhenStopped'];
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
// The native spinner. Built by the behavior's `buildStructure` and by the wrapper's render fn, never
|
|
748
|
+
// written in an app template — declared only so the tag alphabet stays covered, the same as
|
|
749
|
+
// `scroll-content`.
|
|
750
|
+
@Directive({ selector: 'activity-indicator-spinner', standalone: true })
|
|
751
|
+
export class ActivityIndicatorSpinnerElement extends ActivityIndicatorElement {}
|
|
752
|
+
|
|
753
|
+
@Directive({ selector: 'safe-area-view', standalone: true })
|
|
754
|
+
export class SafeAreaViewElement extends SymbioteElement {}
|
|
755
|
+
|
|
756
|
+
@Directive({ selector: 'modal', standalone: true })
|
|
757
|
+
export class ModalElement extends SymbioteElement {
|
|
758
|
+
@Input() visible?: IModalViewProps['visible'];
|
|
759
|
+
@Input() transparent?: IModalViewProps['transparent'];
|
|
760
|
+
@Input() animationType?: IModalViewProps['animationType'];
|
|
761
|
+
@Input() presentationStyle?: IModalViewProps['presentationStyle'];
|
|
762
|
+
@Input() supportedOrientations?: IModalViewProps['supportedOrientations'];
|
|
763
|
+
@Input() hardwareAccelerated?: IModalViewProps['hardwareAccelerated'];
|
|
764
|
+
@Input() statusBarTranslucent?: IModalViewProps['statusBarTranslucent'];
|
|
765
|
+
@Input()
|
|
766
|
+
navigationBarTranslucent?: IModalViewProps['navigationBarTranslucent'];
|
|
767
|
+
@Input() allowSwipeDismissal?: IModalViewProps['allowSwipeDismissal'];
|
|
768
|
+
@Input() backdropColor?: IModalViewProps['backdropColor'];
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
@Directive({ selector: 'refresh-control', standalone: true })
|
|
772
|
+
export class RefreshControlElement extends ReadBackElement {
|
|
773
|
+
@Input() refreshing?: IAngularRefreshControlProps['refreshing'];
|
|
774
|
+
@Input() enabled?: IAngularRefreshControlProps['enabled'];
|
|
775
|
+
@Input() colors?: IAngularRefreshControlProps['colors'];
|
|
776
|
+
@Input() tintColor?: IAngularRefreshControlProps['tintColor'];
|
|
777
|
+
@Input() title?: IAngularRefreshControlProps['title'];
|
|
778
|
+
@Input() titleColor?: IAngularRefreshControlProps['titleColor'];
|
|
779
|
+
@Input() size?: IAngularRefreshControlProps['size'];
|
|
780
|
+
@Input()
|
|
781
|
+
progressBackgroundColor?: IAngularRefreshControlProps['progressBackgroundColor'];
|
|
782
|
+
@Input()
|
|
783
|
+
progressViewOffset?: IAngularRefreshControlProps['progressViewOffset'];
|
|
784
|
+
@Input() onRefresh?: IAngularRefreshControlProps['onRefresh'];
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
@Directive({ selector: 'sticky-header', standalone: true })
|
|
788
|
+
export class StickyHeaderElement extends SymbioteElement {
|
|
789
|
+
@Input() inverted?: IStickyHeaderElementProps['inverted'];
|
|
790
|
+
@Input() nextHeaderLayoutY?: IStickyHeaderElementProps['nextHeaderLayoutY'];
|
|
791
|
+
@Input()
|
|
792
|
+
scrollAnimatedValue?: IStickyHeaderElementProps['scrollAnimatedValue'];
|
|
793
|
+
@Input() scrollViewHeight?: IStickyHeaderElementProps['scrollViewHeight'];
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
@Directive({ selector: 'input-accessory-view', standalone: true })
|
|
797
|
+
export class InputAccessoryViewElement extends SymbioteElement {
|
|
798
|
+
@Input() backgroundColor?: IInputAccessoryViewViewProps['backgroundColor'];
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Every element directive, as ONE symbol an app puts in `imports`. Angular flattens a nested array
|
|
803
|
+
* there, so the line does not grow as the tag alphabet does — and a per-component `imports` line is
|
|
804
|
+
* the floor for standalone components whatever we ship (there is no global-import mechanism, by
|
|
805
|
+
* design: angular/angular#43784).
|
|
806
|
+
*
|
|
807
|
+
* `elements.test.ts` asserts this covers every key of `COMPONENT_DESCRIPTORS`, derived from that
|
|
808
|
+
* table, so a future primitive joins by existing rather than by someone remembering.
|
|
809
|
+
*/
|
|
810
|
+
export const SYMBIOTE_ELEMENTS = [
|
|
811
|
+
ViewElement,
|
|
812
|
+
PressableElement,
|
|
813
|
+
TouchableOpacityElement,
|
|
814
|
+
TouchableHighlightElement,
|
|
815
|
+
TouchableNativeFeedbackElement,
|
|
816
|
+
TouchableWithoutFeedbackElement,
|
|
817
|
+
ButtonElement,
|
|
818
|
+
TextElement,
|
|
819
|
+
ImageElement,
|
|
820
|
+
ImageBackgroundElement,
|
|
821
|
+
ScrollViewElement,
|
|
822
|
+
HorizontalScrollViewElement,
|
|
823
|
+
ScrollContentElement,
|
|
824
|
+
HorizontalScrollContentElement,
|
|
825
|
+
TextInputElement,
|
|
826
|
+
MultilineTextInputElement,
|
|
827
|
+
ManagedTextInputElement,
|
|
828
|
+
ManagedMultilineTextInputElement,
|
|
829
|
+
SwitchElement,
|
|
830
|
+
ManagedSwitchElement,
|
|
831
|
+
ActivityIndicatorElement,
|
|
832
|
+
ActivityIndicatorSpinnerElement,
|
|
833
|
+
SafeAreaViewElement,
|
|
834
|
+
ModalElement,
|
|
835
|
+
RefreshControlElement,
|
|
836
|
+
StickyHeaderElement,
|
|
837
|
+
InputAccessoryViewElement,
|
|
838
|
+
// Not tags — the `[(ngModel)]` / `formControl*` accessors for the two controlled ones. They ride
|
|
839
|
+
// this list so an app that already imports it keeps the forms integration the deleted wrappers
|
|
840
|
+
// provided, and `elements.test.ts` subtracts them from its tag-coverage check by name.
|
|
841
|
+
TextInputValueAccessor,
|
|
842
|
+
SwitchValueAccessor,
|
|
843
|
+
] as const;
|
|
844
|
+
|
|
845
|
+
// A prop this file forgets is not a silent gap — it is `Can't bind to 'x'` in the app that tries
|
|
846
|
+
// it, which is the failure mode a hand-written list produces here. So the lists are checked
|
|
847
|
+
// against the prop TYPES rather than trusted: each assertion below resolves to `true` only when
|
|
848
|
+
// the directive declares every key of its interface, and otherwise fails with the missing NAMES in
|
|
849
|
+
// the message. It runs under `tsc --build`, which is what makes it a guard rather than a comment.
|
|
850
|
+
//
|
|
851
|
+
// `style` used to be excluded from every row; it is checked like any other prop now that the base
|
|
852
|
+
// declares it. `passthrough` and `StickyHeaderComponent` are internal render inputs of a composed
|
|
853
|
+
// component, never props of a native view.
|
|
854
|
+
type IMissingInputs<TProps, TDirective, TIgnored extends PropertyKey = never> =
|
|
855
|
+
Exclude<keyof TProps, keyof TDirective | TIgnored> extends never
|
|
856
|
+
? true
|
|
857
|
+
: Exclude<keyof TProps, keyof TDirective | TIgnored>;
|
|
858
|
+
|
|
859
|
+
const DECLARES_EVERY_PROP: {
|
|
860
|
+
view: IMissingInputs<IElementProps, ViewElement>;
|
|
861
|
+
pressable: IMissingInputs<IAngularPressableProps, PressableElement>;
|
|
862
|
+
// The two touchables, added when their wrappers were deleted (2026-09-11). They inherit
|
|
863
|
+
// `PressableElement`, so the rows above would pass whatever these declared — what they pin is the
|
|
864
|
+
// per-touchable surface (`activeOpacity`, `underlayColor`, the three timing knobs), which used to
|
|
865
|
+
// be fenced by a source-text assertion over the wrapper's template in `angular-gaps.test.ts`.
|
|
866
|
+
touchableOpacity: IMissingInputs<
|
|
867
|
+
IAngularTouchableOpacityProps,
|
|
868
|
+
TouchableOpacityElement
|
|
869
|
+
>;
|
|
870
|
+
touchableHighlight: IMissingInputs<
|
|
871
|
+
IAngularTouchableHighlightProps,
|
|
872
|
+
TouchableHighlightElement
|
|
873
|
+
>;
|
|
874
|
+
text: IMissingInputs<ITextElementProps, TextElement>;
|
|
875
|
+
image: IMissingInputs<IImageProps, ImageElement>;
|
|
876
|
+
imageBackground: IMissingInputs<
|
|
877
|
+
IAngularImageBackgroundProps,
|
|
878
|
+
ImageBackgroundElement
|
|
879
|
+
>;
|
|
880
|
+
scrollView: IMissingInputs<
|
|
881
|
+
IAngularScrollViewProps,
|
|
882
|
+
ScrollViewElement,
|
|
883
|
+
'StickyHeaderComponent'
|
|
884
|
+
>;
|
|
885
|
+
textInput: IMissingInputs<ITextInputProps, TextInputElement>;
|
|
886
|
+
switch: IMissingInputs<ISwitchProps, SwitchElement>;
|
|
887
|
+
activityIndicator: IMissingInputs<
|
|
888
|
+
IActivityIndicatorProps,
|
|
889
|
+
ActivityIndicatorElement
|
|
890
|
+
>;
|
|
891
|
+
modal: IMissingInputs<IModalViewProps, ModalElement, 'passthrough'>;
|
|
892
|
+
refreshControl: IMissingInputs<
|
|
893
|
+
IAngularRefreshControlProps,
|
|
894
|
+
RefreshControlElement
|
|
895
|
+
>;
|
|
896
|
+
stickyHeader: IMissingInputs<IStickyHeaderElementProps, StickyHeaderElement>;
|
|
897
|
+
inputAccessoryView: IMissingInputs<
|
|
898
|
+
IInputAccessoryViewViewProps,
|
|
899
|
+
InputAccessoryViewElement,
|
|
900
|
+
'passthrough'
|
|
901
|
+
>;
|
|
902
|
+
} = {
|
|
903
|
+
view: true,
|
|
904
|
+
pressable: true,
|
|
905
|
+
touchableOpacity: true,
|
|
906
|
+
touchableHighlight: true,
|
|
907
|
+
text: true,
|
|
908
|
+
image: true,
|
|
909
|
+
imageBackground: true,
|
|
910
|
+
scrollView: true,
|
|
911
|
+
textInput: true,
|
|
912
|
+
switch: true,
|
|
913
|
+
activityIndicator: true,
|
|
914
|
+
modal: true,
|
|
915
|
+
refreshControl: true,
|
|
916
|
+
stickyHeader: true,
|
|
917
|
+
inputAccessoryView: true,
|
|
918
|
+
};
|
|
919
|
+
void DECLARES_EVERY_PROP;
|