@ng-native/components 0.0.1 → 0.1.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/LICENSE +21 -0
- package/README.md +78 -1
- package/dist/activity-indicator.d.ts +41 -0
- package/dist/activity-indicator.js +66 -0
- package/dist/activity-indicator.js.map +1 -0
- package/dist/animated-style.d.ts +31 -0
- package/dist/animated-style.js +102 -0
- package/dist/animated-style.js.map +1 -0
- package/dist/animated.d.ts +125 -0
- package/dist/animated.js +538 -0
- package/dist/animated.js.map +1 -0
- package/dist/animation.d.ts +40 -0
- package/dist/animation.js +20 -0
- package/dist/animation.js.map +1 -0
- package/dist/animations-web.d.ts +8 -0
- package/dist/animations-web.js +31 -0
- package/dist/animations-web.js.map +1 -0
- package/dist/animations.d.ts +7 -0
- package/dist/animations.js +58 -0
- package/dist/animations.js.map +1 -0
- package/dist/controlled-model.d.ts +33 -0
- package/dist/controlled-model.js +47 -0
- package/dist/controlled-model.js.map +1 -0
- package/dist/easing.d.ts +21 -0
- package/dist/easing.js +50 -0
- package/dist/easing.js.map +1 -0
- package/dist/events.d.ts +169 -0
- package/dist/events.js +2 -0
- package/dist/events.js.map +1 -0
- package/dist/gesture-backend.d.ts +26 -0
- package/dist/gesture-backend.js +14 -0
- package/dist/gesture-backend.js.map +1 -0
- package/dist/gesture-dispatch.d.ts +67 -0
- package/dist/gesture-dispatch.js +106 -0
- package/dist/gesture-dispatch.js.map +1 -0
- package/dist/gestures.d.ts +23 -0
- package/dist/gestures.js +164 -0
- package/dist/gestures.js.map +1 -0
- package/dist/height-index.d.ts +31 -0
- package/dist/height-index.js +80 -0
- package/dist/height-index.js.map +1 -0
- package/dist/image-background.d.ts +32 -0
- package/dist/image-background.js +80 -0
- package/dist/image-background.js.map +1 -0
- package/dist/image.d.ts +79 -0
- package/dist/image.js +155 -0
- package/dist/image.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/input-accessory-view.d.ts +16 -0
- package/dist/input-accessory-view.js +29 -0
- package/dist/input-accessory-view.js.map +1 -0
- package/dist/keyboard-avoiding-view.d.ts +79 -0
- package/dist/keyboard-avoiding-view.js +172 -0
- package/dist/keyboard-avoiding-view.js.map +1 -0
- package/dist/keyboard-dock.d.ts +126 -0
- package/dist/keyboard-dock.js +327 -0
- package/dist/keyboard-dock.js.map +1 -0
- package/dist/keyboard-taps.d.ts +12 -0
- package/dist/keyboard-taps.js +51 -0
- package/dist/keyboard-taps.js.map +1 -0
- package/dist/modal.d.ts +56 -0
- package/dist/modal.js +102 -0
- package/dist/modal.js.map +1 -0
- package/dist/native-gesture.d.ts +21 -0
- package/dist/native-gesture.js +56 -0
- package/dist/native-gesture.js.map +1 -0
- package/dist/native-ref.d.ts +7 -0
- package/dist/native-ref.js +13 -0
- package/dist/native-ref.js.map +1 -0
- package/dist/pressable.d.ts +220 -0
- package/dist/pressable.js +484 -0
- package/dist/pressable.js.map +1 -0
- package/dist/reanimated.d.ts +19 -0
- package/dist/reanimated.js +111 -0
- package/dist/reanimated.js.map +1 -0
- package/dist/refresh-control.d.ts +50 -0
- package/dist/refresh-control.js +103 -0
- package/dist/refresh-control.js.map +1 -0
- package/dist/safe-area-provider.d.ts +11 -0
- package/dist/safe-area-provider.js +70 -0
- package/dist/safe-area-provider.js.map +1 -0
- package/dist/safe-area-view.d.ts +22 -0
- package/dist/safe-area-view.js +77 -0
- package/dist/safe-area-view.js.map +1 -0
- package/dist/safe-area.d.ts +12 -0
- package/dist/safe-area.js +27 -0
- package/dist/safe-area.js.map +1 -0
- package/dist/scroll-view-props.d.ts +89 -0
- package/dist/scroll-view-props.js +153 -0
- package/dist/scroll-view-props.js.map +1 -0
- package/dist/scroll-view.d.ts +95 -0
- package/dist/scroll-view.js +181 -0
- package/dist/scroll-view.js.map +1 -0
- package/dist/section-list.d.ts +146 -0
- package/dist/section-list.js +300 -0
- package/dist/section-list.js.map +1 -0
- package/dist/sticky-headers.d.ts +41 -0
- package/dist/sticky-headers.js +118 -0
- package/dist/sticky-headers.js.map +1 -0
- package/dist/swipe-refresh-layout.d.ts +51 -0
- package/dist/swipe-refresh-layout.js +162 -0
- package/dist/swipe-refresh-layout.js.map +1 -0
- package/dist/switch.d.ts +54 -0
- package/dist/switch.js +110 -0
- package/dist/switch.js.map +1 -0
- package/dist/template-slot.d.ts +18 -0
- package/dist/template-slot.js +30 -0
- package/dist/template-slot.js.map +1 -0
- package/dist/text-input.d.ts +168 -0
- package/dist/text-input.js +312 -0
- package/dist/text-input.js.map +1 -0
- package/dist/text.d.ts +70 -0
- package/dist/text.js +111 -0
- package/dist/text.js.map +1 -0
- package/dist/touchable-opacity.d.ts +36 -0
- package/dist/touchable-opacity.js +76 -0
- package/dist/touchable-opacity.js.map +1 -0
- package/dist/transforms.d.ts +2 -0
- package/dist/transforms.js +17 -0
- package/dist/transforms.js.map +1 -0
- package/dist/view-base.d.ts +332 -0
- package/dist/view-base.js +534 -0
- package/dist/view-base.js.map +1 -0
- package/dist/view.d.ts +12 -0
- package/dist/view.js +18 -0
- package/dist/view.js.map +1 -0
- package/dist/virtual-list.d.ts +530 -0
- package/dist/virtual-list.js +1150 -0
- package/dist/virtual-list.js.map +1 -0
- package/dist/worklet-scroll.d.ts +13 -0
- package/dist/worklet-scroll.js +49 -0
- package/dist/worklet-scroll.js.map +1 -0
- package/dist/worklet-style.d.ts +13 -0
- package/dist/worklet-style.js +47 -0
- package/dist/worklet-style.js.map +1 -0
- package/dist/worklets.d.ts +89 -0
- package/dist/worklets.js +42 -0
- package/dist/worklets.js.map +1 -0
- package/dist/written-props.d.ts +6 -0
- package/dist/written-props.js +180 -0
- package/dist/written-props.js.map +1 -0
- package/package.json +88 -3
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The props every native view accepts, as typed inputs forwarded to the host node.
|
|
3
|
+
*
|
|
4
|
+
* Each input is mirrored by a host binding of the same name, which is what carries the value to
|
|
5
|
+
* the renderer: once a directive declares an input, Angular routes the binding to the directive
|
|
6
|
+
* rather than the element. An unset input stays `undefined` and never reaches native, so a view
|
|
7
|
+
* that mentions none of these sends none of them.
|
|
8
|
+
*
|
|
9
|
+
* Web-style `aria-*` names are accepted as aliases and land on the `accessibility*` props React
|
|
10
|
+
* Native's own `View.js` maps them to. `id` maps to `nativeID` and `tabIndex` to `focusable` the
|
|
11
|
+
* same way.
|
|
12
|
+
*
|
|
13
|
+
* Events are element events, typed in `events.ts`: `(layout)`, `(touchStart)`,
|
|
14
|
+
* `(accessibilityAction)` and so on. They are deliberately not outputs; see that file.
|
|
15
|
+
*/
|
|
16
|
+
import { Directive, ElementRef, inject, input } from '@angular/core';
|
|
17
|
+
import { HostEngine, claimHost, declareNativeProps } from '@ng-native/fabric';
|
|
18
|
+
import { optionalBoolean, optionalNumber } from "./transforms.js";
|
|
19
|
+
import { WRITTEN_PROPS } from "./written-props.js";
|
|
20
|
+
import * as i0 from "@angular/core";
|
|
21
|
+
/**
|
|
22
|
+
* Angular writes a static attribute to the element as well as feeding it to the input of the
|
|
23
|
+
* same name, so `<switch thumbColor="#fff">` leaves a stray `thumbColor` prop on the node next to
|
|
24
|
+
* the `thumbTintColor` the input produces. The inputs of the directive are what consumed them,
|
|
25
|
+
* so those names come off the node; a host binding puts back any that native does read.
|
|
26
|
+
*
|
|
27
|
+
* Walking the *node's* props rather than the directive's inputs is not a detail. This runs for
|
|
28
|
+
* every element on screen, a primitive declares some forty-five inputs, and at this point the node
|
|
29
|
+
* usually has no props at all - bindings have not run yet, so only static attributes are there.
|
|
30
|
+
* The other way round it was forty-five `delete`s per element on an object that had none of them,
|
|
31
|
+
* which is both wasted work and the way to push an object into dictionary mode.
|
|
32
|
+
*/
|
|
33
|
+
/** Shallow equality, so a re-merged state that says the same thing keeps its identity. */
|
|
34
|
+
function sameState(a, b) {
|
|
35
|
+
const keys = Object.keys(a);
|
|
36
|
+
return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);
|
|
37
|
+
}
|
|
38
|
+
/** The host primitives whose props have been declared to the engine. */
|
|
39
|
+
const declared = new WeakSet();
|
|
40
|
+
/**
|
|
41
|
+
* Tell the engine the props this primitive's native view takes, once per component class: its
|
|
42
|
+
* inputs by their public names, and `WRITTEN_PROPS`. What its check for a misspelt prop reads.
|
|
43
|
+
*/
|
|
44
|
+
function declareProps(ctor, node) {
|
|
45
|
+
if (declared.has(ctor))
|
|
46
|
+
return;
|
|
47
|
+
declared.add(ctor);
|
|
48
|
+
const def = ctor.ɵcmp ??
|
|
49
|
+
ctor.ɵdir;
|
|
50
|
+
const name = node.name;
|
|
51
|
+
if (!name || !def?.inputs)
|
|
52
|
+
return;
|
|
53
|
+
declareNativeProps(name, [...Object.keys(def.inputs), ...WRITTEN_PROPS]);
|
|
54
|
+
}
|
|
55
|
+
function stripConsumedAttributes(ctor, node) {
|
|
56
|
+
const { ɵcmp, ɵdir } = ctor;
|
|
57
|
+
const def = ɵcmp ?? (ɵdir?.selectors?.length ? ɵdir : undefined);
|
|
58
|
+
const inputs = def?.inputs;
|
|
59
|
+
if (!inputs)
|
|
60
|
+
return;
|
|
61
|
+
// A host that has not put a bag on the node yet has no attributes to take off it. Read
|
|
62
|
+
// unconditionally, this threw `Cannot convert undefined or null to object` on the first
|
|
63
|
+
// component a browser host ever mounted, before anything rendered - which is a hard crash
|
|
64
|
+
// standing between this package and a second platform, for a loop with nothing to do.
|
|
65
|
+
const props = node.props;
|
|
66
|
+
if (!props)
|
|
67
|
+
return;
|
|
68
|
+
for (const name of Object.keys(props)) {
|
|
69
|
+
if (name in inputs)
|
|
70
|
+
delete props[name];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** Where an element's contributions are kept: on the node, and only on a node that has some. */
|
|
74
|
+
const CONTRIBUTIONS = Symbol('angular-native.accessibilityContributions');
|
|
75
|
+
const NO_CONTRIBUTIONS = [];
|
|
76
|
+
/**
|
|
77
|
+
* Tell the primitive on this element what it is, for a screen reader: a role, and state to merge
|
|
78
|
+
* into what it announces. Call it from a directive's field initialiser or constructor, on the
|
|
79
|
+
* element the primitive is on:
|
|
80
|
+
*
|
|
81
|
+
* private readonly contribution = contributeAccessibility({ role: 'button' });
|
|
82
|
+
* private readonly contribution = contributeAccessibility(this);
|
|
83
|
+
*
|
|
84
|
+
* Kept on the node rather than provided through DI, because asking the injector costs every
|
|
85
|
+
* element on screen a lookup to learn that nothing contributes - about a tenth of creating a list.
|
|
86
|
+
* Reading a property that is not there costs nothing.
|
|
87
|
+
*/
|
|
88
|
+
export function contributeAccessibility(contribution) {
|
|
89
|
+
const node = inject(ElementRef).nativeElement;
|
|
90
|
+
(node[CONTRIBUTIONS] ??= []).push(contribution);
|
|
91
|
+
return contribution;
|
|
92
|
+
}
|
|
93
|
+
export class ViewBase {
|
|
94
|
+
/** The retained node this directive sits on. */
|
|
95
|
+
node = inject(ElementRef).nativeElement;
|
|
96
|
+
/**
|
|
97
|
+
* The engine, because the props these inputs carry are written straight onto the node. Read
|
|
98
|
+
* off the node where the host put it there, which is one property read against an injector
|
|
99
|
+
* lookup that walks every ancestor element, for every element on screen.
|
|
100
|
+
*/
|
|
101
|
+
engine = this.node.host ?? inject(HostEngine);
|
|
102
|
+
/**
|
|
103
|
+
* See `contributeAccessibility`. Empty for every element nothing is composed onto. Read, never
|
|
104
|
+
* cached, from `ngOnInit` onwards: by then every directive on the node has been constructed and
|
|
105
|
+
* registered what it has to say.
|
|
106
|
+
*/
|
|
107
|
+
get contributions() {
|
|
108
|
+
return this.node[CONTRIBUTIONS] ?? NO_CONTRIBUTIONS;
|
|
109
|
+
}
|
|
110
|
+
constructor() {
|
|
111
|
+
claimHost(this.node);
|
|
112
|
+
stripConsumedAttributes(this.constructor, this.node);
|
|
113
|
+
declareProps(this.constructor, this.node);
|
|
114
|
+
this.engine.settle(this);
|
|
115
|
+
}
|
|
116
|
+
/** Whether `ngOnInit` has run, which is what writes the props every element starts with. */
|
|
117
|
+
initialised = false;
|
|
118
|
+
/**
|
|
119
|
+
* Write what the inputs say, for an element whose view has not been checked by the time the
|
|
120
|
+
* host commits it. Nothing for one that has.
|
|
121
|
+
*
|
|
122
|
+
* The props are written from `ngOnChanges` and `ngOnInit`, which Angular runs in the parent
|
|
123
|
+
* view's update pass. A component that detaches itself before its first check never gets one,
|
|
124
|
+
* and on the web that pattern still works, because a listener and an attribute are there from
|
|
125
|
+
* creation. So the host calls this before the commit that first mounts the element, by when its
|
|
126
|
+
* static inputs are set: the press handling, the role and the `testID` are there, and the view
|
|
127
|
+
* behaves as written once something calls `detectChanges()`.
|
|
128
|
+
*/
|
|
129
|
+
settleProps() {
|
|
130
|
+
if (this.initialised)
|
|
131
|
+
return;
|
|
132
|
+
this.ngOnChanges({});
|
|
133
|
+
this.ngOnInit();
|
|
134
|
+
}
|
|
135
|
+
// --- accessibility ---------------------------------------------------------------------
|
|
136
|
+
/** Whether the view is an accessibility element. Defaults to false for a plain view. */
|
|
137
|
+
accessible = input(undefined, { ...(ngDevMode ? { debugName: "accessible" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
138
|
+
/** What a screen reader announces for the view. */
|
|
139
|
+
accessibilityLabel = input(/* @ts-ignore */
|
|
140
|
+
...(ngDevMode ? [undefined, { debugName: "accessibilityLabel" }] : /* istanbul ignore next */ []));
|
|
141
|
+
/** `aria-label`: web spelling of `accessibilityLabel`. */
|
|
142
|
+
ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
143
|
+
/** Android: `nativeID`s of the views that label this one. */
|
|
144
|
+
accessibilityLabelledBy = input(/* @ts-ignore */
|
|
145
|
+
...(ngDevMode ? [undefined, { debugName: "accessibilityLabelledBy" }] : /* istanbul ignore next */ []));
|
|
146
|
+
/** `aria-labelledby`: web spelling of `accessibilityLabelledBy`. */
|
|
147
|
+
ariaLabelledBy = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
148
|
+
/** What happens when the user acts on the view, when the label alone does not say. */
|
|
149
|
+
accessibilityHint = input(/* @ts-ignore */
|
|
150
|
+
...(ngDevMode ? [undefined, { debugName: "accessibilityHint" }] : /* istanbul ignore next */ []));
|
|
151
|
+
/** The kind of control this is, for assistive technologies. */
|
|
152
|
+
accessibilityRole = input(/* @ts-ignore */
|
|
153
|
+
...(ngDevMode ? [undefined, { debugName: "accessibilityRole" }] : /* istanbul ignore next */ []));
|
|
154
|
+
/** `role`: the web spelling of `accessibilityRole`. */
|
|
155
|
+
role = input(/* @ts-ignore */
|
|
156
|
+
...(ngDevMode ? [undefined, { debugName: "role" }] : /* istanbul ignore next */ []));
|
|
157
|
+
/** Disabled, selected, checked, busy and expanded, as one object. */
|
|
158
|
+
accessibilityState = input(/* @ts-ignore */
|
|
159
|
+
...(ngDevMode ? [undefined, { debugName: "accessibilityState" }] : /* istanbul ignore next */ []));
|
|
160
|
+
/** `aria-busy`. */
|
|
161
|
+
ariaBusy = input(undefined, { ...(ngDevMode ? { debugName: "ariaBusy" } : /* istanbul ignore next */ {}), alias: 'aria-busy', transform: optionalBoolean });
|
|
162
|
+
/** `aria-checked`. */
|
|
163
|
+
ariaChecked = input(undefined, { ...(ngDevMode ? { debugName: "ariaChecked" } : /* istanbul ignore next */ {}), alias: 'aria-checked' });
|
|
164
|
+
/** `aria-disabled`. */
|
|
165
|
+
ariaDisabled = input(undefined, { ...(ngDevMode ? { debugName: "ariaDisabled" } : /* istanbul ignore next */ {}), alias: 'aria-disabled',
|
|
166
|
+
transform: optionalBoolean });
|
|
167
|
+
/** `aria-expanded`. */
|
|
168
|
+
ariaExpanded = input(undefined, { ...(ngDevMode ? { debugName: "ariaExpanded" } : /* istanbul ignore next */ {}), alias: 'aria-expanded',
|
|
169
|
+
transform: optionalBoolean });
|
|
170
|
+
/** `aria-selected`. */
|
|
171
|
+
ariaSelected = input(undefined, { ...(ngDevMode ? { debugName: "ariaSelected" } : /* istanbul ignore next */ {}), alias: 'aria-selected',
|
|
172
|
+
transform: optionalBoolean });
|
|
173
|
+
/** The current value of an adjustable control, for a screen reader. */
|
|
174
|
+
accessibilityValue = input(/* @ts-ignore */
|
|
175
|
+
...(ngDevMode ? [undefined, { debugName: "accessibilityValue" }] : /* istanbul ignore next */ []));
|
|
176
|
+
/** `aria-valuemin`. */
|
|
177
|
+
ariaValueMin = input(undefined, { ...(ngDevMode ? { debugName: "ariaValueMin" } : /* istanbul ignore next */ {}), alias: 'aria-valuemin',
|
|
178
|
+
transform: optionalNumber });
|
|
179
|
+
/** `aria-valuemax`. */
|
|
180
|
+
ariaValueMax = input(undefined, { ...(ngDevMode ? { debugName: "ariaValueMax" } : /* istanbul ignore next */ {}), alias: 'aria-valuemax',
|
|
181
|
+
transform: optionalNumber });
|
|
182
|
+
/** `aria-valuenow`. */
|
|
183
|
+
ariaValueNow = input(undefined, { ...(ngDevMode ? { debugName: "ariaValueNow" } : /* istanbul ignore next */ {}), alias: 'aria-valuenow',
|
|
184
|
+
transform: optionalNumber });
|
|
185
|
+
/** `aria-valuetext`. */
|
|
186
|
+
ariaValueText = input(undefined, { ...(ngDevMode ? { debugName: "ariaValueText" } : /* istanbul ignore next */ {}), alias: 'aria-valuetext' });
|
|
187
|
+
/** Custom actions a screen reader can invoke; each arrives as `(accessibilityAction)`. */
|
|
188
|
+
accessibilityActions = input(/* @ts-ignore */
|
|
189
|
+
...(ngDevMode ? [undefined, { debugName: "accessibilityActions" }] : /* istanbul ignore next */ []));
|
|
190
|
+
/** Android: announce changes to this view's content without focus moving to it. */
|
|
191
|
+
accessibilityLiveRegion = input(/* @ts-ignore */
|
|
192
|
+
...(ngDevMode ? [undefined, { debugName: "accessibilityLiveRegion" }] : /* istanbul ignore next */ []));
|
|
193
|
+
/** `aria-live`. */
|
|
194
|
+
ariaLive = input(undefined, { ...(ngDevMode ? { debugName: "ariaLive" } : /* istanbul ignore next */ {}), alias: 'aria-live' });
|
|
195
|
+
/** iOS: hide this view and its children from assistive technologies. */
|
|
196
|
+
accessibilityElementsHidden = input(undefined, { ...(ngDevMode ? { debugName: "accessibilityElementsHidden" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
197
|
+
/** `aria-hidden`: `accessibilityElementsHidden` on iOS, `no-hide-descendants` on Android. */
|
|
198
|
+
ariaHidden = input(undefined, { ...(ngDevMode ? { debugName: "ariaHidden" } : /* istanbul ignore next */ {}), alias: 'aria-hidden',
|
|
199
|
+
transform: optionalBoolean });
|
|
200
|
+
/** Android: whether this view is exposed to accessibility, and whether its children are. */
|
|
201
|
+
importantForAccessibility = input(/* @ts-ignore */
|
|
202
|
+
...(ngDevMode ? [undefined, { debugName: "importantForAccessibility" }] : /* istanbul ignore next */ []));
|
|
203
|
+
/** iOS: VoiceOver ignores every sibling while this view is shown, as a modal expects. */
|
|
204
|
+
accessibilityViewIsModal = input(undefined, { ...(ngDevMode ? { debugName: "accessibilityViewIsModal" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
205
|
+
/** `aria-modal`. */
|
|
206
|
+
ariaModal = input(undefined, { ...(ngDevMode ? { debugName: "ariaModal" } : /* istanbul ignore next */ {}), alias: 'aria-modal',
|
|
207
|
+
transform: optionalBoolean });
|
|
208
|
+
/** iOS: keep the view's colours when the Invert Colors setting is on; images want this. */
|
|
209
|
+
accessibilityIgnoresInvertColors = input(undefined, { ...(ngDevMode ? { debugName: "accessibilityIgnoresInvertColors" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
210
|
+
/** iOS: the language VoiceOver reads the label in, as a BCP 47 tag. */
|
|
211
|
+
accessibilityLanguage = input(/* @ts-ignore */
|
|
212
|
+
...(ngDevMode ? [undefined, { debugName: "accessibilityLanguage" }] : /* istanbul ignore next */ []));
|
|
213
|
+
/** iOS: the title shown by the Large Content Viewer on a long press with large text on. */
|
|
214
|
+
accessibilityLargeContentTitle = input(/* @ts-ignore */
|
|
215
|
+
...(ngDevMode ? [undefined, { debugName: "accessibilityLargeContentTitle" }] : /* istanbul ignore next */ []));
|
|
216
|
+
/** iOS: opt this view into the Large Content Viewer. */
|
|
217
|
+
accessibilityShowsLargeContentViewer = input(undefined, { ...(ngDevMode ? { debugName: "accessibilityShowsLargeContentViewer" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
218
|
+
/** iOS: tell VoiceOver the view responds to a tap even without a role that implies it. */
|
|
219
|
+
accessibilityRespondsToUserInteraction = input(undefined, { ...(ngDevMode ? { debugName: "accessibilityRespondsToUserInteraction" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
220
|
+
// --- identity and hit testing ----------------------------------------------------------
|
|
221
|
+
/** A handle native code can find the view by; also what `:id` selectors match. */
|
|
222
|
+
nativeID = input(/* @ts-ignore */
|
|
223
|
+
...(ngDevMode ? [undefined, { debugName: "nativeID" }] : /* istanbul ignore next */ []));
|
|
224
|
+
/** `id`: the web spelling of `nativeID`. */
|
|
225
|
+
id = input(/* @ts-ignore */
|
|
226
|
+
...(ngDevMode ? [undefined, { debugName: "id" }] : /* istanbul ignore next */ []));
|
|
227
|
+
/** A handle for end-to-end test tooling. */
|
|
228
|
+
testID = input(/* @ts-ignore */
|
|
229
|
+
...(ngDevMode ? [undefined, { debugName: "testID" }] : /* istanbul ignore next */ []));
|
|
230
|
+
/** Extend the touchable area beyond the view's bounds, without moving anything visible. */
|
|
231
|
+
hitSlop = input(/* @ts-ignore */
|
|
232
|
+
...(ngDevMode ? [undefined, { debugName: "hitSlop" }] : /* istanbul ignore next */ []));
|
|
233
|
+
/** Whether this view, its children, or neither can be the target of a touch. */
|
|
234
|
+
pointerEvents = input(/* @ts-ignore */
|
|
235
|
+
...(ngDevMode ? [undefined, { debugName: "pointerEvents" }] : /* istanbul ignore next */ []));
|
|
236
|
+
/** Set to false to keep a layout-only view alive; Fabric otherwise removes it from the tree. */
|
|
237
|
+
collapsable = input(undefined, { ...(ngDevMode ? { debugName: "collapsable" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
238
|
+
/** Set to false to keep this view's layout-only children from being flattened. */
|
|
239
|
+
collapsableChildren = input(undefined, { ...(ngDevMode ? { debugName: "collapsableChildren" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
240
|
+
/** Detach children that are outside the visible bounds. A scroll view optimisation. */
|
|
241
|
+
removeClippedSubviews = input(undefined, { ...(ngDevMode ? { debugName: "removeClippedSubviews" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
242
|
+
/** Composite the view offscreen so a translucent view with children blends correctly. */
|
|
243
|
+
needsOffscreenAlphaCompositing = input(undefined, { ...(ngDevMode ? { debugName: "needsOffscreenAlphaCompositing" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
244
|
+
/** Android: whether the view takes keyboard or TV focus. RN's `tabIndex` is this. */
|
|
245
|
+
focusable = input(undefined, { ...(ngDevMode ? { debugName: "focusable" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
246
|
+
/** iOS: render the view to a bitmap once and reuse it; for a static view that animates. */
|
|
247
|
+
shouldRasterizeIOS = input(undefined, { ...(ngDevMode ? { debugName: "shouldRasterizeIOS" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
248
|
+
/** Android: cache the view in a hardware texture; the same trade as `shouldRasterizeIOS`. */
|
|
249
|
+
renderToHardwareTextureAndroid = input(undefined, { ...(ngDevMode ? { debugName: "renderToHardwareTextureAndroid" } : /* istanbul ignore next */ {}), transform: optionalBoolean });
|
|
250
|
+
/** Android: a ripple or theme drawable painted behind the view's content. */
|
|
251
|
+
nativeBackgroundAndroid = input(/* @ts-ignore */
|
|
252
|
+
...(ngDevMode ? [undefined, { debugName: "nativeBackgroundAndroid" }] : /* istanbul ignore next */ []));
|
|
253
|
+
/** Android: a ripple or theme drawable painted over the view's content. */
|
|
254
|
+
nativeForegroundAndroid = input(/* @ts-ignore */
|
|
255
|
+
...(ngDevMode ? [undefined, { debugName: "nativeForegroundAndroid" }] : /* istanbul ignore next */ []));
|
|
256
|
+
// --- merged views of the aliases ------------------------------------------------------
|
|
257
|
+
/**
|
|
258
|
+
* What React Native's own JavaScript wrapper would have defaulted, per component.
|
|
259
|
+
*
|
|
260
|
+
* Driving the native views directly skips those wrappers, and what is lost is invisible: the
|
|
261
|
+
* app looks identical and is unusable with a screen reader, because nothing on it is an
|
|
262
|
+
* accessibility element. Each hook is overridden by the component whose wrapper sets it, and
|
|
263
|
+
* cites the file it came from.
|
|
264
|
+
*/
|
|
265
|
+
/** True for anything that behaves like a control. `Pressable.js`: `accessible !== false`. */
|
|
266
|
+
accessibleByDefault() {
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
/** Whether the platform's focus order should include this. `Pressable.js` again. */
|
|
270
|
+
focusableByDefault() {
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
/** A role the component itself implies. `Switch.js`: `accessibilityRole ?? 'switch'`. */
|
|
274
|
+
roleByDefault() {
|
|
275
|
+
return undefined;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* The component's own `disabled`, for the state a screen reader announces.
|
|
279
|
+
*
|
|
280
|
+
* React Native merges this whenever the prop was passed, even as false. An input here always
|
|
281
|
+
* has a value, so there is no telling "passed false" from "not passed"; only true is merged,
|
|
282
|
+
* and a control that is not disabled says nothing rather than saying so on every node.
|
|
283
|
+
*/
|
|
284
|
+
disabledForAccessibility() {
|
|
285
|
+
return undefined;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* The component's own `checked`, for a control whose checked state is not an accessibility
|
|
289
|
+
* input at all - `Switch`'s `checked` is a `model()`, not one of this class's inputs, so it
|
|
290
|
+
* cannot reach `ngOnChanges` here any more than `disabled` can.
|
|
291
|
+
*/
|
|
292
|
+
checkedForAccessibility() {
|
|
293
|
+
return undefined;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Write what the inputs say onto the node.
|
|
297
|
+
*
|
|
298
|
+
* This is what thirty host bindings used to do, and it is here rather than there for a reason
|
|
299
|
+
* that was measured: a host binding costs every element that carries it, on every pass, whether
|
|
300
|
+
* or not the app ever set the prop, and mounting four hundred rows spent a third of its time on
|
|
301
|
+
* the accessibility surface alone. Angular calls this once with everything that changed instead.
|
|
302
|
+
*
|
|
303
|
+
* It works with signal inputs, which is easy to assume it does not: `ngOnChanges` fires for
|
|
304
|
+
* them as it does for any other input, because `ngOnChangesSetInput` records a `SimpleChange`
|
|
305
|
+
* before writing the signal. `signal-onchanges.test.ts` is there to keep that fact honest.
|
|
306
|
+
*
|
|
307
|
+
* What remains is the allocation - a signal input builds its node whether or not anything binds
|
|
308
|
+
* to it, and there are forty-six here. Moving prop groups into directives selected by the props
|
|
309
|
+
* they carry (`[accessibilityLabel], [aria-label], ...`) is how that goes away: an element that
|
|
310
|
+
* binds none of them would allocate nothing. Measured on a 400-row mount it is worth about 40ms,
|
|
311
|
+
* at the price of an import per group.
|
|
312
|
+
*/
|
|
313
|
+
ngOnChanges(_changes) {
|
|
314
|
+
this.writeAccessibility();
|
|
315
|
+
this.writeIdentity();
|
|
316
|
+
}
|
|
317
|
+
writeAccessibility() {
|
|
318
|
+
const write = this.writer();
|
|
319
|
+
write('accessible', this.accessibleByDefault() ? (this.accessible() ?? true) : this.accessible());
|
|
320
|
+
write('accessibilityLabel', this.accessibilityLabel() ?? this.ariaLabel() ?? this.labelByDefault());
|
|
321
|
+
write('accessibilityLabelledBy', this.accessibilityLabelledBy() ?? this.ariaLabelledBy());
|
|
322
|
+
write('accessibilityHint', this.accessibilityHint());
|
|
323
|
+
write('accessibilityRole', this.accessibilityRole() ?? this.role() ?? this.roleByDefault() ?? this.contributedRole());
|
|
324
|
+
write('accessibilityState', this.mergedAccessibilityState());
|
|
325
|
+
write('accessibilityValue', this.mergedAccessibilityValue());
|
|
326
|
+
write('accessibilityActions', this.accessibilityActions());
|
|
327
|
+
this.writeVisibility();
|
|
328
|
+
}
|
|
329
|
+
/** The half of accessibility that is about what assistive technology may see, and in which language. */
|
|
330
|
+
writeVisibility() {
|
|
331
|
+
const write = (key, value) => this.engine.setProp(this.node, key, value);
|
|
332
|
+
write('accessibilityLiveRegion', this.accessibilityLiveRegion() ?? this.ariaLive());
|
|
333
|
+
write('accessibilityElementsHidden', this.accessibilityElementsHidden() ?? this.ariaHidden());
|
|
334
|
+
write('importantForAccessibility', this.importantForAccessibility() ?? (this.ariaHidden() ? 'no-hide-descendants' : undefined));
|
|
335
|
+
write('accessibilityViewIsModal', this.accessibilityViewIsModal() ?? this.ariaModal());
|
|
336
|
+
write('accessibilityIgnoresInvertColors', this.accessibilityIgnoresInvertColors());
|
|
337
|
+
write('accessibilityLanguage', this.accessibilityLanguage());
|
|
338
|
+
write('accessibilityLargeContentTitle', this.accessibilityLargeContentTitle());
|
|
339
|
+
write('accessibilityShowsLargeContentViewer', this.accessibilityShowsLargeContentViewer());
|
|
340
|
+
write('accessibilityRespondsToUserInteraction', this.accessibilityRespondsToUserInteraction());
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Writes a prop, and says nothing when it has nothing to say.
|
|
344
|
+
*
|
|
345
|
+
* The `undefined` guard is the whole of it, and it fixes a silent failure that had already been
|
|
346
|
+
* hit twice. These two methods rewrite roughly forty props from this class's own inputs on every
|
|
347
|
+
* `ngOnChanges`, so anything that reached the node by another route was overwritten the first
|
|
348
|
+
* time any input changed. Two routes get here without going through an input of this class:
|
|
349
|
+
*
|
|
350
|
+
* - A host binding on the composing component. `ui-alert` sets `[accessible]` that way and
|
|
351
|
+
* `ui-separator` sets `[accessibilityLabel]`; both are documented as working, and both were
|
|
352
|
+
* one input change away from stopping.
|
|
353
|
+
* - An element property binding. A component whose `hostDirectives` entry lists `disabled` but
|
|
354
|
+
* not `nativeID` leaves `[nativeID]` to be applied as a plain property, and then a bound
|
|
355
|
+
* `[disabled]` beside it clobbered the id on the next change. `ui-checkbox` carries a
|
|
356
|
+
* per-component workaround for that, listing the identity inputs through explicitly, and
|
|
357
|
+
* `ui-select-item` and `ui-dropdown-menu-item` do not - which is the shape of a bug that gets
|
|
358
|
+
* copied rather than fixed.
|
|
359
|
+
*
|
|
360
|
+
* An input that goes back to `undefined` clears the prop only when this is what set it, so a
|
|
361
|
+
* binding such as `[pointerEvents]="busy() ? 'none' : undefined"` still switches off, and a
|
|
362
|
+
* prop that arrived by one of those other routes is still never touched. Clearing a *class*
|
|
363
|
+
* clears the style it brought, because that goes through the cascade rather than through here.
|
|
364
|
+
*/
|
|
365
|
+
writer() {
|
|
366
|
+
return (key, value) => {
|
|
367
|
+
if (value === undefined) {
|
|
368
|
+
// Cleared only if this wrote it: `[pointerEvents]="busy() ? 'none' : undefined"` has to
|
|
369
|
+
// give the view its touches back, and a prop another route set is still left alone.
|
|
370
|
+
if (this.written?.delete(key))
|
|
371
|
+
this.engine.setProp(this.node, key, null);
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
(this.written ??= new Set()).add(key);
|
|
375
|
+
this.engine.setProp(this.node, key, value);
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
/** The props `writer` has set from an input, so it can clear one when its input is unset. */
|
|
379
|
+
written = null;
|
|
380
|
+
writeIdentity() {
|
|
381
|
+
const write = this.writer();
|
|
382
|
+
write('nativeID', this.nativeID() ?? this.id());
|
|
383
|
+
write('testID', this.testID());
|
|
384
|
+
write('hitSlop', this.hitSlop());
|
|
385
|
+
write('pointerEvents', this.pointerEvents());
|
|
386
|
+
write('collapsable', this.collapsable());
|
|
387
|
+
write('collapsableChildren', this.collapsableChildren());
|
|
388
|
+
write('removeClippedSubviews', this.removeClippedSubviews());
|
|
389
|
+
write('needsOffscreenAlphaCompositing', this.needsOffscreenAlphaCompositing());
|
|
390
|
+
write('focusable', this.focusableByDefault() ? (this.focusable() ?? true) : this.focusable());
|
|
391
|
+
write('shouldRasterizeIOS', this.shouldRasterizeIOS());
|
|
392
|
+
write('renderToHardwareTextureAndroid', this.renderToHardwareTextureAndroid());
|
|
393
|
+
write('nativeBackgroundAndroid', this.nativeBackgroundAndroid());
|
|
394
|
+
write('nativeForegroundAndroid', this.nativeForegroundAndroid());
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* The defaults a React Native wrapper would have applied, written once when the element is
|
|
398
|
+
* created. `ngOnChanges` writes them again whenever an input changes, so an app that later
|
|
399
|
+
* clears a prop falls back to the default rather than to nothing.
|
|
400
|
+
*/
|
|
401
|
+
/**
|
|
402
|
+
* The defaults a React Native wrapper would have applied, for an element nothing was bound on.
|
|
403
|
+
*
|
|
404
|
+
* In `ngOnInit` rather than the constructor because a hook like `accessibleByDefault` is
|
|
405
|
+
* answered from the subclass's own inputs - `Text` asks whether it is pressable - and those
|
|
406
|
+
* fields do not exist yet while the base constructor runs. Each is guarded on its input being
|
|
407
|
+
* unset, because `ngOnChanges` has already run by now and its answer, which merges the default
|
|
408
|
+
* in, is the better one.
|
|
409
|
+
*/
|
|
410
|
+
ngOnInit() {
|
|
411
|
+
this.initialised = true;
|
|
412
|
+
// A directive with nothing bound to it never sees `ngOnChanges`, so an element that carries a
|
|
413
|
+
// primitive and no bindings would never have its role or state written at all. Cheap to ask,
|
|
414
|
+
// and the answer is no for every element in an app that uses none.
|
|
415
|
+
if (this.contributions.length > 0)
|
|
416
|
+
this.writeAccessibility();
|
|
417
|
+
if (this.accessible() === undefined && this.accessibleByDefault()) {
|
|
418
|
+
this.engine.setProp(this.node, 'accessible', true);
|
|
419
|
+
}
|
|
420
|
+
if (this.focusable() === undefined && this.focusableByDefault()) {
|
|
421
|
+
this.engine.setProp(this.node, 'focusable', true);
|
|
422
|
+
}
|
|
423
|
+
if (this.accessibilityRole() === undefined && this.role() === undefined) {
|
|
424
|
+
const role = this.roleByDefault();
|
|
425
|
+
if (role)
|
|
426
|
+
this.engine.setProp(this.node, 'accessibilityRole', role);
|
|
427
|
+
}
|
|
428
|
+
if (this.accessibilityLabel() === undefined && this.ariaLabel() === undefined) {
|
|
429
|
+
const label = this.labelByDefault();
|
|
430
|
+
if (label !== undefined)
|
|
431
|
+
this.engine.setProp(this.node, 'accessibilityLabel', label);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/** The first role any directive on this node claims. Two claiming different ones is a bug. */
|
|
435
|
+
contributedRole() {
|
|
436
|
+
for (const contribution of this.contributions) {
|
|
437
|
+
if (contribution.role)
|
|
438
|
+
return contribution.role;
|
|
439
|
+
}
|
|
440
|
+
return undefined;
|
|
441
|
+
}
|
|
442
|
+
/** A label the component itself can supply, as `Image` does from `alt`. */
|
|
443
|
+
labelByDefault() {
|
|
444
|
+
return undefined;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* The merged state, for a component whose own inputs feed it - `disabled` on a pressable or a
|
|
448
|
+
* switch, which is a signal of theirs and so cannot reach `ngOnChanges` here.
|
|
449
|
+
*
|
|
450
|
+
* Those components bind this from their host. It returns the *same object* when nothing has
|
|
451
|
+
* changed, which is what keeps a host binding from marking the node dirty on every pass.
|
|
452
|
+
*/
|
|
453
|
+
accessibilityStateProp() {
|
|
454
|
+
return this.mergedAccessibilityState();
|
|
455
|
+
}
|
|
456
|
+
lastAccessibilityState;
|
|
457
|
+
/** Whether anything could put state on this node. For nearly every node on screen, no. */
|
|
458
|
+
hasState() {
|
|
459
|
+
return (this.accessibilityState() !== undefined ||
|
|
460
|
+
this.ariaBusy() !== undefined ||
|
|
461
|
+
this.ariaChecked() !== undefined ||
|
|
462
|
+
this.ariaDisabled() !== undefined ||
|
|
463
|
+
this.ariaExpanded() !== undefined ||
|
|
464
|
+
this.ariaSelected() !== undefined ||
|
|
465
|
+
!!this.disabledForAccessibility() ||
|
|
466
|
+
this.checkedForAccessibility() !== undefined ||
|
|
467
|
+
this.contributions.length > 0);
|
|
468
|
+
}
|
|
469
|
+
mergedAccessibilityState() {
|
|
470
|
+
// Answered without allocating in the common case: this runs from a host binding on every
|
|
471
|
+
// control, on every pass, and most of them have no state to announce.
|
|
472
|
+
if (!this.hasState())
|
|
473
|
+
return (this.lastAccessibilityState = undefined);
|
|
474
|
+
const explicit = this.accessibilityState();
|
|
475
|
+
const merged = { ...explicit };
|
|
476
|
+
const set = (key, value) => {
|
|
477
|
+
if (value !== undefined)
|
|
478
|
+
merged[key] = value;
|
|
479
|
+
};
|
|
480
|
+
set('disabled', this.disabledForAccessibility() || undefined);
|
|
481
|
+
set('checked', this.checkedForAccessibility());
|
|
482
|
+
set('busy', this.ariaBusy());
|
|
483
|
+
set('checked', this.ariaChecked());
|
|
484
|
+
set('disabled', this.ariaDisabled());
|
|
485
|
+
set('expanded', this.ariaExpanded());
|
|
486
|
+
set('selected', this.ariaSelected());
|
|
487
|
+
for (const contribution of this.contributions) {
|
|
488
|
+
const state = contribution.accessibilityState?.();
|
|
489
|
+
for (const key of Object.keys(state ?? {})) {
|
|
490
|
+
set(key, state[key]);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
const state = Object.keys(merged).length ? merged : explicit;
|
|
494
|
+
const last = this.lastAccessibilityState;
|
|
495
|
+
if (last && state && sameState(last, state))
|
|
496
|
+
return last;
|
|
497
|
+
return (this.lastAccessibilityState = state);
|
|
498
|
+
}
|
|
499
|
+
mergedAccessibilityValue() {
|
|
500
|
+
const explicit = this.accessibilityValue();
|
|
501
|
+
const merged = { ...explicit };
|
|
502
|
+
const set = (key, value) => {
|
|
503
|
+
if (value !== undefined)
|
|
504
|
+
merged[key] = value;
|
|
505
|
+
};
|
|
506
|
+
set('min', this.ariaValueMin());
|
|
507
|
+
set('max', this.ariaValueMax());
|
|
508
|
+
set('now', this.ariaValueNow());
|
|
509
|
+
set('text', this.ariaValueText());
|
|
510
|
+
return Object.keys(merged).length ? merged : explicit;
|
|
511
|
+
}
|
|
512
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ViewBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
513
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.0", type: ViewBase, isStandalone: true, inputs: { accessible: { classPropertyName: "accessible", publicName: "accessible", isSignal: true, isRequired: false, transformFunction: null }, accessibilityLabel: { classPropertyName: "accessibilityLabel", publicName: "accessibilityLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, accessibilityLabelledBy: { classPropertyName: "accessibilityLabelledBy", publicName: "accessibilityLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, accessibilityHint: { classPropertyName: "accessibilityHint", publicName: "accessibilityHint", isSignal: true, isRequired: false, transformFunction: null }, accessibilityRole: { classPropertyName: "accessibilityRole", publicName: "accessibilityRole", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, accessibilityState: { classPropertyName: "accessibilityState", publicName: "accessibilityState", isSignal: true, isRequired: false, transformFunction: null }, ariaBusy: { classPropertyName: "ariaBusy", publicName: "aria-busy", isSignal: true, isRequired: false, transformFunction: null }, ariaChecked: { classPropertyName: "ariaChecked", publicName: "aria-checked", isSignal: true, isRequired: false, transformFunction: null }, ariaDisabled: { classPropertyName: "ariaDisabled", publicName: "aria-disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaExpanded: { classPropertyName: "ariaExpanded", publicName: "aria-expanded", isSignal: true, isRequired: false, transformFunction: null }, ariaSelected: { classPropertyName: "ariaSelected", publicName: "aria-selected", isSignal: true, isRequired: false, transformFunction: null }, accessibilityValue: { classPropertyName: "accessibilityValue", publicName: "accessibilityValue", isSignal: true, isRequired: false, transformFunction: null }, ariaValueMin: { classPropertyName: "ariaValueMin", publicName: "aria-valuemin", isSignal: true, isRequired: false, transformFunction: null }, ariaValueMax: { classPropertyName: "ariaValueMax", publicName: "aria-valuemax", isSignal: true, isRequired: false, transformFunction: null }, ariaValueNow: { classPropertyName: "ariaValueNow", publicName: "aria-valuenow", isSignal: true, isRequired: false, transformFunction: null }, ariaValueText: { classPropertyName: "ariaValueText", publicName: "aria-valuetext", isSignal: true, isRequired: false, transformFunction: null }, accessibilityActions: { classPropertyName: "accessibilityActions", publicName: "accessibilityActions", isSignal: true, isRequired: false, transformFunction: null }, accessibilityLiveRegion: { classPropertyName: "accessibilityLiveRegion", publicName: "accessibilityLiveRegion", isSignal: true, isRequired: false, transformFunction: null }, ariaLive: { classPropertyName: "ariaLive", publicName: "aria-live", isSignal: true, isRequired: false, transformFunction: null }, accessibilityElementsHidden: { classPropertyName: "accessibilityElementsHidden", publicName: "accessibilityElementsHidden", isSignal: true, isRequired: false, transformFunction: null }, ariaHidden: { classPropertyName: "ariaHidden", publicName: "aria-hidden", isSignal: true, isRequired: false, transformFunction: null }, importantForAccessibility: { classPropertyName: "importantForAccessibility", publicName: "importantForAccessibility", isSignal: true, isRequired: false, transformFunction: null }, accessibilityViewIsModal: { classPropertyName: "accessibilityViewIsModal", publicName: "accessibilityViewIsModal", isSignal: true, isRequired: false, transformFunction: null }, ariaModal: { classPropertyName: "ariaModal", publicName: "aria-modal", isSignal: true, isRequired: false, transformFunction: null }, accessibilityIgnoresInvertColors: { classPropertyName: "accessibilityIgnoresInvertColors", publicName: "accessibilityIgnoresInvertColors", isSignal: true, isRequired: false, transformFunction: null }, accessibilityLanguage: { classPropertyName: "accessibilityLanguage", publicName: "accessibilityLanguage", isSignal: true, isRequired: false, transformFunction: null }, accessibilityLargeContentTitle: { classPropertyName: "accessibilityLargeContentTitle", publicName: "accessibilityLargeContentTitle", isSignal: true, isRequired: false, transformFunction: null }, accessibilityShowsLargeContentViewer: { classPropertyName: "accessibilityShowsLargeContentViewer", publicName: "accessibilityShowsLargeContentViewer", isSignal: true, isRequired: false, transformFunction: null }, accessibilityRespondsToUserInteraction: { classPropertyName: "accessibilityRespondsToUserInteraction", publicName: "accessibilityRespondsToUserInteraction", isSignal: true, isRequired: false, transformFunction: null }, nativeID: { classPropertyName: "nativeID", publicName: "nativeID", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, testID: { classPropertyName: "testID", publicName: "testID", isSignal: true, isRequired: false, transformFunction: null }, hitSlop: { classPropertyName: "hitSlop", publicName: "hitSlop", isSignal: true, isRequired: false, transformFunction: null }, pointerEvents: { classPropertyName: "pointerEvents", publicName: "pointerEvents", isSignal: true, isRequired: false, transformFunction: null }, collapsable: { classPropertyName: "collapsable", publicName: "collapsable", isSignal: true, isRequired: false, transformFunction: null }, collapsableChildren: { classPropertyName: "collapsableChildren", publicName: "collapsableChildren", isSignal: true, isRequired: false, transformFunction: null }, removeClippedSubviews: { classPropertyName: "removeClippedSubviews", publicName: "removeClippedSubviews", isSignal: true, isRequired: false, transformFunction: null }, needsOffscreenAlphaCompositing: { classPropertyName: "needsOffscreenAlphaCompositing", publicName: "needsOffscreenAlphaCompositing", isSignal: true, isRequired: false, transformFunction: null }, focusable: { classPropertyName: "focusable", publicName: "focusable", isSignal: true, isRequired: false, transformFunction: null }, shouldRasterizeIOS: { classPropertyName: "shouldRasterizeIOS", publicName: "shouldRasterizeIOS", isSignal: true, isRequired: false, transformFunction: null }, renderToHardwareTextureAndroid: { classPropertyName: "renderToHardwareTextureAndroid", publicName: "renderToHardwareTextureAndroid", isSignal: true, isRequired: false, transformFunction: null }, nativeBackgroundAndroid: { classPropertyName: "nativeBackgroundAndroid", publicName: "nativeBackgroundAndroid", isSignal: true, isRequired: false, transformFunction: null }, nativeForegroundAndroid: { classPropertyName: "nativeForegroundAndroid", publicName: "nativeForegroundAndroid", isSignal: true, isRequired: false, transformFunction: null } }, usesOnChanges: true, ngImport: i0 });
|
|
514
|
+
}
|
|
515
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ViewBase, decorators: [{
|
|
516
|
+
type: Directive
|
|
517
|
+
}], ctorParameters: () => [], propDecorators: { accessible: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessible", required: false }] }], accessibilityLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityLabel", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], accessibilityLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityLabelledBy", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], accessibilityHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityHint", required: false }] }], accessibilityRole: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityRole", required: false }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], accessibilityState: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityState", required: false }] }], ariaBusy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-busy", required: false }] }], ariaChecked: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-checked", required: false }] }], ariaDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-disabled", required: false }] }], ariaExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-expanded", required: false }] }], ariaSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-selected", required: false }] }], accessibilityValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityValue", required: false }] }], ariaValueMin: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-valuemin", required: false }] }], ariaValueMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-valuemax", required: false }] }], ariaValueNow: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-valuenow", required: false }] }], ariaValueText: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-valuetext", required: false }] }], accessibilityActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityActions", required: false }] }], accessibilityLiveRegion: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityLiveRegion", required: false }] }], ariaLive: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-live", required: false }] }], accessibilityElementsHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityElementsHidden", required: false }] }], ariaHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-hidden", required: false }] }], importantForAccessibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "importantForAccessibility", required: false }] }], accessibilityViewIsModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityViewIsModal", required: false }] }], ariaModal: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-modal", required: false }] }], accessibilityIgnoresInvertColors: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityIgnoresInvertColors", required: false }] }], accessibilityLanguage: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityLanguage", required: false }] }], accessibilityLargeContentTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityLargeContentTitle", required: false }] }], accessibilityShowsLargeContentViewer: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityShowsLargeContentViewer", required: false }] }], accessibilityRespondsToUserInteraction: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibilityRespondsToUserInteraction", required: false }] }], nativeID: [{ type: i0.Input, args: [{ isSignal: true, alias: "nativeID", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], testID: [{ type: i0.Input, args: [{ isSignal: true, alias: "testID", required: false }] }], hitSlop: [{ type: i0.Input, args: [{ isSignal: true, alias: "hitSlop", required: false }] }], pointerEvents: [{ type: i0.Input, args: [{ isSignal: true, alias: "pointerEvents", required: false }] }], collapsable: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsable", required: false }] }], collapsableChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsableChildren", required: false }] }], removeClippedSubviews: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeClippedSubviews", required: false }] }], needsOffscreenAlphaCompositing: [{ type: i0.Input, args: [{ isSignal: true, alias: "needsOffscreenAlphaCompositing", required: false }] }], focusable: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusable", required: false }] }], shouldRasterizeIOS: [{ type: i0.Input, args: [{ isSignal: true, alias: "shouldRasterizeIOS", required: false }] }], renderToHardwareTextureAndroid: [{ type: i0.Input, args: [{ isSignal: true, alias: "renderToHardwareTextureAndroid", required: false }] }], nativeBackgroundAndroid: [{ type: i0.Input, args: [{ isSignal: true, alias: "nativeBackgroundAndroid", required: false }] }], nativeForegroundAndroid: [{ type: i0.Input, args: [{ isSignal: true, alias: "nativeForegroundAndroid", required: false }] }] } });
|
|
518
|
+
/**
|
|
519
|
+
* `ViewBase` on its own, for a component whose host is a plain view.
|
|
520
|
+
*
|
|
521
|
+
* No selector: this is only ever a `hostDirectives` entry, and it is the counterpart to
|
|
522
|
+
* `PressBehavior` for the parts of a control that do not take a touch. A radio group is the case
|
|
523
|
+
* that asked for it - it announces itself as a group and holds a value, but pressing it means
|
|
524
|
+
* nothing, and without a `ViewBase` on the node there is nothing to write that role.
|
|
525
|
+
*/
|
|
526
|
+
export class ViewBehavior extends ViewBase {
|
|
527
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ViewBehavior, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
528
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.0", type: ViewBehavior, isStandalone: true, usesInheritance: true, ngImport: i0 });
|
|
529
|
+
}
|
|
530
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ViewBehavior, decorators: [{
|
|
531
|
+
type: Directive,
|
|
532
|
+
args: [{}]
|
|
533
|
+
}] });
|
|
534
|
+
//# sourceMappingURL=view-base.js.map
|