@symbiote-native/angular 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/build/angular/bootstrap.js +1 -1
- package/build/angular/bootstrap.js.map +1 -1
- package/build/angular/components/activity-indicator/index.android.js +7 -2
- package/build/angular/components/activity-indicator/index.android.js.map +1 -1
- package/build/angular/components/activity-indicator/index.ios.js +3 -1
- package/build/angular/components/activity-indicator/index.ios.js.map +1 -1
- package/build/angular/components/activity-indicator/shared.d.ts +1 -1
- package/build/angular/components/activity-indicator/shared.js +1 -1
- package/build/angular/components/activity-indicator/shared.js.map +1 -1
- package/build/angular/components/button.js +13 -5
- package/build/angular/components/button.js.map +1 -1
- package/build/angular/components/flat-list/index.d.ts +1 -1
- package/build/angular/components/flat-list/index.js +47 -14
- package/build/angular/components/flat-list/index.js.map +1 -1
- package/build/angular/components/image/index.android.js +4 -2
- package/build/angular/components/image/index.android.js.map +1 -1
- package/build/angular/components/image/index.ios.js +4 -2
- package/build/angular/components/image/index.ios.js.map +1 -1
- package/build/angular/components/image/shared.js +18 -6
- package/build/angular/components/image/shared.js.map +1 -1
- package/build/angular/components/image-background.js +22 -8
- package/build/angular/components/image-background.js.map +1 -1
- package/build/angular/components/input-accessory-view/index.js +7 -2
- package/build/angular/components/input-accessory-view/index.js.map +1 -1
- package/build/angular/components/keyboard-avoiding-view/index.d.ts +1 -0
- package/build/angular/components/keyboard-avoiding-view/index.js +39 -9
- package/build/angular/components/keyboard-avoiding-view/index.js.map +1 -1
- package/build/angular/components/modal/index.js +7 -2
- package/build/angular/components/modal/index.js.map +1 -1
- package/build/angular/components/pressable/index.d.ts +1 -1
- package/build/angular/components/pressable/index.js +6 -2
- package/build/angular/components/pressable/index.js.map +1 -1
- package/build/angular/components/refresh-control/index.js +3 -1
- package/build/angular/components/refresh-control/index.js.map +1 -1
- package/build/angular/components/safe-area-view/index.js +3 -1
- package/build/angular/components/safe-area-view/index.js.map +1 -1
- package/build/angular/components/scroll-view/index.android.js +44 -14
- package/build/angular/components/scroll-view/index.android.js.map +1 -1
- package/build/angular/components/scroll-view/index.ios.js +13 -5
- package/build/angular/components/scroll-view/index.ios.js.map +1 -1
- package/build/angular/components/scroll-view/projection.d.ts +32 -0
- package/build/angular/components/scroll-view/projection.js +212 -47
- package/build/angular/components/scroll-view/projection.js.map +1 -1
- package/build/angular/components/scroll-view/shared.js +28 -7
- package/build/angular/components/scroll-view/shared.js.map +1 -1
- package/build/angular/components/scroll-view/sticky-header.js +7 -3
- package/build/angular/components/scroll-view/sticky-header.js.map +1 -1
- package/build/angular/components/section-list/index.d.ts +6 -1
- package/build/angular/components/section-list/index.js +63 -18
- package/build/angular/components/section-list/index.js.map +1 -1
- package/build/angular/components/switch/index.android.js +17 -3
- package/build/angular/components/switch/index.android.js.map +1 -1
- package/build/angular/components/switch/index.ios.js +17 -3
- package/build/angular/components/switch/index.ios.js.map +1 -1
- package/build/angular/components/switch/shared.d.ts +1 -1
- package/build/angular/components/switch/shared.js +5 -2
- package/build/angular/components/switch/shared.js.map +1 -1
- package/build/angular/components/text-input.d.ts +1 -1
- package/build/angular/components/text-input.js +25 -5
- package/build/angular/components/text-input.js.map +1 -1
- package/build/angular/components/touchable/index.d.ts +29 -7
- package/build/angular/components/touchable/index.js +246 -69
- package/build/angular/components/touchable/index.js.map +1 -1
- package/build/angular/components/touchable-native-feedback/index.js +2 -2
- package/build/angular/components/touchable-native-feedback/index.js.map +1 -1
- package/build/angular/components/virtualized-list/directives.js +4 -0
- package/build/angular/components/virtualized-list/directives.js.map +1 -1
- package/build/angular/components/virtualized-list/index.d.ts +5 -2
- package/build/angular/components/virtualized-list/index.js +197 -60
- package/build/angular/components/virtualized-list/index.js.map +1 -1
- package/build/angular/components/virtualized-section-list/directives.js.map +1 -1
- package/build/angular/components/virtualized-section-list/index.d.ts +18 -1
- package/build/angular/components/virtualized-section-list/index.js +90 -21
- package/build/angular/components/virtualized-section-list/index.js.map +1 -1
- package/build/angular/components.d.ts +1 -1
- package/build/angular/components.js.map +1 -1
- package/build/angular/create-portal/index.js +5 -1
- package/build/angular/create-portal/index.js.map +1 -1
- package/build/angular/create-tunnel/index.js.map +1 -1
- package/build/angular/descriptor-to-angular/index.js +3 -1
- package/build/angular/descriptor-to-angular/index.js.map +1 -1
- package/build/angular/diagnostics.d.ts +33 -0
- package/build/angular/diagnostics.js +82 -0
- package/build/angular/diagnostics.js.map +1 -0
- package/build/angular/host-instance/index.js +1 -1
- package/build/angular/host-instance/index.js.map +1 -1
- package/build/angular/index.d.ts +5 -2
- package/build/angular/index.js +15 -1
- package/build/angular/index.js.map +1 -1
- package/build/angular/modules/animated/create-animated-component.js +27 -9
- package/build/angular/modules/animated/create-animated-component.js.map +1 -1
- package/build/angular/modules/app-registry/index.js.map +1 -1
- package/build/angular/modules/status-bar/index.js +1 -1
- package/build/angular/modules/status-bar/index.js.map +1 -1
- package/build/angular/primitives/index.d.ts +19 -2
- package/build/angular/primitives/index.js +39 -3
- package/build/angular/primitives/index.js.map +1 -1
- package/build/angular/primitives/shared.d.ts +9 -1
- package/build/angular/primitives/shared.js +49 -3
- package/build/angular/primitives/shared.js.map +1 -1
- package/build/angular/render/index.js +48 -5
- package/build/angular/render/index.js.map +1 -1
- package/build/angular/renderer/index.d.ts +1 -0
- package/build/angular/renderer/index.js +37 -2
- package/build/angular/renderer/index.js.map +1 -1
- package/build/angular/services/color-scheme.service.js.map +1 -1
- package/build/angular/services/window-dimensions.service.js +1 -1
- package/build/angular/services/window-dimensions.service.js.map +1 -1
- package/package.json +5 -5
- package/src/bootstrap.ts +4 -1
- package/src/components/activity-indicator/index.android.ts +7 -2
- package/src/components/activity-indicator/index.ios.ts +3 -1
- package/src/components/activity-indicator/shared.ts +32 -13
- package/src/components/button.ts +19 -6
- package/src/components/flat-list/index.ts +91 -29
- package/src/components/image/index.android.ts +9 -2
- package/src/components/image/index.ios.ts +9 -2
- package/src/components/image/shared.ts +58 -19
- package/src/components/image-background.ts +29 -10
- package/src/components/input-accessory-view/index.ts +27 -10
- package/src/components/keyboard-avoiding-view/index.ts +55 -15
- package/src/components/modal/index.ts +22 -8
- package/src/components/pressable/index.ts +51 -21
- package/src/components/refresh-control/index.ts +22 -8
- package/src/components/safe-area-view/index.ts +16 -7
- package/src/components/scroll-view/index.android.ts +31 -9
- package/src/components/scroll-view/index.ios.ts +17 -4
- package/src/components/scroll-view/projection.ts +290 -63
- package/src/components/scroll-view/shared.ts +93 -26
- package/src/components/scroll-view/sticky-header.ts +25 -8
- package/src/components/section-list/index.ts +61 -19
- package/src/components/switch/index.android.ts +14 -3
- package/src/components/switch/index.ios.ts +14 -3
- package/src/components/switch/shared.ts +15 -4
- package/src/components/text-input.ts +45 -13
- package/src/components/touchable/index.ts +296 -72
- package/src/components/touchable-native-feedback/index.ts +32 -10
- package/src/components/virtualized-list/directives.ts +19 -5
- package/src/components/virtualized-list/index.ts +274 -72
- package/src/components/virtualized-section-list/directives.ts +6 -3
- package/src/components/virtualized-section-list/index.ts +146 -34
- package/src/components.ts +4 -1
- package/src/create-portal/index.ts +8 -2
- package/src/create-tunnel/index.ts +3 -1
- package/src/descriptor-to-angular/index.ts +29 -8
- package/src/diagnostics.ts +138 -0
- package/src/host-instance/index.ts +9 -3
- package/src/index.ts +31 -2
- package/src/modules/animated/create-animated-component.ts +44 -15
- package/src/modules/app-registry/index.ts +3 -1
- package/src/modules/status-bar/index.ts +13 -4
- package/src/primitives/index.ts +46 -2
- package/src/primitives/shared.ts +70 -9
- package/src/render/index.ts +56 -6
- package/src/renderer/index.ts +76 -14
- package/src/services/color-scheme.service.ts +3 -1
- package/src/services/window-dimensions.service.ts +11 -4
package/src/components/button.ts
CHANGED
|
@@ -33,7 +33,12 @@ import {
|
|
|
33
33
|
type IAriaProps,
|
|
34
34
|
type IButtonProps as ICoreButtonProps,
|
|
35
35
|
} from '@symbiote-native/components';
|
|
36
|
-
import type {
|
|
36
|
+
import type {
|
|
37
|
+
ISymbioteEvent,
|
|
38
|
+
ITextStyle,
|
|
39
|
+
IStyleProp,
|
|
40
|
+
IViewStyle,
|
|
41
|
+
} from '@symbiote-native/engine';
|
|
37
42
|
import { anchorStyleProp, TextHost } from '../primitives';
|
|
38
43
|
import { TouchableOpacity } from './touchable';
|
|
39
44
|
|
|
@@ -81,8 +86,12 @@ export type IButtonProps = Omit<
|
|
|
81
86
|
[accessibilityElementsHidden]="accessibilityElementsHidden"
|
|
82
87
|
[accessibilityIgnoresInvertColors]="accessibilityIgnoresInvertColors"
|
|
83
88
|
[accessibilityLanguage]="accessibilityLanguage"
|
|
84
|
-
[accessibilityRespondsToUserInteraction]="
|
|
85
|
-
|
|
89
|
+
[accessibilityRespondsToUserInteraction]="
|
|
90
|
+
accessibilityRespondsToUserInteraction
|
|
91
|
+
"
|
|
92
|
+
[accessibilityShowsLargeContentViewer]="
|
|
93
|
+
accessibilityShowsLargeContentViewer
|
|
94
|
+
"
|
|
86
95
|
[accessibilityLargeContentTitle]="accessibilityLargeContentTitle"
|
|
87
96
|
(accessibilityAction)="accessibilityAction.emit($event)"
|
|
88
97
|
(accessibilityTap)="accessibilityTap.emit($event)"
|
|
@@ -149,8 +158,10 @@ export class Button implements IButtonProps, DoCheck {
|
|
|
149
158
|
@Input() accessibilityValue?: IAccessibilityProps['accessibilityValue'];
|
|
150
159
|
@Input() accessibilityActions?: IAccessibilityProps['accessibilityActions'];
|
|
151
160
|
@Input() accessibilityLabelledBy?: string | string[];
|
|
152
|
-
@Input()
|
|
153
|
-
|
|
161
|
+
@Input()
|
|
162
|
+
importantForAccessibility?: IAccessibilityProps['importantForAccessibility'];
|
|
163
|
+
@Input()
|
|
164
|
+
accessibilityLiveRegion?: IAccessibilityProps['accessibilityLiveRegion'];
|
|
154
165
|
@Input() screenReaderFocusable?: boolean;
|
|
155
166
|
@Input() accessibilityViewIsModal?: boolean;
|
|
156
167
|
@Input() accessibilityElementsHidden?: boolean;
|
|
@@ -195,7 +206,9 @@ export class Button implements IButtonProps, DoCheck {
|
|
|
195
206
|
// ngDoCheck runs during the PARENT's refresh even when this view is skipped; the signal write is
|
|
196
207
|
// what marks this view. The anchor returns the same props.style reference until a commit changes
|
|
197
208
|
// it, so Object.is makes an unchanged poll free.
|
|
198
|
-
private readonly anchorStyleValue = signal<
|
|
209
|
+
private readonly anchorStyleValue = signal<
|
|
210
|
+
IStyleProp<IViewStyle> | undefined
|
|
211
|
+
>(undefined);
|
|
199
212
|
|
|
200
213
|
ngDoCheck(): void {
|
|
201
214
|
this.anchorStyleValue.set(anchorStyleProp<IViewStyle>(this.elementRef));
|
|
@@ -80,14 +80,20 @@ import {
|
|
|
80
80
|
type IVListSeparatorContext,
|
|
81
81
|
} from '../virtualized-list';
|
|
82
82
|
import { VListOutletDirective } from '../virtualized-list/directives';
|
|
83
|
-
import {
|
|
83
|
+
import {
|
|
84
|
+
stableAnchorStyle,
|
|
85
|
+
SymbioteStyleInputDirective,
|
|
86
|
+
ViewHost,
|
|
87
|
+
} from '../../primitives';
|
|
84
88
|
|
|
85
89
|
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
86
90
|
return typeof value === 'object' && value !== null;
|
|
87
91
|
}
|
|
88
92
|
function isRow<ItemT>(value: unknown): value is IRow<ItemT> {
|
|
89
93
|
return (
|
|
90
|
-
isRecord(value) &&
|
|
94
|
+
isRecord(value) &&
|
|
95
|
+
Array.isArray(value['items']) &&
|
|
96
|
+
typeof value['startIndex'] === 'number'
|
|
91
97
|
);
|
|
92
98
|
}
|
|
93
99
|
function isSeparators(value: unknown): value is ISeparators {
|
|
@@ -129,7 +135,10 @@ export {
|
|
|
129
135
|
VListItemDirective,
|
|
130
136
|
VListSeparatorDirective,
|
|
131
137
|
} from '../virtualized-list';
|
|
132
|
-
export type {
|
|
138
|
+
export type {
|
|
139
|
+
IVListItemContext,
|
|
140
|
+
IVListSeparatorContext,
|
|
141
|
+
} from '../virtualized-list';
|
|
133
142
|
|
|
134
143
|
// FlatList's imperative handle is exactly VirtualizedList's.
|
|
135
144
|
export type IFlatListHandle = IVirtualizedListHandle;
|
|
@@ -164,7 +173,9 @@ export type IFlatListInputs<ItemT> = Omit<
|
|
|
164
173
|
@Component({
|
|
165
174
|
selector: 'FlatList',
|
|
166
175
|
standalone: true,
|
|
167
|
-
hostDirectives: [
|
|
176
|
+
hostDirectives: [
|
|
177
|
+
{ directive: SymbioteStyleInputDirective, inputs: ['style'] },
|
|
178
|
+
],
|
|
168
179
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
169
180
|
imports: [
|
|
170
181
|
VirtualizedList,
|
|
@@ -254,7 +265,9 @@ export type IFlatListInputs<ItemT> = Omit<
|
|
|
254
265
|
>
|
|
255
266
|
<ng-container
|
|
256
267
|
[vListOutlet]="separatorDir.templateRef"
|
|
257
|
-
[vListOutletContext]="
|
|
268
|
+
[vListOutletContext]="
|
|
269
|
+
rowSeparatorContext(highlighted, leadingItem, trailingItem)
|
|
270
|
+
"
|
|
258
271
|
></ng-container>
|
|
259
272
|
</ng-template>
|
|
260
273
|
}
|
|
@@ -299,7 +312,12 @@ export type IFlatListInputs<ItemT> = Omit<
|
|
|
299
312
|
[style]="resolvedStyle"
|
|
300
313
|
[contentContainerStyle]="contentContainerStyle"
|
|
301
314
|
>
|
|
302
|
-
<ng-template
|
|
315
|
+
<ng-template
|
|
316
|
+
vListItem
|
|
317
|
+
let-item
|
|
318
|
+
let-index="index"
|
|
319
|
+
let-separators="separators"
|
|
320
|
+
>
|
|
303
321
|
<ng-container
|
|
304
322
|
[vListOutlet]="itemDir?.templateRef"
|
|
305
323
|
[vListOutletContext]="{ $implicit: item, index, separators }"
|
|
@@ -329,7 +347,9 @@ export type IFlatListInputs<ItemT> = Omit<
|
|
|
329
347
|
>
|
|
330
348
|
<ng-container
|
|
331
349
|
[vListOutlet]="separatorDir.templateRef"
|
|
332
|
-
[vListOutletContext]="
|
|
350
|
+
[vListOutletContext]="
|
|
351
|
+
itemSeparatorContext(highlighted, leadingItem, trailingItem)
|
|
352
|
+
"
|
|
333
353
|
></ng-container>
|
|
334
354
|
</ng-template>
|
|
335
355
|
}
|
|
@@ -343,10 +363,16 @@ export class FlatList<ItemT = unknown>
|
|
|
343
363
|
// The list's edge/viewability/failure events as real Angular events: `(endReached)="…"`, not
|
|
344
364
|
// `[onEndReached]="…"` — re-emitted straight from the inner VirtualizedList's own @Output()s (see
|
|
345
365
|
// the template's `(endReached)="endReached.emit($event)"` style forwarding above).
|
|
346
|
-
@Output() readonly endReached = new EventEmitter<{
|
|
347
|
-
|
|
366
|
+
@Output() readonly endReached = new EventEmitter<{
|
|
367
|
+
distanceFromEnd: number;
|
|
368
|
+
}>();
|
|
369
|
+
@Output() readonly startReached = new EventEmitter<{
|
|
370
|
+
distanceFromStart: number;
|
|
371
|
+
}>();
|
|
348
372
|
@Output() readonly refresh = new EventEmitter<void>();
|
|
349
|
-
@Output() readonly viewableItemsChanged = new EventEmitter<
|
|
373
|
+
@Output() readonly viewableItemsChanged = new EventEmitter<
|
|
374
|
+
IViewableItemsChangedInfo<ItemT>
|
|
375
|
+
>();
|
|
350
376
|
@Output() readonly scrollToIndexFailed = new EventEmitter<{
|
|
351
377
|
index: number;
|
|
352
378
|
highestMeasuredFrameIndex: number;
|
|
@@ -367,8 +393,10 @@ export class FlatList<ItemT = unknown>
|
|
|
367
393
|
@Input() onStartReachedThreshold?: number;
|
|
368
394
|
@Input() refreshing?: boolean | null;
|
|
369
395
|
@Input() progressViewOffset?: number;
|
|
370
|
-
@Input()
|
|
371
|
-
|
|
396
|
+
@Input()
|
|
397
|
+
viewabilityConfig?: IVirtualizedListProps<ItemT>['viewabilityConfig'];
|
|
398
|
+
@Input()
|
|
399
|
+
viewabilityConfigCallbackPairs?: IViewabilityConfigCallbackPair<ItemT>[];
|
|
372
400
|
@Input() initialNumToRender?: number;
|
|
373
401
|
@Input() initialScrollIndex?: number;
|
|
374
402
|
@Input() maxToRenderPerBatch?: number;
|
|
@@ -380,10 +408,13 @@ export class FlatList<ItemT = unknown>
|
|
|
380
408
|
autoscrollToTopThreshold?: number;
|
|
381
409
|
};
|
|
382
410
|
@Input() onScroll?: IVirtualizedListProps<ItemT>['onScroll'];
|
|
383
|
-
@Input()
|
|
411
|
+
@Input()
|
|
412
|
+
onScrollBeginDrag?: IVirtualizedListProps<ItemT>['onScrollBeginDrag'];
|
|
384
413
|
@Input() onScrollEndDrag?: IVirtualizedListProps<ItemT>['onScrollEndDrag'];
|
|
385
|
-
@Input()
|
|
386
|
-
|
|
414
|
+
@Input()
|
|
415
|
+
onMomentumScrollBegin?: IVirtualizedListProps<ItemT>['onMomentumScrollBegin'];
|
|
416
|
+
@Input()
|
|
417
|
+
onMomentumScrollEnd?: IVirtualizedListProps<ItemT>['onMomentumScrollEnd'];
|
|
387
418
|
@Input() scrollEventThrottle?: number;
|
|
388
419
|
@Input() keyboardShouldPersistTaps?: boolean | 'always' | 'never' | 'handled';
|
|
389
420
|
@Input() keyboardDismissMode?: 'none' | 'on-drag' | 'interactive';
|
|
@@ -397,7 +428,8 @@ export class FlatList<ItemT = unknown>
|
|
|
397
428
|
@ContentChild(VListHeaderDirective) headerDir?: VListHeaderDirective;
|
|
398
429
|
@ContentChild(VListFooterDirective) footerDir?: VListFooterDirective;
|
|
399
430
|
@ContentChild(VListEmptyDirective) emptyDir?: VListEmptyDirective;
|
|
400
|
-
@ContentChild(VListSeparatorDirective)
|
|
431
|
+
@ContentChild(VListSeparatorDirective)
|
|
432
|
+
separatorDir?: VListSeparatorDirective<ItemT>;
|
|
401
433
|
|
|
402
434
|
// The composed inner list (whichever numColumns branch rendered). Its instance IS the
|
|
403
435
|
// IVirtualizedListHandle, so FlatList's handle delegates straight to it.
|
|
@@ -433,7 +465,11 @@ export class FlatList<ItemT = unknown>
|
|
|
433
465
|
// across ticks that changed nothing - a fresh object every tick defeats VirtualizedList's own
|
|
434
466
|
// dedup gate and free-runs CD (see stableAnchorStyle's doc comment).
|
|
435
467
|
ngDoCheck(): void {
|
|
436
|
-
this.resolvedStyle = stableAnchorStyle(
|
|
468
|
+
this.resolvedStyle = stableAnchorStyle(
|
|
469
|
+
this.elementRef,
|
|
470
|
+
this.style,
|
|
471
|
+
this.resolvedStyle,
|
|
472
|
+
);
|
|
437
473
|
}
|
|
438
474
|
|
|
439
475
|
ngOnChanges(changes: SimpleChanges): void {
|
|
@@ -444,11 +480,18 @@ export class FlatList<ItemT = unknown>
|
|
|
444
480
|
typeof this.columnWrapperStyle === 'string'
|
|
445
481
|
? resolveClassName(this.columnWrapperStyle)
|
|
446
482
|
: this.columnWrapperStyle;
|
|
447
|
-
this.rowStyle = flattenStyle([
|
|
483
|
+
this.rowStyle = flattenStyle([
|
|
484
|
+
{ flexDirection: 'row' },
|
|
485
|
+
resolvedColumnWrapperStyle,
|
|
486
|
+
]);
|
|
448
487
|
}
|
|
449
488
|
if (changes['data'] !== undefined || changes['numColumns'] !== undefined) {
|
|
450
|
-
this.rows = this.isMultiColumn
|
|
451
|
-
|
|
489
|
+
this.rows = this.isMultiColumn
|
|
490
|
+
? chunkIntoRows(this.data, this.columns)
|
|
491
|
+
: [];
|
|
492
|
+
dlog(
|
|
493
|
+
`Angular FlatList over ${this.data?.length ?? 0} items, ${this.columns} column(s)`,
|
|
494
|
+
);
|
|
452
495
|
}
|
|
453
496
|
if (
|
|
454
497
|
changes['viewabilityConfigCallbackPairs'] !== undefined ||
|
|
@@ -469,15 +512,24 @@ export class FlatList<ItemT = unknown>
|
|
|
469
512
|
|
|
470
513
|
// Viewability over rows expands back to per-item tokens, so the caller sees item-level
|
|
471
514
|
// visibility, not row-level (shared expandRowViewability), matching Vue.
|
|
472
|
-
rowViewableItemsChanged = (
|
|
473
|
-
|
|
515
|
+
rowViewableItemsChanged = (
|
|
516
|
+
info: IViewableItemsChangedInfo<IRow<ItemT>>,
|
|
517
|
+
): void => {
|
|
518
|
+
this.viewableItemsChanged.emit(
|
|
519
|
+
expandRowViewability(info, this.keyExtractor),
|
|
520
|
+
);
|
|
474
521
|
};
|
|
475
522
|
|
|
476
|
-
private buildRowViewabilityPairs():
|
|
523
|
+
private buildRowViewabilityPairs():
|
|
524
|
+
IViewabilityConfigCallbackPair<IRow<ItemT>>[] | undefined {
|
|
477
525
|
return this.viewabilityConfigCallbackPairs?.map(pair => ({
|
|
478
526
|
viewabilityConfig: pair.viewabilityConfig,
|
|
479
|
-
onViewableItemsChanged: (
|
|
480
|
-
|
|
527
|
+
onViewableItemsChanged: (
|
|
528
|
+
rowInfo: IViewableItemsChangedInfo<IRow<ItemT>>,
|
|
529
|
+
): void => {
|
|
530
|
+
pair.onViewableItemsChanged?.(
|
|
531
|
+
expandRowViewability(rowInfo, this.keyExtractor),
|
|
532
|
+
);
|
|
481
533
|
},
|
|
482
534
|
}));
|
|
483
535
|
}
|
|
@@ -494,7 +546,9 @@ export class FlatList<ItemT = unknown>
|
|
|
494
546
|
const handle = isSeparators(separators) ? separators : NOOP_SEPARATORS;
|
|
495
547
|
return row.items.map((item, column) => {
|
|
496
548
|
const index = row.startIndex + column;
|
|
497
|
-
const key = this.keyExtractor
|
|
549
|
+
const key = this.keyExtractor
|
|
550
|
+
? this.keyExtractor(item, index)
|
|
551
|
+
: String(index);
|
|
498
552
|
return { key, context: { $implicit: item, index, separators: handle } };
|
|
499
553
|
});
|
|
500
554
|
}
|
|
@@ -511,8 +565,12 @@ export class FlatList<ItemT = unknown>
|
|
|
511
565
|
return {
|
|
512
566
|
$implicit: isHighlighted,
|
|
513
567
|
highlighted: isHighlighted,
|
|
514
|
-
leadingItem: isRow<ItemT>(leadingRow)
|
|
515
|
-
|
|
568
|
+
leadingItem: isRow<ItemT>(leadingRow)
|
|
569
|
+
? lastItemOfRow(leadingRow)
|
|
570
|
+
: undefined,
|
|
571
|
+
trailingItem: isRow<ItemT>(trailingRow)
|
|
572
|
+
? firstItemOfRow(trailingRow)
|
|
573
|
+
: undefined,
|
|
516
574
|
};
|
|
517
575
|
}
|
|
518
576
|
|
|
@@ -545,7 +603,11 @@ export class FlatList<ItemT = unknown>
|
|
|
545
603
|
}): void {
|
|
546
604
|
this.listRef?.scrollToIndex(params);
|
|
547
605
|
}
|
|
548
|
-
scrollToItem(params: {
|
|
606
|
+
scrollToItem(params: {
|
|
607
|
+
item: unknown;
|
|
608
|
+
animated?: boolean;
|
|
609
|
+
viewPosition?: number;
|
|
610
|
+
}): void {
|
|
549
611
|
this.listRef?.scrollToItem(params);
|
|
550
612
|
}
|
|
551
613
|
scrollToEnd(params?: { animated?: boolean }): void {
|
|
@@ -13,7 +13,12 @@ import {
|
|
|
13
13
|
SymbioteHostPropsDirective,
|
|
14
14
|
SymbioteStyleInputDirective,
|
|
15
15
|
} from '../../primitives';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
IMAGE_INPUTS,
|
|
18
|
+
IMAGE_OUTPUTS,
|
|
19
|
+
ImageBase,
|
|
20
|
+
resolveImageProps,
|
|
21
|
+
} from './shared';
|
|
17
22
|
export { setImageSourceResolver } from './shared';
|
|
18
23
|
export type {
|
|
19
24
|
IImageProps,
|
|
@@ -27,7 +32,9 @@ export type {
|
|
|
27
32
|
@Component({
|
|
28
33
|
selector: 'Image',
|
|
29
34
|
standalone: true,
|
|
30
|
-
hostDirectives: [
|
|
35
|
+
hostDirectives: [
|
|
36
|
+
{ directive: SymbioteStyleInputDirective, inputs: ['style'] },
|
|
37
|
+
],
|
|
31
38
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
32
39
|
imports: [ImageHost, SymbioteHostPropsDirective],
|
|
33
40
|
inputs: IMAGE_INPUTS,
|
|
@@ -13,7 +13,12 @@ import {
|
|
|
13
13
|
SymbioteHostPropsDirective,
|
|
14
14
|
SymbioteStyleInputDirective,
|
|
15
15
|
} from '../../primitives';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
IMAGE_INPUTS,
|
|
18
|
+
IMAGE_OUTPUTS,
|
|
19
|
+
ImageBase,
|
|
20
|
+
resolveImageProps,
|
|
21
|
+
} from './shared';
|
|
17
22
|
export { setImageSourceResolver } from './shared';
|
|
18
23
|
export type {
|
|
19
24
|
IImageProps,
|
|
@@ -27,7 +32,9 @@ export type {
|
|
|
27
32
|
@Component({
|
|
28
33
|
selector: 'Image',
|
|
29
34
|
standalone: true,
|
|
30
|
-
hostDirectives: [
|
|
35
|
+
hostDirectives: [
|
|
36
|
+
{ directive: SymbioteStyleInputDirective, inputs: ['style'] },
|
|
37
|
+
],
|
|
31
38
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
32
39
|
imports: [ImageHost, SymbioteHostPropsDirective],
|
|
33
40
|
inputs: IMAGE_INPUTS,
|
|
@@ -150,15 +150,21 @@ function asNumber(value: unknown): number | undefined {
|
|
|
150
150
|
return typeof value === 'number' ? value : undefined;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
function asCrossOrigin(
|
|
154
|
-
|
|
153
|
+
function asCrossOrigin(
|
|
154
|
+
value: unknown,
|
|
155
|
+
): 'anonymous' | 'use-credentials' | undefined {
|
|
156
|
+
return value === 'anonymous' || value === 'use-credentials'
|
|
157
|
+
? value
|
|
158
|
+
: undefined;
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
function asStyle(value: unknown): IStyleProp<IViewStyle> | undefined {
|
|
158
162
|
return typeof value === 'object' && value !== null ? value : undefined;
|
|
159
163
|
}
|
|
160
164
|
|
|
161
|
-
export function resolveImageProps(
|
|
165
|
+
export function resolveImageProps(
|
|
166
|
+
input: Record<string, unknown>,
|
|
167
|
+
): Record<string, unknown> {
|
|
162
168
|
const passthrough: IImagePassthroughProps = {
|
|
163
169
|
resizeMethod: input['resizeMethod'] as IImageProps['resizeMethod'],
|
|
164
170
|
blurRadius: asNumber(input['blurRadius']),
|
|
@@ -170,12 +176,21 @@ export function resolveImageProps(input: Record<string, unknown>): Record<string
|
|
|
170
176
|
: undefined,
|
|
171
177
|
testID: asString(input['testID']),
|
|
172
178
|
nativeID: asString(input['nativeID']),
|
|
173
|
-
accessible:
|
|
179
|
+
accessible:
|
|
180
|
+
typeof input['accessible'] === 'boolean'
|
|
181
|
+
? input['accessible']
|
|
182
|
+
: undefined,
|
|
174
183
|
accessibilityLabel: asString(input['accessibilityLabel']),
|
|
175
184
|
accessibilityHint: asString(input['accessibilityHint']),
|
|
176
|
-
accessibilityRole: input[
|
|
177
|
-
|
|
178
|
-
|
|
185
|
+
accessibilityRole: input[
|
|
186
|
+
'accessibilityRole'
|
|
187
|
+
] as IAccessibilityProps['accessibilityRole'],
|
|
188
|
+
accessibilityState: input[
|
|
189
|
+
'accessibilityState'
|
|
190
|
+
] as IAccessibilityProps['accessibilityState'],
|
|
191
|
+
accessibilityValue: input[
|
|
192
|
+
'accessibilityValue'
|
|
193
|
+
] as IAccessibilityProps['accessibilityValue'],
|
|
179
194
|
accessibilityActions: input[
|
|
180
195
|
'accessibilityActions'
|
|
181
196
|
] as IAccessibilityProps['accessibilityActions'],
|
|
@@ -213,26 +228,48 @@ export function resolveImageProps(input: Record<string, unknown>): Record<string
|
|
|
213
228
|
typeof input['accessibilityShowsLargeContentViewer'] === 'boolean'
|
|
214
229
|
? input['accessibilityShowsLargeContentViewer']
|
|
215
230
|
: undefined,
|
|
216
|
-
accessibilityLargeContentTitle: asString(
|
|
231
|
+
accessibilityLargeContentTitle: asString(
|
|
232
|
+
input['accessibilityLargeContentTitle'],
|
|
233
|
+
),
|
|
217
234
|
role: input['role'] as IAriaProps['role'],
|
|
218
235
|
'aria-label': asString(input['ariaLabel'] ?? input['aria-label']),
|
|
219
|
-
'aria-labelledby': asString(
|
|
236
|
+
'aria-labelledby': asString(
|
|
237
|
+
input['ariaLabelledBy'] ?? input['aria-labelledby'],
|
|
238
|
+
),
|
|
220
239
|
'aria-live': input['ariaLive'] as IAriaProps['aria-live'],
|
|
221
|
-
'aria-hidden':
|
|
222
|
-
|
|
240
|
+
'aria-hidden':
|
|
241
|
+
typeof input['ariaHidden'] === 'boolean'
|
|
242
|
+
? input['ariaHidden']
|
|
243
|
+
: undefined,
|
|
244
|
+
'aria-busy':
|
|
245
|
+
typeof input['ariaBusy'] === 'boolean' ? input['ariaBusy'] : undefined,
|
|
223
246
|
'aria-checked': input['ariaChecked'] as IAriaProps['aria-checked'],
|
|
224
|
-
'aria-disabled':
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
247
|
+
'aria-disabled':
|
|
248
|
+
typeof input['ariaDisabled'] === 'boolean'
|
|
249
|
+
? input['ariaDisabled']
|
|
250
|
+
: undefined,
|
|
251
|
+
'aria-expanded':
|
|
252
|
+
typeof input['ariaExpanded'] === 'boolean'
|
|
253
|
+
? input['ariaExpanded']
|
|
254
|
+
: undefined,
|
|
255
|
+
'aria-selected':
|
|
256
|
+
typeof input['ariaSelected'] === 'boolean'
|
|
257
|
+
? input['ariaSelected']
|
|
258
|
+
: undefined,
|
|
259
|
+
'aria-modal':
|
|
260
|
+
typeof input['ariaModal'] === 'boolean' ? input['ariaModal'] : undefined,
|
|
228
261
|
'aria-valuemax': asNumber(input['ariaValueMax']),
|
|
229
262
|
'aria-valuemin': asNumber(input['ariaValueMin']),
|
|
230
263
|
'aria-valuenow': asNumber(input['ariaValueNow']),
|
|
231
264
|
'aria-valuetext': asString(input['ariaValueText']),
|
|
232
|
-
onAccessibilityAction: input[
|
|
265
|
+
onAccessibilityAction: input[
|
|
266
|
+
'onAccessibilityAction'
|
|
267
|
+
] as IImageProps['onLoad'],
|
|
233
268
|
onAccessibilityTap: input['onAccessibilityTap'] as IImageProps['onLoad'],
|
|
234
269
|
onMagicTap: input['onMagicTap'] as IImageProps['onLoad'],
|
|
235
|
-
onAccessibilityEscape: input[
|
|
270
|
+
onAccessibilityEscape: input[
|
|
271
|
+
'onAccessibilityEscape'
|
|
272
|
+
] as IImageProps['onLoad'],
|
|
236
273
|
onLoadStart: input['onLoadStart'] as IImageProps['onLoadStart'],
|
|
237
274
|
onLoad: input['onLoad'] as IImageProps['onLoad'],
|
|
238
275
|
onLoadEnd: input['onLoadEnd'] as IImageProps['onLoadEnd'],
|
|
@@ -442,8 +479,10 @@ export abstract class ImageBase {
|
|
|
442
479
|
accessibilityElementsHidden: this.accessibilityElementsHidden,
|
|
443
480
|
accessibilityIgnoresInvertColors: this.accessibilityIgnoresInvertColors,
|
|
444
481
|
accessibilityLanguage: this.accessibilityLanguage,
|
|
445
|
-
accessibilityRespondsToUserInteraction:
|
|
446
|
-
|
|
482
|
+
accessibilityRespondsToUserInteraction:
|
|
483
|
+
this.accessibilityRespondsToUserInteraction,
|
|
484
|
+
accessibilityShowsLargeContentViewer:
|
|
485
|
+
this.accessibilityShowsLargeContentViewer,
|
|
447
486
|
accessibilityLargeContentTitle: this.accessibilityLargeContentTitle,
|
|
448
487
|
role: this.role,
|
|
449
488
|
ariaLabel: this.ariaLabel,
|
|
@@ -37,12 +37,19 @@ import {
|
|
|
37
37
|
type IViewStyle,
|
|
38
38
|
} from '@symbiote-native/engine';
|
|
39
39
|
import { Image } from './image';
|
|
40
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
anchorHostStyle,
|
|
42
|
+
SymbioteStyleInputDirective,
|
|
43
|
+
ViewHost,
|
|
44
|
+
} from '../primitives';
|
|
41
45
|
|
|
42
46
|
// Mirrors React's IImageBackgroundProps minus children (Angular takes children via <ng-content>):
|
|
43
47
|
// every forwarding Image prop flows onto the inner image; `style` is the WRAPPER View style and
|
|
44
48
|
// `imageStyle` the inner image's.
|
|
45
|
-
export interface IAngularImageBackgroundProps extends Omit<
|
|
49
|
+
export interface IAngularImageBackgroundProps extends Omit<
|
|
50
|
+
IImageProps,
|
|
51
|
+
'style'
|
|
52
|
+
> {
|
|
46
53
|
style?: IStyleProp<IViewStyle>;
|
|
47
54
|
// A bare string resolves through the shared style registry, like `class` on the wrapper.
|
|
48
55
|
imageStyle?: IStyleProp<IViewStyle> | string;
|
|
@@ -68,7 +75,9 @@ export type IAngularImageBackgroundInputs = Omit<
|
|
|
68
75
|
@Component({
|
|
69
76
|
selector: 'ImageBackground',
|
|
70
77
|
standalone: true,
|
|
71
|
-
hostDirectives: [
|
|
78
|
+
hostDirectives: [
|
|
79
|
+
{ directive: SymbioteStyleInputDirective, inputs: ['style'] },
|
|
80
|
+
],
|
|
72
81
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
73
82
|
imports: [Image, ViewHost],
|
|
74
83
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -108,10 +117,16 @@ export type IAngularImageBackgroundInputs = Omit<
|
|
|
108
117
|
[screenReaderFocusable]="folded.screenReaderFocusable"
|
|
109
118
|
[accessibilityViewIsModal]="folded.accessibilityViewIsModal"
|
|
110
119
|
[accessibilityElementsHidden]="folded.accessibilityElementsHidden"
|
|
111
|
-
[accessibilityIgnoresInvertColors]="
|
|
120
|
+
[accessibilityIgnoresInvertColors]="
|
|
121
|
+
folded.accessibilityIgnoresInvertColors
|
|
122
|
+
"
|
|
112
123
|
[accessibilityLanguage]="folded.accessibilityLanguage"
|
|
113
|
-
[accessibilityRespondsToUserInteraction]="
|
|
114
|
-
|
|
124
|
+
[accessibilityRespondsToUserInteraction]="
|
|
125
|
+
folded.accessibilityRespondsToUserInteraction
|
|
126
|
+
"
|
|
127
|
+
[accessibilityShowsLargeContentViewer]="
|
|
128
|
+
folded.accessibilityShowsLargeContentViewer
|
|
129
|
+
"
|
|
115
130
|
[accessibilityLargeContentTitle]="folded.accessibilityLargeContentTitle"
|
|
116
131
|
(loadStart)="loadStart.emit($event)"
|
|
117
132
|
(load)="load.emit($event)"
|
|
@@ -170,8 +185,10 @@ export class ImageBackground implements IAngularImageBackgroundInputs {
|
|
|
170
185
|
@Input() accessibilityValue?: IAccessibilityProps['accessibilityValue'];
|
|
171
186
|
@Input() accessibilityActions?: IAccessibilityProps['accessibilityActions'];
|
|
172
187
|
@Input() accessibilityLabelledBy?: string | string[];
|
|
173
|
-
@Input()
|
|
174
|
-
|
|
188
|
+
@Input()
|
|
189
|
+
importantForAccessibility?: IAccessibilityProps['importantForAccessibility'];
|
|
190
|
+
@Input()
|
|
191
|
+
accessibilityLiveRegion?: IAccessibilityProps['accessibilityLiveRegion'];
|
|
175
192
|
@Input() screenReaderFocusable?: boolean;
|
|
176
193
|
@Input() accessibilityViewIsModal?: boolean;
|
|
177
194
|
@Input() accessibilityElementsHidden?: boolean;
|
|
@@ -248,8 +265,10 @@ export class ImageBackground implements IAngularImageBackgroundInputs {
|
|
|
248
265
|
accessibilityElementsHidden: this.accessibilityElementsHidden,
|
|
249
266
|
accessibilityIgnoresInvertColors: this.accessibilityIgnoresInvertColors,
|
|
250
267
|
accessibilityLanguage: this.accessibilityLanguage,
|
|
251
|
-
accessibilityRespondsToUserInteraction:
|
|
252
|
-
|
|
268
|
+
accessibilityRespondsToUserInteraction:
|
|
269
|
+
this.accessibilityRespondsToUserInteraction,
|
|
270
|
+
accessibilityShowsLargeContentViewer:
|
|
271
|
+
this.accessibilityShowsLargeContentViewer,
|
|
253
272
|
accessibilityLargeContentTitle: this.accessibilityLargeContentTitle,
|
|
254
273
|
role: this.role,
|
|
255
274
|
'aria-label': this.ariaLabel,
|
|
@@ -43,7 +43,8 @@ import {
|
|
|
43
43
|
|
|
44
44
|
// Mirrors React's IInputAccessoryViewProps minus children (Angular takes children via
|
|
45
45
|
// <ng-content>), declared per-adapter over the shared a11y base.
|
|
46
|
-
export interface IAngularInputAccessoryViewProps
|
|
46
|
+
export interface IAngularInputAccessoryViewProps
|
|
47
|
+
extends IAccessibilityProps, IAriaProps {
|
|
47
48
|
// The id a TextInput's inputAccessoryViewID points at to dock above its keyboard.
|
|
48
49
|
nativeID?: string;
|
|
49
50
|
backgroundColor?: string;
|
|
@@ -55,13 +56,18 @@ export interface IAngularInputAccessoryViewProps extends IAccessibilityProps, IA
|
|
|
55
56
|
// mirroring Pressable's IAngularPressableInputs split.
|
|
56
57
|
export type IAngularInputAccessoryViewInputs = Omit<
|
|
57
58
|
IAngularInputAccessoryViewProps,
|
|
58
|
-
|
|
59
|
+
| 'onAccessibilityAction'
|
|
60
|
+
| 'onAccessibilityTap'
|
|
61
|
+
| 'onMagicTap'
|
|
62
|
+
| 'onAccessibilityEscape'
|
|
59
63
|
>;
|
|
60
64
|
|
|
61
65
|
@Component({
|
|
62
66
|
selector: 'InputAccessoryView',
|
|
63
67
|
standalone: true,
|
|
64
|
-
hostDirectives: [
|
|
68
|
+
hostDirectives: [
|
|
69
|
+
{ directive: SymbioteStyleInputDirective, inputs: ['style'] },
|
|
70
|
+
],
|
|
65
71
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
66
72
|
imports: [InputAccessoryViewHost, SymbioteHostPropsDirective],
|
|
67
73
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -77,7 +83,9 @@ export type IAngularInputAccessoryViewInputs = Omit<
|
|
|
77
83
|
</symbiote-input-accessory-view>
|
|
78
84
|
`,
|
|
79
85
|
})
|
|
80
|
-
export class InputAccessoryView
|
|
86
|
+
export class InputAccessoryView
|
|
87
|
+
implements IAngularInputAccessoryViewInputs, OnChanges, DoCheck
|
|
88
|
+
{
|
|
81
89
|
@Input() nativeID?: string;
|
|
82
90
|
@Input() backgroundColor?: string;
|
|
83
91
|
@Input() style?: IStyleProp<IViewStyle>;
|
|
@@ -94,8 +102,10 @@ export class InputAccessoryView implements IAngularInputAccessoryViewInputs, OnC
|
|
|
94
102
|
@Input() accessibilityValue?: IAccessibilityProps['accessibilityValue'];
|
|
95
103
|
@Input() accessibilityActions?: IAccessibilityProps['accessibilityActions'];
|
|
96
104
|
@Input() accessibilityLabelledBy?: string | string[];
|
|
97
|
-
@Input()
|
|
98
|
-
|
|
105
|
+
@Input()
|
|
106
|
+
importantForAccessibility?: IAccessibilityProps['importantForAccessibility'];
|
|
107
|
+
@Input()
|
|
108
|
+
accessibilityLiveRegion?: IAccessibilityProps['accessibilityLiveRegion'];
|
|
99
109
|
@Input() screenReaderFocusable?: boolean;
|
|
100
110
|
@Input() accessibilityViewIsModal?: boolean;
|
|
101
111
|
@Input() accessibilityElementsHidden?: boolean;
|
|
@@ -177,12 +187,17 @@ export class InputAccessoryView implements IAngularInputAccessoryViewInputs, OnC
|
|
|
177
187
|
readonly hostProps = computed<Record<string, unknown>>(() => {
|
|
178
188
|
this.hostPropsRevision();
|
|
179
189
|
const descriptorProps = this.descriptor.props;
|
|
180
|
-
return {
|
|
190
|
+
return {
|
|
191
|
+
...descriptorProps,
|
|
192
|
+
style: [anchorHostStyle(this.elementRef), descriptorProps.style],
|
|
193
|
+
};
|
|
181
194
|
});
|
|
182
195
|
|
|
183
196
|
// Typed as the a11y intersection WITH the string index (the bag renderInputAccessoryView spreads
|
|
184
197
|
// into the host props), so resolveAccessibilityProps's result stays assignable to passthrough.
|
|
185
|
-
private accessibilityInputs(): IAccessibilityProps &
|
|
198
|
+
private accessibilityInputs(): IAccessibilityProps &
|
|
199
|
+
IAriaProps &
|
|
200
|
+
Record<string, unknown> {
|
|
186
201
|
return {
|
|
187
202
|
testID: this.testID,
|
|
188
203
|
accessible: this.accessible,
|
|
@@ -200,8 +215,10 @@ export class InputAccessoryView implements IAngularInputAccessoryViewInputs, OnC
|
|
|
200
215
|
accessibilityElementsHidden: this.accessibilityElementsHidden,
|
|
201
216
|
accessibilityIgnoresInvertColors: this.accessibilityIgnoresInvertColors,
|
|
202
217
|
accessibilityLanguage: this.accessibilityLanguage,
|
|
203
|
-
accessibilityRespondsToUserInteraction:
|
|
204
|
-
|
|
218
|
+
accessibilityRespondsToUserInteraction:
|
|
219
|
+
this.accessibilityRespondsToUserInteraction,
|
|
220
|
+
accessibilityShowsLargeContentViewer:
|
|
221
|
+
this.accessibilityShowsLargeContentViewer,
|
|
205
222
|
accessibilityLargeContentTitle: this.accessibilityLargeContentTitle,
|
|
206
223
|
role: this.role,
|
|
207
224
|
'aria-label': this.ariaLabel,
|