@ng-native/components 0.28.0 → 0.30.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 +2 -2
- package/android/src/main/java/dev/ngnative/components/ColorSchemeModule.kt +116 -11
- package/dist/activity-indicator.js +3 -3
- package/dist/animated-style.js +3 -3
- package/dist/animations-web.js +3 -3
- package/dist/animations.js +3 -3
- package/dist/content-container.js +3 -3
- package/dist/context-menu.js +3 -3
- package/dist/drag-and-drop.js +6 -6
- package/dist/gestures-web.js +6 -6
- package/dist/gestures.js +6 -6
- package/dist/gradient-text.d.ts +1 -1
- package/dist/gradient-text.js +4 -4
- package/dist/gradient-text.js.map +1 -1
- package/dist/image-background.js +3 -3
- package/dist/image.js +3 -3
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/input-accessory-view.js +3 -3
- package/dist/keyboard-avoiding-view.js +3 -3
- package/dist/keyboard-dock.js +15 -15
- package/dist/markdown-blocks.d.ts +2 -1
- package/dist/markdown-blocks.js +22 -18
- package/dist/markdown-blocks.js.map +1 -1
- package/dist/markdown-columns.js +3 -3
- package/dist/markdown-stream.js +8 -5
- package/dist/markdown-stream.js.map +1 -1
- package/dist/markdown.js +5 -5
- package/dist/markdown.js.map +1 -1
- package/dist/menu.d.ts +11 -5
- package/dist/menu.js +24 -44
- package/dist/menu.js.map +1 -1
- package/dist/modal.js +8 -3
- package/dist/modal.js.map +1 -1
- package/dist/native-button.d.ts +25 -3
- package/dist/native-button.js +102 -8
- package/dist/native-button.js.map +1 -1
- package/dist/native-gesture.js +3 -3
- package/dist/native-ref.js +3 -3
- package/dist/press-menu.d.ts +38 -8
- package/dist/press-menu.js +80 -19
- package/dist/press-menu.js.map +1 -1
- package/dist/pressable.js +14 -13
- package/dist/pressable.js.map +1 -1
- package/dist/reanimated-web.js +6 -6
- package/dist/reanimated.js +6 -6
- package/dist/refresh-control.js +3 -3
- package/dist/safe-area-provider.js +3 -3
- package/dist/safe-area-view.js +3 -3
- package/dist/scroll-view-props.js +3 -3
- package/dist/scroll-view.d.ts +3 -1
- package/dist/scroll-view.js +10 -5
- package/dist/scroll-view.js.map +1 -1
- package/dist/section-list.d.ts +4 -4
- package/dist/section-list.js +37 -34
- package/dist/section-list.js.map +1 -1
- package/dist/shortcut.js +3 -3
- package/dist/sidebar-item.js +3 -3
- package/dist/sidebar-section.d.ts +12 -5
- package/dist/sidebar-section.js +32 -12
- package/dist/sidebar-section.js.map +1 -1
- package/dist/sidebar.d.ts +11 -3
- package/dist/sidebar.js +18 -8
- package/dist/sidebar.js.map +1 -1
- package/dist/split-view.d.ts +23 -2
- package/dist/split-view.js +36 -9
- package/dist/split-view.js.map +1 -1
- package/dist/stand-ins/animations.js +3 -3
- package/dist/sticky-headers.d.ts +19 -0
- package/dist/sticky-headers.js +67 -10
- package/dist/sticky-headers.js.map +1 -1
- package/dist/sticky-rows.d.ts +13 -11
- package/dist/sticky-rows.js +35 -21
- package/dist/sticky-rows.js.map +1 -1
- package/dist/svg-icon.d.ts +16 -2
- package/dist/svg-icon.js +19 -3
- package/dist/svg-icon.js.map +1 -1
- package/dist/switch.js +3 -3
- package/dist/template-slot.js +3 -3
- package/dist/text-input.js +3 -3
- package/dist/text.js +3 -3
- package/dist/touchable-opacity.js +3 -3
- package/dist/tray-icon.d.ts +7 -1
- package/dist/tray-icon.js +17 -5
- package/dist/tray-icon.js.map +1 -1
- package/dist/view-base.d.ts +18 -2
- package/dist/view-base.js +42 -10
- package/dist/view-base.js.map +1 -1
- package/dist/view.js +3 -3
- package/dist/virtual-list-layout.d.ts +5 -0
- package/dist/virtual-list-layout.js.map +1 -1
- package/dist/virtual-list-num-columns.d.ts +8 -4
- package/dist/virtual-list-num-columns.js +13 -5
- package/dist/virtual-list-num-columns.js.map +1 -1
- package/dist/virtual-list-sticky-level.d.ts +0 -6
- package/dist/virtual-list-sticky-level.js +5 -29
- package/dist/virtual-list-sticky-level.js.map +1 -1
- package/dist/virtual-list.d.ts +72 -11
- package/dist/virtual-list.js +285 -74
- package/dist/virtual-list.js.map +1 -1
- package/dist/visual-effect.d.ts +37 -0
- package/dist/visual-effect.js +60 -0
- package/dist/visual-effect.js.map +1 -0
- package/dist/worklet-scroll.js +3 -3
- package/dist/worklet-style.js +3 -3
- package/dist/written-props.js +9 -0
- package/dist/written-props.js.map +1 -1
- package/ios/NgNativeButtonComponentView.mm +8 -4
- package/ios/NgNativeButtonMetrics.h +9 -2
- package/ios/NgNativeButtonMetrics.mm +33 -4
- package/ios/NgNativeButtonShadowNode.h +2 -0
- package/ios/NgNativeButtonShadowNode.mm +5 -1
- package/ios/NgNativeComponents.podspec +2 -2
- package/ios/NgNativeKeyboardFocus.h +21 -0
- package/ios/NgNativeKeyboardFocus.mm +28 -0
- package/ios/NgNativeKeyboardFocusModule.mm +203 -0
- package/ios/NgNativeMenus.mm +62 -2
- package/ios/NgNativePressMenu.h +36 -0
- package/ios/NgNativePressMenu.mm +79 -0
- package/ios/NgNativeViewBinder.h +5 -0
- package/ios/NgNativeViewBinder.mm +31 -4
- package/package.json +6 -6
package/dist/view-base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-base.js","sourceRoot":"","sources":["../src/view-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAsB,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAiB,MAAM,mBAAmB,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;;AAyEnD;;;GAGG;AACH,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC;IACn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AG,CAAC,GAAG,KAAK,CAAC;QAC/C,CAAC,CAAC;QACF,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAChC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAChC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAChC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAE,MAA6B,CAAC,CAAC,CAAC,QAAQ,CAAC;IAChF,CAAC;uGApkBmB,QAAQ;2FAAR,QAAQ;;2FAAR,QAAQ;kBAD7B,SAAS;;AAwkBV;;;;;;;GAOG;AAEH,MAAM,OAAO,YAAa,SAAQ,QAAQ;uGAA7B,YAAY;2FAAZ,YAAY;;2FAAZ,YAAY;kBADxB,SAAS;mBAAC,EAAE","sourcesContent":["/**\n * The props every native view accepts, as typed inputs forwarded to the host node.\n *\n * Each input is mirrored by a host binding of the same name, which is what carries the value to\n * the renderer: once a directive declares an input, Angular routes the binding to the directive\n * rather than the element. An unset input stays `undefined` and never reaches native, so a view\n * that mentions none of these sends none of them.\n *\n * Web-style `aria-*` names are accepted as aliases and land on the `accessibility*` props React\n * Native's own `View.js` maps them to. `id` maps to `nativeID` and `tabIndex` to `focusable` the\n * same way.\n *\n * Events are element events, typed in `events.ts`: `(layout)`, `(touchStart)`,\n * `(accessibilityAction)` and so on. They are deliberately not outputs; see that file.\n */\nimport { Directive, ElementRef, type SimpleChanges, inject, input } from '@angular/core';\nimport { hostInputNames, ownHost } from '@ng-native/device';\nimport { HostEngine, declareNativeProps, type HostNode } from '@ng-native/fabric';\nimport type { Insets } from './events.ts';\nimport { optionalBoolean, optionalNumber } from './transforms.ts';\nimport { WRITTEN_PROPS } from './written-props.ts';\n\n/**\n * The ARIA roles, which `role` takes as React Native's own `role` prop does. Native maps each to\n * what the platform has.\n */\nexport type Role =\n | 'alert'\n | 'alertdialog'\n | 'application'\n | 'article'\n | 'banner'\n | 'button'\n | 'cell'\n | 'checkbox'\n | 'columnheader'\n | 'combobox'\n | 'complementary'\n | 'contentinfo'\n | 'definition'\n | 'dialog'\n | 'directory'\n | 'document'\n | 'feed'\n | 'figure'\n | 'form'\n | 'grid'\n | 'group'\n | 'heading'\n | 'img'\n | 'link'\n | 'list'\n | 'listitem'\n | 'log'\n | 'main'\n | 'marquee'\n | 'math'\n | 'menu'\n | 'menubar'\n | 'menuitem'\n | 'meter'\n | 'navigation'\n | 'none'\n | 'note'\n | 'option'\n | 'presentation'\n | 'progressbar'\n | 'radio'\n | 'radiogroup'\n | 'region'\n | 'row'\n | 'rowgroup'\n | 'rowheader'\n | 'scrollbar'\n | 'searchbox'\n | 'separator'\n | 'slider'\n | 'spinbutton'\n | 'status'\n | 'summary'\n | 'switch'\n | 'tab'\n | 'table'\n | 'tablist'\n | 'tabpanel'\n | 'term'\n | 'timer'\n | 'toolbar'\n | 'tooltip'\n | 'tree'\n | 'treegrid'\n | 'treeitem';\n\n/**\n * The ARIA roles `accessibilityRole` has no word for. One of these is committed as `role`, which\n * native reads over `accessibilityRole`; any other is `accessibilityRole` under its web spelling.\n */\nconst ARIA_ONLY_ROLES: ReadonlySet<string> = new Set([\n 'alertdialog',\n 'application',\n 'article',\n 'banner',\n 'cell',\n 'columnheader',\n 'complementary',\n 'contentinfo',\n 'definition',\n 'dialog',\n 'directory',\n 'document',\n 'feed',\n 'figure',\n 'form',\n 'group',\n 'heading',\n 'img',\n 'listitem',\n 'log',\n 'main',\n 'marquee',\n 'math',\n 'meter',\n 'navigation',\n 'note',\n 'option',\n 'presentation',\n 'region',\n 'row',\n 'rowgroup',\n 'rowheader',\n 'searchbox',\n 'separator',\n 'slider',\n 'status',\n 'table',\n 'tabpanel',\n 'term',\n 'tooltip',\n 'tree',\n 'treegrid',\n 'treeitem',\n]);\n\n/** The roles assistive technologies understand, as `accessibilityRole` names them. */\nexport type AccessibilityRole =\n | 'none'\n | 'button'\n | 'togglebutton'\n | 'link'\n | 'search'\n | 'image'\n | 'keyboardkey'\n | 'text'\n | 'adjustable'\n | 'imagebutton'\n | 'header'\n | 'summary'\n | 'alert'\n | 'checkbox'\n | 'combobox'\n | 'menu'\n | 'menubar'\n | 'menuitem'\n | 'progressbar'\n | 'radio'\n | 'radiogroup'\n | 'scrollbar'\n | 'spinbutton'\n | 'switch'\n | 'tab'\n | 'tabbar'\n | 'tablist'\n | 'timer'\n | 'list'\n | 'toolbar'\n | 'grid'\n | 'pager'\n | 'scrollview'\n | 'horizontalscrollview'\n | 'viewgroup'\n | 'webview'\n | 'drawerlayout'\n | 'slidingdrawer'\n | 'iconmenu';\n\nexport interface AccessibilityState {\n readonly disabled?: boolean;\n readonly selected?: boolean;\n readonly checked?: boolean | 'mixed';\n readonly busy?: boolean;\n readonly expanded?: boolean;\n}\n\nexport interface AccessibilityValue {\n readonly min?: number;\n readonly max?: number;\n readonly now?: number;\n readonly text?: string;\n}\n\nexport interface AccessibilityAction {\n readonly name: string;\n readonly label?: string;\n}\n\n/** Android's `nativeBackgroundAndroid` and `nativeForegroundAndroid`. */\nexport type AndroidDrawable =\n | {\n readonly type: 'RippleAndroid';\n readonly color?: string | number;\n readonly borderless?: boolean;\n readonly rippleRadius?: number;\n }\n | { readonly type: 'ThemeAttrAndroid'; readonly attribute: string };\n\nexport type PointerEvents = 'box-none' | 'none' | 'box-only' | 'auto';\nexport type ImportantForAccessibility = 'auto' | 'yes' | 'no' | 'no-hide-descendants';\nexport type AccessibilityLiveRegion = 'none' | 'polite' | 'assertive';\n\n/** Shallow equality, so a re-merged state that says the same thing keeps its identity. */\nfunction sameState(a: AccessibilityState, b: AccessibilityState): boolean {\n const keys = Object.keys(a) as (keyof AccessibilityState)[];\n return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);\n}\n\n/** The host primitives whose props have been declared to the engine. */\nconst declared = new WeakSet<object>();\n\n/**\n * Tell the engine the props this primitive's native view takes, once per component class: its\n * inputs by their public names, and `WRITTEN_PROPS`. What its check for a misspelt prop reads.\n */\nfunction declareProps(ctor: unknown, node: HostNode): void {\n if (declared.has(ctor as object)) return;\n declared.add(ctor as object);\n const tag = (node as { tag?: string }).tag;\n const inputs = hostInputNames(ctor);\n if (!tag || !inputs.size) return;\n declareNativeProps(tag, [...inputs, ...WRITTEN_PROPS]);\n}\n\n/**\n * What a directive on the same node says this view *is*, for a screen reader.\n *\n * A host primitive knows it is a view; only the thing composed onto it knows it is a button, a\n * checkbox or an accordion trigger. Without this seam that knowledge has nowhere to go: the role\n * and the state are written here, from this class's own inputs, and a later `ngOnChanges` would\n * overwrite anything a directive had set behind its back.\n *\n * Registered on the element with `contributeAccessibility`, and several primitives may contribute\n * to one element - a trigger that is also a button.\n */\nexport interface AccessibilityContribution {\n /** The role, if this directive implies one. An explicit `role` on the element still wins. */\n readonly role?: AccessibilityRole;\n /**\n * State to merge in, read on every write so it may be a signal read.\n *\n * Spelled in full because `state` is what a primitive calls the thing it publishes for a\n * stylesheet - `data-state=\"checked\"` - and the two are not the same thing.\n */\n readonly accessibilityState?: () => AccessibilityState | undefined;\n}\n\n/** Where an element's contributions are kept: on the node, and only on a node that has some. */\nconst CONTRIBUTIONS = Symbol('angular-native.accessibilityContributions');\ntype Contributed = HostNode & { [CONTRIBUTIONS]?: AccessibilityContribution[] };\nconst NO_CONTRIBUTIONS: readonly AccessibilityContribution[] = [];\n\n/**\n * Tell the primitive on this element what it is, for a screen reader: a role, and state to merge\n * into what it announces. Call it from a directive's field initialiser or constructor, on the\n * element the primitive is on:\n *\n * private readonly contribution = contributeAccessibility({ role: 'button' });\n * private readonly contribution = contributeAccessibility(this);\n *\n * Kept on the node rather than provided through DI, because asking the injector costs every\n * element on screen a lookup to learn that nothing contributes - about a tenth of creating a list.\n * Reading a property that is not there costs nothing.\n */\nexport function contributeAccessibility<T extends AccessibilityContribution>(contribution: T): T {\n const node = inject(ElementRef).nativeElement as Contributed;\n (node[CONTRIBUTIONS] ??= []).push(contribution);\n return contribution;\n}\n\n@Directive()\nexport abstract class ViewBase {\n /** The retained node this directive sits on. */\n protected readonly node = inject(ElementRef).nativeElement as HostNode;\n\n /**\n * The engine, because the props these inputs carry are written straight onto the node. Read\n * off the node where the host put it there, which is one property read against an injector\n * lookup that walks every ancestor element, for every element on screen.\n */\n protected readonly engine: HostEngine = this.node.engine ?? inject(HostEngine);\n\n /**\n * See `contributeAccessibility`. Empty for every element nothing is composed onto. Read, never\n * cached, from `ngOnInit` onwards: by then every directive on the node has been constructed and\n * registered what it has to say.\n */\n private get contributions(): readonly AccessibilityContribution[] {\n return (this.node as Contributed)[CONTRIBUTIONS] ?? NO_CONTRIBUTIONS;\n }\n\n constructor() {\n ownHost(this.node, this.constructor);\n declareProps(this.constructor, this.node);\n this.engine.settle(this);\n }\n\n /** Whether `ngOnInit` has run, which is what writes the props every element starts with. */\n private initialised = false;\n\n /**\n * Write what the inputs say, for an element whose view has not been checked by the time the\n * host commits it. Nothing for one that has.\n *\n * The props are written from `ngOnChanges` and `ngOnInit`, which Angular runs in the parent\n * view's update pass. A component that detaches itself before its first check never gets one,\n * and on the web that pattern still works, because a listener and an attribute are there from\n * creation. So the host calls this before the commit that first mounts the element, by when its\n * static inputs are set: the press handling, the role and the `testID` are there, and the view\n * behaves as written once something calls `detectChanges()`.\n */\n settleProps(): void {\n if (this.initialised) return;\n this.ngOnChanges({});\n this.ngOnInit();\n }\n\n // --- accessibility ---------------------------------------------------------------------\n\n /** Whether the view is an accessibility element. Defaults to false for a plain view. */\n readonly accessible = input<boolean>(undefined, { transform: optionalBoolean });\n /** What a screen reader announces for the view. */\n readonly accessibilityLabel = input<string>();\n /** `aria-label`: web spelling of `accessibilityLabel`. */\n readonly ariaLabel = input<string>(undefined, { alias: 'aria-label' });\n /** Android: `nativeID`s of the views that label this one. */\n readonly accessibilityLabelledBy = input<string | readonly string[]>();\n /** `aria-labelledby`: web spelling of `accessibilityLabelledBy`. */\n readonly ariaLabelledBy = input<string | readonly string[]>(undefined, {\n alias: 'aria-labelledby',\n });\n /** What happens when the user acts on the view, when the label alone does not say. */\n readonly accessibilityHint = input<string>();\n /** The kind of control this is, for assistive technologies. */\n readonly accessibilityRole = input<AccessibilityRole>();\n /** `role`: the web spelling, which takes the ARIA roles as well as `accessibilityRole`'s. */\n readonly role = input<Role | AccessibilityRole>();\n /** Disabled, selected, checked, busy and expanded, as one object. */\n readonly accessibilityState = input<AccessibilityState>();\n /** `aria-busy`. */\n readonly ariaBusy = input<boolean>(undefined, { alias: 'aria-busy', transform: optionalBoolean });\n /** `aria-checked`. */\n readonly ariaChecked = input<boolean | 'mixed'>(undefined, {\n alias: 'aria-checked',\n // Written as an attribute it is text, and native takes a boolean or `mixed`.\n transform: (value: unknown) => (value === 'mixed' ? 'mixed' : optionalBoolean(value)),\n });\n /** `aria-disabled`. */\n readonly ariaDisabled = input<boolean>(undefined, {\n alias: 'aria-disabled',\n transform: optionalBoolean,\n });\n /** `aria-expanded`. */\n readonly ariaExpanded = input<boolean>(undefined, {\n alias: 'aria-expanded',\n transform: optionalBoolean,\n });\n /** `aria-selected`. */\n readonly ariaSelected = input<boolean>(undefined, {\n alias: 'aria-selected',\n transform: optionalBoolean,\n });\n /** The current value of an adjustable control, for a screen reader. */\n readonly accessibilityValue = input<AccessibilityValue>();\n /** `aria-valuemin`. */\n readonly ariaValueMin = input<number>(undefined, {\n alias: 'aria-valuemin',\n transform: optionalNumber,\n });\n /** `aria-valuemax`. */\n readonly ariaValueMax = input<number>(undefined, {\n alias: 'aria-valuemax',\n transform: optionalNumber,\n });\n /** `aria-valuenow`. */\n readonly ariaValueNow = input<number>(undefined, {\n alias: 'aria-valuenow',\n transform: optionalNumber,\n });\n /** `aria-valuetext`. */\n readonly ariaValueText = input<string>(undefined, { alias: 'aria-valuetext' });\n /**\n * A heading's level, 1 to 6. The desktop host reads it, and VoiceOver on macOS 26 and later\n * speaks it; iOS and Android do not read it.\n */\n readonly accessibilityLevel = input<number>(undefined, { transform: optionalNumber });\n /** `aria-level`. */\n readonly ariaLevel = input<number>(undefined, { alias: 'aria-level', transform: optionalNumber });\n /** The `nativeID`s of the views that describe this one, read after its label. */\n readonly accessibilityDescribedBy = input<string | readonly string[]>();\n /** `aria-describedby`: a list separated by commas, or an array. */\n readonly ariaDescribedBy = input<string | readonly string[]>(undefined, {\n alias: 'aria-describedby',\n });\n /** Whether a field must be filled in before what it belongs to can be sent. */\n readonly accessibilityRequired = input<boolean>(undefined, { transform: optionalBoolean });\n /** `aria-required`. */\n readonly ariaRequired = input<boolean>(undefined, {\n alias: 'aria-required',\n transform: optionalBoolean,\n });\n /** Whether a field's value is not one it accepts. */\n readonly accessibilityInvalid = input<boolean>(undefined, { transform: optionalBoolean });\n /** `aria-invalid`. */\n readonly ariaInvalid = input<boolean>(undefined, {\n alias: 'aria-invalid',\n transform: optionalBoolean,\n });\n /** An item's place in its set, from 1, where not every item of the set is in the tree. */\n readonly accessibilityPosInSet = input<number>(undefined, { transform: optionalNumber });\n /** `aria-posinset`. */\n readonly ariaPosInSet = input<number>(undefined, {\n alias: 'aria-posinset',\n transform: optionalNumber,\n });\n /** How many items the set has, with `accessibilityPosInSet`. */\n readonly accessibilitySetSize = input<number>(undefined, { transform: optionalNumber });\n /** `aria-setsize`. */\n readonly ariaSetSize = input<number>(undefined, {\n alias: 'aria-setsize',\n transform: optionalNumber,\n });\n /** How many rows a grid or table has, where not every row is in the tree. */\n readonly accessibilityRowCount = input<number>(undefined, { transform: optionalNumber });\n /** `aria-rowcount`. */\n readonly ariaRowCount = input<number>(undefined, {\n alias: 'aria-rowcount',\n transform: optionalNumber,\n });\n /** How many columns a grid or table has, where not every column is in the tree. */\n readonly accessibilityColumnCount = input<number>(undefined, { transform: optionalNumber });\n /** `aria-colcount`. */\n readonly ariaColumnCount = input<number>(undefined, {\n alias: 'aria-colcount',\n transform: optionalNumber,\n });\n /** Custom actions a screen reader can invoke; each arrives as `(accessibilityAction)`. */\n readonly accessibilityActions = input<readonly AccessibilityAction[]>();\n /**\n * Android: announce changes to this view's content without focus moving to it. iOS has no live\n * regions, as in React Native: call `announce()` on `Accessibility` from `@ng-native/device`.\n */\n readonly accessibilityLiveRegion = input<AccessibilityLiveRegion>();\n /** `aria-live`. Android only: see `accessibilityLiveRegion`. */\n readonly ariaLive = input<AccessibilityLiveRegion>(undefined, { alias: 'aria-live' });\n /** iOS: hide this view and its children from assistive technologies. */\n readonly accessibilityElementsHidden = input<boolean>(undefined, { transform: optionalBoolean });\n /** `aria-hidden`: `accessibilityElementsHidden` on iOS, `no-hide-descendants` on Android. */\n readonly ariaHidden = input<boolean>(undefined, {\n alias: 'aria-hidden',\n transform: optionalBoolean,\n });\n /** Android: whether this view is exposed to accessibility, and whether its children are. */\n readonly importantForAccessibility = input<ImportantForAccessibility>();\n /** iOS: VoiceOver ignores every sibling while this view is shown, as a modal expects. */\n readonly accessibilityViewIsModal = input<boolean>(undefined, { transform: optionalBoolean });\n /** `aria-modal`. */\n readonly ariaModal = input<boolean>(undefined, {\n alias: 'aria-modal',\n transform: optionalBoolean,\n });\n /** iOS: keep the view's colours when the Invert Colors setting is on; images want this. */\n readonly accessibilityIgnoresInvertColors = input<boolean>(undefined, {\n transform: optionalBoolean,\n });\n /** iOS: the language VoiceOver reads the label in, as a BCP 47 tag. */\n readonly accessibilityLanguage = input<string>();\n /** iOS: the title shown by the Large Content Viewer on a long press with large text on. */\n readonly accessibilityLargeContentTitle = input<string>();\n /** iOS: opt this view into the Large Content Viewer. */\n readonly accessibilityShowsLargeContentViewer = input<boolean>(undefined, {\n transform: optionalBoolean,\n });\n /** iOS: tell VoiceOver the view responds to a tap even without a role that implies it. */\n readonly accessibilityRespondsToUserInteraction = input<boolean>(undefined, {\n transform: optionalBoolean,\n });\n\n // --- identity and hit testing ----------------------------------------------------------\n\n /** A handle native code can find the view by; also what `:id` selectors match. */\n readonly nativeID = input<string>();\n /** `id`: the web spelling of `nativeID`. */\n readonly id = input<string>();\n /** A handle for end-to-end test tooling. */\n readonly testID = input<string>();\n /** Extend the touchable area beyond the view's bounds, without moving anything visible. */\n readonly hitSlop = input<Insets | number>();\n /** Whether this view, its children, or neither can be the target of a touch. */\n readonly pointerEvents = input<PointerEvents>();\n /** Set to false to keep a layout-only view alive; Fabric otherwise removes it from the tree. */\n readonly collapsable = input<boolean>(undefined, { transform: optionalBoolean });\n /** Set to false to keep this view's layout-only children from being flattened. */\n readonly collapsableChildren = input<boolean>(undefined, { transform: optionalBoolean });\n /** Detach children that are outside the visible bounds. A scroll view optimisation. */\n readonly removeClippedSubviews = input<boolean>(undefined, { transform: optionalBoolean });\n /** Composite the view offscreen so a translucent view with children blends correctly. */\n readonly needsOffscreenAlphaCompositing = input<boolean>(undefined, {\n transform: optionalBoolean,\n });\n /** Android: whether the view takes keyboard or TV focus. RN's `tabIndex` is this. */\n readonly focusable = input<boolean>(undefined, { transform: optionalBoolean });\n /** iOS: render the view to a bitmap once and reuse it; for a static view that animates. */\n readonly shouldRasterizeIOS = input<boolean>(undefined, { transform: optionalBoolean });\n /** Android: cache the view in a hardware texture; the same trade as `shouldRasterizeIOS`. */\n readonly renderToHardwareTextureAndroid = input<boolean>(undefined, {\n transform: optionalBoolean,\n });\n /** Android: a ripple or theme drawable painted behind the view's content. */\n readonly nativeBackgroundAndroid = input<AndroidDrawable>();\n /** Android: a ripple or theme drawable painted over the view's content. */\n readonly nativeForegroundAndroid = input<AndroidDrawable>();\n\n // --- merged views of the aliases ------------------------------------------------------\n\n /**\n * What React Native's own JavaScript wrapper would have defaulted, per component.\n *\n * Driving the native views directly skips those wrappers, and what is lost is invisible: the\n * app looks identical and is unusable with a screen reader, because nothing on it is an\n * accessibility element. Each hook is overridden by the component whose wrapper sets it, and\n * cites the file it came from.\n */\n\n /** True for anything that behaves like a control. `Pressable.js`: `accessible !== false`. */\n protected accessibleByDefault(): boolean {\n return false;\n }\n\n /** Whether the platform's focus order should include this. `Pressable.js` again. */\n protected focusableByDefault(): boolean {\n return false;\n }\n\n /**\n * A role the component itself implies. `Switch.js`: `accessibilityRole ?? 'switch'`. Below an\n * explicit role and a contributed one, which is what a wrapper passing `accessibilityRole` is.\n */\n protected roleByDefault(): AccessibilityRole | undefined {\n return undefined;\n }\n\n /**\n * The component's own `disabled`, for the state a screen reader announces: undefined when not\n * passed.\n *\n * It wins over `aria-disabled` and `accessibilityState.disabled`, as it does in `Pressable.js`,\n * `TouchableOpacity.js`, `Switch.js` and `Text.js`. True is always merged; false only overrides\n * something else that says disabled, so a control that is not disabled says nothing rather than\n * saying so on every node.\n */\n protected disabledForAccessibility(): boolean | undefined {\n return undefined;\n }\n\n /**\n * The component's own `checked`, for a control whose checked state is not an accessibility\n * input at all - `Switch`'s `checked` is a `model()`, not one of this class's inputs, so it\n * cannot reach `ngOnChanges` here any more than `disabled` can.\n *\n * It wins over `aria-checked` and `accessibilityState.checked`, as `disabledForAccessibility`\n * does over theirs: what a screen reader announces is the position the control shows.\n */\n protected checkedForAccessibility(): boolean | 'mixed' | undefined {\n return undefined;\n }\n\n /**\n * Write what the inputs say onto the node.\n *\n * This is what thirty host bindings used to do, and it is here rather than there for a reason\n * that was measured: a host binding costs every element that carries it, on every pass, whether\n * or not the app ever set the prop, and mounting four hundred rows spent a third of its time on\n * the accessibility surface alone. Angular calls this once with everything that changed instead.\n *\n * It works with signal inputs, which is easy to assume it does not: `ngOnChanges` fires for\n * them as it does for any other input, because `ngOnChangesSetInput` records a `SimpleChange`\n * before writing the signal. `signal-onchanges.test.ts` is there to keep that fact honest.\n *\n * What remains is the allocation - a signal input builds its node whether or not anything binds\n * to it, and there are forty-six here. Moving prop groups into directives selected by the props\n * they carry (`[accessibilityLabel], [aria-label], ...`) is how that goes away: an element that\n * binds none of them would allocate nothing. Measured on a 400-row mount it is worth about 40ms,\n * at the price of an import per group.\n */\n ngOnChanges(_changes?: SimpleChanges): void {\n this.writeAccessibility();\n this.writeIdentity();\n }\n\n private writeAccessibility(): void {\n const write = this.writer();\n write(\n 'accessible',\n this.accessibleByDefault() ? (this.accessible() ?? true) : this.accessible(),\n );\n write(\n 'accessibilityLabel',\n this.accessibilityLabel() ?? this.ariaLabel() ?? this.labelByDefault(),\n );\n write('accessibilityLabelledBy', this.accessibilityLabelledBy() ?? this.ariaLabelledBy());\n write('accessibilityHint', this.accessibilityHint());\n const role = this.role();\n const aria = role !== undefined && ARIA_ONLY_ROLES.has(role);\n write('role', aria ? role : undefined);\n // An ARIA role is the element's role whatever the component implies, as any explicit one is.\n write(\n 'accessibilityRole',\n this.accessibilityRole() ?? (aria ? undefined : (role ?? this.impliedRole())),\n );\n write('accessibilityState', this.mergedAccessibilityState());\n write('accessibilityValue', this.mergedAccessibilityValue());\n write('accessibilityActions', this.accessibilityActions());\n this.writeDesktopAccessibility(write);\n this.writeVisibility();\n this.publishAriaState(write);\n }\n\n /**\n * The inputs the desktop host reads, each from its native spelling, or else the web one: a\n * heading's level, what describes the view, a field's required and invalid states, an item's\n * place in its set, and a grid's counts.\n */\n private writeDesktopAccessibility(write: (key: string, value: unknown) => void): void {\n const describedBy = this.accessibilityDescribedBy() ?? this.ariaDescribedBy();\n write('accessibilityLevel', this.accessibilityLevel() ?? this.ariaLevel());\n write(\n 'accessibilityDescribedBy',\n typeof describedBy === 'string' ? describedBy.split(/\\s*,\\s*/) : describedBy,\n );\n write('accessibilityRequired', this.accessibilityRequired() ?? this.ariaRequired());\n write('accessibilityInvalid', this.accessibilityInvalid() ?? this.ariaInvalid());\n write('accessibilityPosInSet', this.accessibilityPosInSet() ?? this.ariaPosInSet());\n write('accessibilitySetSize', this.accessibilitySetSize() ?? this.ariaSetSize());\n write('accessibilityRowCount', this.accessibilityRowCount() ?? this.ariaRowCount());\n write('accessibilityColumnCount', this.accessibilityColumnCount() ?? this.ariaColumnCount());\n }\n\n /**\n * The aria states Tailwind has variants for, put back on the node as the attributes they came\n * in as. The inputs consume them, so `[aria-disabled=\"true\"]` and every `aria-*:` utility had\n * nothing to match. Hyphenated, so the engine keeps them for selectors and never sends them.\n */\n private publishAriaState(write: (key: string, value: unknown) => void): void {\n const attribute = (value: unknown) => (value === undefined ? undefined : String(value));\n write('aria-busy', attribute(this.ariaBusy()));\n write('aria-checked', attribute(this.ariaChecked()));\n write('aria-disabled', attribute(this.ariaDisabled()));\n write('aria-expanded', attribute(this.ariaExpanded()));\n write('aria-hidden', attribute(this.ariaHidden()));\n write('aria-selected', attribute(this.ariaSelected()));\n }\n\n /** The half of accessibility that is about what assistive technology may see, and in which language. */\n private writeVisibility(): void {\n const write = (key: string, value: unknown) => this.engine.setProp(this.node, key, value);\n write('accessibilityLiveRegion', this.accessibilityLiveRegion() ?? this.ariaLive());\n write('accessibilityElementsHidden', this.accessibilityElementsHidden() ?? this.ariaHidden());\n write(\n 'importantForAccessibility',\n this.importantForAccessibility() ?? (this.ariaHidden() ? 'no-hide-descendants' : undefined),\n );\n write('accessibilityViewIsModal', this.accessibilityViewIsModal() ?? this.ariaModal());\n write('accessibilityIgnoresInvertColors', this.accessibilityIgnoresInvertColors());\n write('accessibilityLanguage', this.accessibilityLanguage());\n write('accessibilityLargeContentTitle', this.accessibilityLargeContentTitle());\n write('accessibilityShowsLargeContentViewer', this.accessibilityShowsLargeContentViewer());\n write('accessibilityRespondsToUserInteraction', this.accessibilityRespondsToUserInteraction());\n }\n\n /**\n * Writes a prop, and says nothing when it has nothing to say.\n *\n * The `undefined` guard is the whole of it. These two methods rewrite roughly forty props from\n * this class's own inputs on every `ngOnChanges`, so without the guard, anything that reached\n * the node by another route would be overwritten the first time any input changed. Two routes\n * reach the node without going through an input of this class:\n *\n * - A host binding on a component that composes this class in, such as `[accessible]` or\n * `[accessibilityLabel]` set from the composing component's own `host` object.\n * - An element property binding beside a `hostDirectives` entry. A component whose\n * `hostDirectives` entry lists one input (say `disabled`) but not another (say `nativeID`)\n * leaves `[nativeID]` to be applied as a plain property; a bound `[disabled]` beside it would\n * then clobber the id on the next change unless the identity inputs are also listed through\n * explicitly.\n *\n * An input that goes back to `undefined` clears the prop only when this is what set it, so a\n * binding such as `[pointerEvents]=\"busy() ? 'none' : undefined\"` still switches off, and a\n * prop that arrived by one of those other routes is still never touched. Clearing a *class*\n * clears the style it brought, because that goes through the cascade rather than through here.\n */\n private writer(): (key: string, value: unknown) => void {\n return (key, value) => {\n if (value === undefined) {\n // Cleared only if this wrote it: `[pointerEvents]=\"busy() ? 'none' : undefined\"` has to\n // give the view its touches back, and a prop another route set is still left alone.\n if (this.written?.delete(key)) this.engine.setProp(this.node, key, null);\n return;\n }\n (this.written ??= new Set()).add(key);\n this.engine.setProp(this.node, key, value);\n };\n }\n\n /** The props `writer` has set from an input, so it can clear one when its input is unset. */\n private written: Set<string> | null = null;\n\n private writeIdentity(): void {\n const write = this.writer();\n write('nativeID', this.nativeID() ?? this.id());\n write('testID', this.testID());\n write('hitSlop', this.hitSlop());\n write('pointerEvents', this.pointerEvents());\n write('collapsable', this.collapsable());\n write('collapsableChildren', this.collapsableChildren());\n write('removeClippedSubviews', this.removeClippedSubviews());\n write('needsOffscreenAlphaCompositing', this.needsOffscreenAlphaCompositing());\n write('focusable', this.focusableByDefault() ? (this.focusable() ?? true) : this.focusable());\n write('shouldRasterizeIOS', this.shouldRasterizeIOS());\n write('renderToHardwareTextureAndroid', this.renderToHardwareTextureAndroid());\n write('nativeBackgroundAndroid', this.nativeBackgroundAndroid());\n write('nativeForegroundAndroid', this.nativeForegroundAndroid());\n }\n\n /**\n * The defaults a React Native wrapper would have applied, written once when the element is\n * created. `ngOnChanges` writes them again whenever an input changes, so an app that later\n * clears a prop falls back to the default rather than to nothing.\n */\n /**\n * The defaults a React Native wrapper would have applied, for an element nothing was bound on.\n *\n * In `ngOnInit` rather than the constructor because a hook like `accessibleByDefault` is\n * answered from the subclass's own inputs - `Text` asks whether it is pressable - and those\n * fields do not exist yet while the base constructor runs. Each is guarded on its input being\n * unset, because `ngOnChanges` has already run by now and its answer, which merges the default\n * in, is the better one.\n */\n ngOnInit(): void {\n this.initialised = true;\n // A directive with nothing bound to it never sees `ngOnChanges`, so an element that carries a\n // primitive and no bindings would never have its role or state written at all. Cheap to ask,\n // and the answer is no for every element in an app that uses none.\n if (this.contributions.length > 0) this.writeAccessibility();\n if (this.accessible() === undefined && this.accessibleByDefault()) {\n this.engine.setProp(this.node, 'accessible', true);\n }\n if (this.focusable() === undefined && this.focusableByDefault()) {\n this.engine.setProp(this.node, 'focusable', true);\n }\n if (this.accessibilityRole() === undefined && this.role() === undefined) {\n const role = this.impliedRole();\n if (role) this.engine.setProp(this.node, 'accessibilityRole', role);\n }\n if (this.accessibilityLabel() === undefined && this.ariaLabel() === undefined) {\n const label = this.labelByDefault();\n if (label !== undefined) this.engine.setProp(this.node, 'accessibilityLabel', label);\n }\n }\n\n /** The role when none is set: one a directive contributes, or else the component's own. */\n private impliedRole(): AccessibilityRole | undefined {\n return this.contributedRole() ?? this.roleByDefault();\n }\n\n /** The first role any directive on this node claims. Two claiming different ones is a bug. */\n private contributedRole(): AccessibilityRole | undefined {\n for (const contribution of this.contributions) {\n if (contribution.role) return contribution.role;\n }\n return undefined;\n }\n\n /** A label the component itself can supply, as `Image` does from `alt`. */\n protected labelByDefault(): string | undefined {\n return undefined;\n }\n\n /**\n * The merged state, for a component whose own inputs feed it - `disabled` on a pressable or a\n * switch, which is a signal of theirs and so cannot reach `ngOnChanges` here.\n *\n * Those components bind this from their host. It returns the *same object* when nothing has\n * changed, which is what keeps a host binding from marking the node dirty on every pass.\n */\n protected accessibilityStateProp(): AccessibilityState | undefined {\n return this.mergedAccessibilityState();\n }\n\n private lastAccessibilityState: AccessibilityState | undefined;\n\n /** Whether anything could put state on this node. For nearly every node on screen, no. */\n private hasState(): boolean {\n return (\n this.accessibilityState() !== undefined ||\n this.ariaBusy() !== undefined ||\n this.ariaChecked() !== undefined ||\n this.ariaDisabled() !== undefined ||\n this.ariaExpanded() !== undefined ||\n this.ariaSelected() !== undefined ||\n !!this.disabledForAccessibility() ||\n this.checkedForAccessibility() !== undefined ||\n this.contributions.length > 0\n );\n }\n\n private mergedAccessibilityState(): AccessibilityState | undefined {\n // Answered without allocating in the common case: this runs from a host binding on every\n // control, on every pass, and most of them have no state to announce.\n if (!this.hasState()) return (this.lastAccessibilityState = undefined);\n const explicit = this.accessibilityState();\n const merged: Record<string, unknown> = { ...explicit };\n const set = (key: keyof AccessibilityState, value: unknown) => {\n if (value !== undefined) merged[key] = value;\n };\n set('busy', this.ariaBusy());\n set('checked', this.ariaChecked());\n set('checked', this.checkedForAccessibility());\n set('disabled', this.ariaDisabled());\n set('disabled', this.disabledOver(merged['disabled']));\n set('expanded', this.ariaExpanded());\n set('selected', this.ariaSelected());\n for (const contribution of this.contributions) {\n const state = contribution.accessibilityState?.();\n for (const key of Object.keys(state ?? {})) {\n set(key as keyof AccessibilityState, (state as Record<string, unknown>)[key]);\n }\n }\n const state = Object.keys(merged).length ? (merged as AccessibilityState) : explicit;\n const last = this.lastAccessibilityState;\n if (last && state && sameState(last, state)) return last;\n return (this.lastAccessibilityState = state);\n }\n\n /** `disabled` over what else said: true always, false only when something said otherwise. */\n private disabledOver(other: unknown): boolean | undefined {\n const own = this.disabledForAccessibility();\n return own || (own === false && other !== undefined) ? own : undefined;\n }\n\n private mergedAccessibilityValue(): AccessibilityValue | undefined {\n const explicit = this.accessibilityValue();\n const merged: Record<string, unknown> = { ...explicit };\n const set = (key: keyof AccessibilityValue, value: unknown) => {\n if (value !== undefined) merged[key] = value;\n };\n set('min', this.ariaValueMin());\n set('max', this.ariaValueMax());\n set('now', this.ariaValueNow());\n set('text', this.ariaValueText());\n return Object.keys(merged).length ? (merged as AccessibilityValue) : explicit;\n }\n}\n\n/**\n * `ViewBase` on its own, for a component whose host is a plain view.\n *\n * No selector: this is only ever a `hostDirectives` entry, and it is the counterpart to\n * `PressBehavior` for the parts of a control that do not take a touch. A radio group is the case\n * that asked for it - it announces itself as a group and holds a value, but pressing it means\n * nothing, and without a `ViewBase` on the node there is nothing to write that role.\n */\n@Directive({})\nexport class ViewBehavior extends ViewBase {}\n"]}
|
|
1
|
+
{"version":3,"file":"view-base.js","sourceRoot":"","sources":["../src/view-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAsB,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAiB,MAAM,mBAAmB,CAAC;AAElG,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;;AAyEnD;;;GAGG;AACH,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC;IACnD,aAAa;IACb,aAAa;IACb,SAAS;IACT,QAAQ;IACR,MAAM;IACN,cAAc;IACd,eAAe;IACf,aAAa;IACb,YAAY;IACZ,QAAQ;IACR,WAAW;IACX,UAAU;IACV,MAAM;IACN,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,KAAK;IACL,UAAU;IACV,KAAK;IACL,MAAM;IACN,SAAS;IACT,MAAM;IACN,OAAO;IACP,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,cAAc;IACd,QAAQ;IACR,KAAK;IACL,UAAU;IACV,WAAW;IACX,WAAW;IACX,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,UAAU;IACV,MAAM;IACN,SAAS;IACT,MAAM;IACN,UAAU;IACV,UAAU;CACX,CAAC,CAAC;AA8EH,0FAA0F;AAC1F,SAAS,SAAS,CAAC,CAAqB,EAAE,CAAqB;IAC7D,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAiC,CAAC;IAC5D,OAAO,IAAI,CAAC,MAAM,KAAK,MAAM,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AAI,CAAC,GAAG,KAAK,KAAK,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IACzE,CAAC;IAEO,wBAAwB;QAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC3C,MAAM,MAAM,GAA4B,EAAE,GAAG,QAAQ,EAAE,CAAC;QACxD,MAAM,GAAG,GAAG,CAAC,GAA6B,EAAE,KAAc,EAAE,EAAE;YAC5D,IAAI,KAAK,KAAK,SAAS;gBAAE,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC/C,CAAC,CAAC;QACF,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAChC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAChC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAChC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAE,MAA6B,CAAC,CAAC,CAAC,QAAQ,CAAC;IAChF,CAAC;uGAnmBmB,QAAQ;2FAAR,QAAQ;;2FAAR,QAAQ;kBAD7B,SAAS;;AAumBV;;;;;;;GAOG;AAEH,MAAM,OAAO,YAAa,SAAQ,QAAQ;uGAA7B,YAAY;2FAAZ,YAAY;;2FAAZ,YAAY;kBADxB,SAAS;mBAAC,EAAE","sourcesContent":["/**\n * The props every native view accepts, as typed inputs forwarded to the host node.\n *\n * Each input is mirrored by a host binding of the same name, which is what carries the value to\n * the renderer: once a directive declares an input, Angular routes the binding to the directive\n * rather than the element. An unset input stays `undefined` and never reaches native, so a view\n * that mentions none of these sends none of them.\n *\n * Web-style `aria-*` names are accepted as aliases and land on the `accessibility*` props React\n * Native's own `View.js` maps them to. `id` maps to `nativeID` and `tabIndex` to `focusable` the\n * same way.\n *\n * Events are element events, typed in `events.ts`: `(layout)`, `(touchStart)`,\n * `(accessibilityAction)` and so on. They are deliberately not outputs; see that file.\n */\nimport { Directive, ElementRef, type SimpleChanges, inject, input } from '@angular/core';\nimport { KEYBOARD_FOCUS, hostInputNames, ownHost } from '@ng-native/device';\nimport { HostEngine, declareNativeProps, nativePlatform, type HostNode } from '@ng-native/fabric';\nimport type { Insets } from './events.ts';\nimport { optionalBoolean, optionalNumber } from './transforms.ts';\nimport { WRITTEN_PROPS } from './written-props.ts';\n\n/**\n * The ARIA roles, which `role` takes as React Native's own `role` prop does. Native maps each to\n * what the platform has.\n */\nexport type Role =\n | 'alert'\n | 'alertdialog'\n | 'application'\n | 'article'\n | 'banner'\n | 'button'\n | 'cell'\n | 'checkbox'\n | 'columnheader'\n | 'combobox'\n | 'complementary'\n | 'contentinfo'\n | 'definition'\n | 'dialog'\n | 'directory'\n | 'document'\n | 'feed'\n | 'figure'\n | 'form'\n | 'grid'\n | 'group'\n | 'heading'\n | 'img'\n | 'link'\n | 'list'\n | 'listitem'\n | 'log'\n | 'main'\n | 'marquee'\n | 'math'\n | 'menu'\n | 'menubar'\n | 'menuitem'\n | 'meter'\n | 'navigation'\n | 'none'\n | 'note'\n | 'option'\n | 'presentation'\n | 'progressbar'\n | 'radio'\n | 'radiogroup'\n | 'region'\n | 'row'\n | 'rowgroup'\n | 'rowheader'\n | 'scrollbar'\n | 'searchbox'\n | 'separator'\n | 'slider'\n | 'spinbutton'\n | 'status'\n | 'summary'\n | 'switch'\n | 'tab'\n | 'table'\n | 'tablist'\n | 'tabpanel'\n | 'term'\n | 'timer'\n | 'toolbar'\n | 'tooltip'\n | 'tree'\n | 'treegrid'\n | 'treeitem';\n\n/**\n * The ARIA roles `accessibilityRole` has no word for. One of these is committed as `role`, which\n * native reads over `accessibilityRole`; any other is `accessibilityRole` under its web spelling.\n */\nconst ARIA_ONLY_ROLES: ReadonlySet<string> = new Set([\n 'alertdialog',\n 'application',\n 'article',\n 'banner',\n 'cell',\n 'columnheader',\n 'complementary',\n 'contentinfo',\n 'definition',\n 'dialog',\n 'directory',\n 'document',\n 'feed',\n 'figure',\n 'form',\n 'group',\n 'heading',\n 'img',\n 'listitem',\n 'log',\n 'main',\n 'marquee',\n 'math',\n 'meter',\n 'navigation',\n 'note',\n 'option',\n 'presentation',\n 'region',\n 'row',\n 'rowgroup',\n 'rowheader',\n 'searchbox',\n 'separator',\n 'slider',\n 'status',\n 'table',\n 'tabpanel',\n 'term',\n 'tooltip',\n 'tree',\n 'treegrid',\n 'treeitem',\n]);\n\n/** The roles assistive technologies understand, as `accessibilityRole` names them. */\nexport type AccessibilityRole =\n | 'none'\n | 'button'\n | 'togglebutton'\n | 'link'\n | 'search'\n | 'image'\n | 'keyboardkey'\n | 'text'\n | 'adjustable'\n | 'imagebutton'\n | 'header'\n | 'summary'\n | 'alert'\n | 'checkbox'\n | 'combobox'\n | 'menu'\n | 'menubar'\n | 'menuitem'\n | 'progressbar'\n | 'radio'\n | 'radiogroup'\n | 'scrollbar'\n | 'spinbutton'\n | 'switch'\n | 'tab'\n | 'tabbar'\n | 'tablist'\n | 'timer'\n | 'list'\n | 'toolbar'\n | 'grid'\n | 'pager'\n | 'scrollview'\n | 'horizontalscrollview'\n | 'viewgroup'\n | 'webview'\n | 'drawerlayout'\n | 'slidingdrawer'\n | 'iconmenu';\n\nexport interface AccessibilityState {\n readonly disabled?: boolean;\n readonly selected?: boolean;\n readonly checked?: boolean | 'mixed';\n readonly busy?: boolean;\n readonly expanded?: boolean;\n}\n\nexport interface AccessibilityValue {\n readonly min?: number;\n readonly max?: number;\n readonly now?: number;\n readonly text?: string;\n}\n\nexport interface AccessibilityAction {\n readonly name: string;\n readonly label?: string;\n}\n\n/** Android's `nativeBackgroundAndroid` and `nativeForegroundAndroid`. */\nexport type AndroidDrawable =\n | {\n readonly type: 'RippleAndroid';\n readonly color?: string | number;\n readonly borderless?: boolean;\n readonly rippleRadius?: number;\n }\n | { readonly type: 'ThemeAttrAndroid'; readonly attribute: string };\n\nexport type PointerEvents = 'box-none' | 'none' | 'box-only' | 'auto';\nexport type ImportantForAccessibility = 'auto' | 'yes' | 'no' | 'no-hide-descendants';\nexport type AccessibilityLiveRegion = 'none' | 'polite' | 'assertive';\n\n/** Shallow equality, so a re-merged state that says the same thing keeps its identity. */\nfunction sameState(a: AccessibilityState, b: AccessibilityState): boolean {\n const keys = Object.keys(a) as (keyof AccessibilityState)[];\n return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key]);\n}\n\n/** The host primitives whose props have been declared to the engine. */\nconst declared = new WeakSet<object>();\n\n/**\n * Tell the engine the props this primitive's native view takes, once per component class: its\n * inputs by their public names, and `WRITTEN_PROPS`. What its check for a misspelt prop reads.\n */\nfunction declareProps(ctor: unknown, node: HostNode): void {\n if (declared.has(ctor as object)) return;\n declared.add(ctor as object);\n const tag = (node as { tag?: string }).tag;\n const inputs = hostInputNames(ctor);\n if (!tag || !inputs.size) return;\n declareNativeProps(tag, [...inputs, ...WRITTEN_PROPS]);\n}\n\n/**\n * What a directive on the same node says this view *is*, for a screen reader.\n *\n * A host primitive knows it is a view; only the thing composed onto it knows it is a button, a\n * checkbox or an accordion trigger. Without this seam that knowledge has nowhere to go: the role\n * and the state are written here, from this class's own inputs, and a later `ngOnChanges` would\n * overwrite anything a directive had set behind its back.\n *\n * Registered on the element with `contributeAccessibility`, and several primitives may contribute\n * to one element - a trigger that is also a button.\n */\nexport interface AccessibilityContribution {\n /** The role, if this directive implies one. An explicit `role` on the element still wins. */\n readonly role?: AccessibilityRole;\n /**\n * State to merge in, read on every write so it may be a signal read.\n *\n * Spelled in full because `state` is what a primitive calls the thing it publishes for a\n * stylesheet - `data-state=\"checked\"` - and the two are not the same thing.\n */\n readonly accessibilityState?: () => AccessibilityState | undefined;\n}\n\n/** Where an element's contributions are kept: on the node, and only on a node that has some. */\nconst CONTRIBUTIONS = Symbol('angular-native.accessibilityContributions');\ntype Contributed = HostNode & { [CONTRIBUTIONS]?: AccessibilityContribution[] };\nconst NO_CONTRIBUTIONS: readonly AccessibilityContribution[] = [];\n\n/**\n * Tell the primitive on this element what it is, for a screen reader: a role, and state to merge\n * into what it announces. Call it from a directive's field initialiser or constructor, on the\n * element the primitive is on:\n *\n * private readonly contribution = contributeAccessibility({ role: 'button' });\n * private readonly contribution = contributeAccessibility(this);\n *\n * Kept on the node rather than provided through DI, because asking the injector costs every\n * element on screen a lookup to learn that nothing contributes - about a tenth of creating a list.\n * Reading a property that is not there costs nothing.\n */\nexport function contributeAccessibility<T extends AccessibilityContribution>(contribution: T): T {\n const node = inject(ElementRef).nativeElement as Contributed;\n (node[CONTRIBUTIONS] ??= []).push(contribution);\n return contribution;\n}\n\n@Directive()\nexport abstract class ViewBase {\n /** The retained node this directive sits on. */\n protected readonly node = inject(ElementRef).nativeElement as HostNode;\n\n /**\n * The engine, because the props these inputs carry are written straight onto the node. Read\n * off the node where the host put it there, which is one property read against an injector\n * lookup that walks every ancestor element, for every element on screen.\n */\n protected readonly engine: HostEngine = this.node.engine ?? inject(HostEngine);\n\n /**\n * See `contributeAccessibility`. Empty for every element nothing is composed onto. Read, never\n * cached, from `ngOnInit` onwards: by then every directive on the node has been constructed and\n * registered what it has to say.\n */\n private get contributions(): readonly AccessibilityContribution[] {\n return (this.node as Contributed)[CONTRIBUTIONS] ?? NO_CONTRIBUTIONS;\n }\n\n /** iOS: what the components pod was last told of this view's keyboard focus. */\n private keyboardFocusable = false;\n /** iOS only: where a focusable view is reported, by react tag. */\n private readonly keyboardFocus = nativePlatform() === 'ios' ? inject(KEYBOARD_FOCUS) : null;\n\n constructor() {\n ownHost(this.node, this.constructor);\n declareProps(this.constructor, this.node);\n this.engine.settle(this);\n }\n\n /**\n * iOS: tell the components pod whether this view takes an iPad hardware keyboard's focus, which\n * React Native's iOS props cannot carry (`reportKeyboardFocusable`). By react tag: the one it has,\n * and each one the engine gives it later (`tagged`), on its first commit and when it is made\n * again. The pod forgets a view as React Native recycles it.\n */\n private reportKeyboardFocus(focusable: boolean): void {\n const tell = this.keyboardFocus;\n if (!tell || this.keyboardFocusable === focusable) return;\n this.keyboardFocusable = focusable;\n (this.node as { tagged?: (tag: number) => void }).tagged = focusable\n ? (tag) => tell(tag, true)\n : undefined;\n const tag = (this.engine as { tagOf?(node: HostNode): number | null }).tagOf?.(this.node);\n if (tag !== null && tag !== undefined) tell(tag, focusable);\n }\n\n /** Whether `ngOnInit` has run, which is what writes the props every element starts with. */\n private initialised = false;\n\n /**\n * Write what the inputs say, for an element whose view has not been checked by the time the\n * host commits it. Nothing for one that has.\n *\n * The props are written from `ngOnChanges` and `ngOnInit`, which Angular runs in the parent\n * view's update pass. A component that detaches itself before its first check never gets one,\n * and on the web that pattern still works, because a listener and an attribute are there from\n * creation. So the host calls this before the commit that first mounts the element, by when its\n * static inputs are set: the press handling, the role and the `testID` are there, and the view\n * behaves as written once something calls `detectChanges()`.\n */\n settleProps(): void {\n if (this.initialised) return;\n this.ngOnChanges({});\n this.ngOnInit();\n }\n\n // --- accessibility ---------------------------------------------------------------------\n\n /** Whether the view is an accessibility element. Defaults to false for a plain view. */\n readonly accessible = input<boolean>(undefined, { transform: optionalBoolean });\n /** What a screen reader announces for the view. */\n readonly accessibilityLabel = input<string>();\n /** `aria-label`: web spelling of `accessibilityLabel`. */\n readonly ariaLabel = input<string>(undefined, { alias: 'aria-label' });\n /** Android: `nativeID`s of the views that label this one. */\n readonly accessibilityLabelledBy = input<string | readonly string[]>();\n /** `aria-labelledby`: web spelling of `accessibilityLabelledBy`. */\n readonly ariaLabelledBy = input<string | readonly string[]>(undefined, {\n alias: 'aria-labelledby',\n });\n /** What happens when the user acts on the view, when the label alone does not say. */\n readonly accessibilityHint = input<string>();\n /** The kind of control this is, for assistive technologies. */\n readonly accessibilityRole = input<AccessibilityRole>();\n /** `role`: the web spelling, which takes the ARIA roles as well as `accessibilityRole`'s. */\n readonly role = input<Role | AccessibilityRole>();\n /** Disabled, selected, checked, busy and expanded, as one object. */\n readonly accessibilityState = input<AccessibilityState>();\n /** `aria-busy`. */\n readonly ariaBusy = input<boolean>(undefined, { alias: 'aria-busy', transform: optionalBoolean });\n /** `aria-checked`. */\n readonly ariaChecked = input<boolean | 'mixed'>(undefined, {\n alias: 'aria-checked',\n // Written as an attribute it is text, and native takes a boolean or `mixed`.\n transform: (value: unknown) => (value === 'mixed' ? 'mixed' : optionalBoolean(value)),\n });\n /** `aria-disabled`. */\n readonly ariaDisabled = input<boolean>(undefined, {\n alias: 'aria-disabled',\n transform: optionalBoolean,\n });\n /** `aria-expanded`. */\n readonly ariaExpanded = input<boolean>(undefined, {\n alias: 'aria-expanded',\n transform: optionalBoolean,\n });\n /** `aria-selected`. */\n readonly ariaSelected = input<boolean>(undefined, {\n alias: 'aria-selected',\n transform: optionalBoolean,\n });\n /** The current value of an adjustable control, for a screen reader. */\n readonly accessibilityValue = input<AccessibilityValue>();\n /** `aria-valuemin`. */\n readonly ariaValueMin = input<number>(undefined, {\n alias: 'aria-valuemin',\n transform: optionalNumber,\n });\n /** `aria-valuemax`. */\n readonly ariaValueMax = input<number>(undefined, {\n alias: 'aria-valuemax',\n transform: optionalNumber,\n });\n /** `aria-valuenow`. */\n readonly ariaValueNow = input<number>(undefined, {\n alias: 'aria-valuenow',\n transform: optionalNumber,\n });\n /** `aria-valuetext`. */\n readonly ariaValueText = input<string>(undefined, { alias: 'aria-valuetext' });\n /**\n * A heading's level, 1 to 6. The desktop host reads it, and VoiceOver on macOS 26 and later\n * speaks it; iOS and Android do not read it.\n */\n readonly accessibilityLevel = input<number>(undefined, { transform: optionalNumber });\n /** `aria-level`. */\n readonly ariaLevel = input<number>(undefined, { alias: 'aria-level', transform: optionalNumber });\n /** The `nativeID`s of the views that describe this one, read after its label. */\n readonly accessibilityDescribedBy = input<string | readonly string[]>();\n /** `aria-describedby`: a list separated by commas, or an array. */\n readonly ariaDescribedBy = input<string | readonly string[]>(undefined, {\n alias: 'aria-describedby',\n });\n /** Whether a field must be filled in before what it belongs to can be sent. */\n readonly accessibilityRequired = input<boolean>(undefined, { transform: optionalBoolean });\n /** `aria-required`. */\n readonly ariaRequired = input<boolean>(undefined, {\n alias: 'aria-required',\n transform: optionalBoolean,\n });\n /** Whether a field's value is not one it accepts. */\n readonly accessibilityInvalid = input<boolean>(undefined, { transform: optionalBoolean });\n /** `aria-invalid`. */\n readonly ariaInvalid = input<boolean>(undefined, {\n alias: 'aria-invalid',\n transform: optionalBoolean,\n });\n /** An item's place in its set, from 1, where not every item of the set is in the tree. */\n readonly accessibilityPosInSet = input<number>(undefined, { transform: optionalNumber });\n /** `aria-posinset`. */\n readonly ariaPosInSet = input<number>(undefined, {\n alias: 'aria-posinset',\n transform: optionalNumber,\n });\n /** How many items the set has, with `accessibilityPosInSet`. */\n readonly accessibilitySetSize = input<number>(undefined, { transform: optionalNumber });\n /** `aria-setsize`. */\n readonly ariaSetSize = input<number>(undefined, {\n alias: 'aria-setsize',\n transform: optionalNumber,\n });\n /** How many rows a grid or table has, where not every row is in the tree. */\n readonly accessibilityRowCount = input<number>(undefined, { transform: optionalNumber });\n /** `aria-rowcount`. */\n readonly ariaRowCount = input<number>(undefined, {\n alias: 'aria-rowcount',\n transform: optionalNumber,\n });\n /** How many columns a grid or table has, where not every column is in the tree. */\n readonly accessibilityColumnCount = input<number>(undefined, { transform: optionalNumber });\n /** `aria-colcount`. */\n readonly ariaColumnCount = input<number>(undefined, {\n alias: 'aria-colcount',\n transform: optionalNumber,\n });\n /** Custom actions a screen reader can invoke; each arrives as `(accessibilityAction)`. */\n readonly accessibilityActions = input<readonly AccessibilityAction[]>();\n /**\n * Android: announce changes to this view's content without focus moving to it. iOS has no live\n * regions, as in React Native: call `announce()` on `Accessibility` from `@ng-native/device`.\n */\n readonly accessibilityLiveRegion = input<AccessibilityLiveRegion>();\n /** `aria-live`. Android only: see `accessibilityLiveRegion`. */\n readonly ariaLive = input<AccessibilityLiveRegion>(undefined, { alias: 'aria-live' });\n /** iOS: hide this view and its children from assistive technologies. */\n readonly accessibilityElementsHidden = input<boolean>(undefined, { transform: optionalBoolean });\n /** `aria-hidden`: `accessibilityElementsHidden` on iOS, `no-hide-descendants` on Android. */\n readonly ariaHidden = input<boolean>(undefined, {\n alias: 'aria-hidden',\n transform: optionalBoolean,\n });\n /** Android: whether this view is exposed to accessibility, and whether its children are. */\n readonly importantForAccessibility = input<ImportantForAccessibility>();\n /** iOS: VoiceOver ignores every sibling while this view is shown, as a modal expects. */\n readonly accessibilityViewIsModal = input<boolean>(undefined, { transform: optionalBoolean });\n /** `aria-modal`. */\n readonly ariaModal = input<boolean>(undefined, {\n alias: 'aria-modal',\n transform: optionalBoolean,\n });\n /** iOS: keep the view's colours when the Invert Colors setting is on; images want this. */\n readonly accessibilityIgnoresInvertColors = input<boolean>(undefined, {\n transform: optionalBoolean,\n });\n /** iOS: the language VoiceOver reads the label in, as a BCP 47 tag. */\n readonly accessibilityLanguage = input<string>();\n /** iOS: the title shown by the Large Content Viewer on a long press with large text on. */\n readonly accessibilityLargeContentTitle = input<string>();\n /** iOS: opt this view into the Large Content Viewer. */\n readonly accessibilityShowsLargeContentViewer = input<boolean>(undefined, {\n transform: optionalBoolean,\n });\n /** iOS: tell VoiceOver the view responds to a tap even without a role that implies it. */\n readonly accessibilityRespondsToUserInteraction = input<boolean>(undefined, {\n transform: optionalBoolean,\n });\n\n // --- identity and hit testing ----------------------------------------------------------\n\n /** A handle native code can find the view by; also what `:id` selectors match. */\n readonly nativeID = input<string>();\n /** `id`: the web spelling of `nativeID`. */\n readonly id = input<string>();\n /** A handle for end-to-end test tooling. */\n readonly testID = input<string>();\n /** Extend the touchable area beyond the view's bounds, without moving anything visible. */\n readonly hitSlop = input<Insets | number>();\n /** Whether this view, its children, or neither can be the target of a touch. */\n readonly pointerEvents = input<PointerEvents>();\n /** Set to false to keep a layout-only view alive; Fabric otherwise removes it from the tree. */\n readonly collapsable = input<boolean>(undefined, { transform: optionalBoolean });\n /** Set to false to keep this view's layout-only children from being flattened. */\n readonly collapsableChildren = input<boolean>(undefined, { transform: optionalBoolean });\n /** Detach children that are outside the visible bounds. A scroll view optimisation. */\n readonly removeClippedSubviews = input<boolean>(undefined, { transform: optionalBoolean });\n /** Composite the view offscreen so a translucent view with children blends correctly. */\n readonly needsOffscreenAlphaCompositing = input<boolean>(undefined, {\n transform: optionalBoolean,\n });\n /** Android: whether the view takes keyboard or TV focus. RN's `tabIndex` is this. */\n readonly focusable = input<boolean>(undefined, { transform: optionalBoolean });\n /**\n * macOS and Linux: the words shown beside the pointer when it rests on the view, as an icon\n * button's name is. The web host sets `title`; iOS and Android have no tooltip and ignore it.\n */\n readonly tooltip = input<string>();\n /** iOS: render the view to a bitmap once and reuse it; for a static view that animates. */\n readonly shouldRasterizeIOS = input<boolean>(undefined, { transform: optionalBoolean });\n /** Android: cache the view in a hardware texture; the same trade as `shouldRasterizeIOS`. */\n readonly renderToHardwareTextureAndroid = input<boolean>(undefined, {\n transform: optionalBoolean,\n });\n /** Android: a ripple or theme drawable painted behind the view's content. */\n readonly nativeBackgroundAndroid = input<AndroidDrawable>();\n /** Android: a ripple or theme drawable painted over the view's content. */\n readonly nativeForegroundAndroid = input<AndroidDrawable>();\n\n // --- merged views of the aliases ------------------------------------------------------\n\n /**\n * What React Native's own JavaScript wrapper would have defaulted, per component.\n *\n * Driving the native views directly skips those wrappers, and what is lost is invisible: the\n * app looks identical and is unusable with a screen reader, because nothing on it is an\n * accessibility element. Each hook is overridden by the component whose wrapper sets it, and\n * cites the file it came from.\n */\n\n /** True for anything that behaves like a control. `Pressable.js`: `accessible !== false`. */\n protected accessibleByDefault(): boolean {\n return false;\n }\n\n /** Whether the platform's focus order should include this. `Pressable.js` again. */\n protected focusableByDefault(): boolean {\n return false;\n }\n\n /**\n * A role the component itself implies. `Switch.js`: `accessibilityRole ?? 'switch'`. Below an\n * explicit role and a contributed one, which is what a wrapper passing `accessibilityRole` is.\n */\n protected roleByDefault(): AccessibilityRole | undefined {\n return undefined;\n }\n\n /**\n * The component's own `disabled`, for the state a screen reader announces: undefined when not\n * passed.\n *\n * It wins over `aria-disabled` and `accessibilityState.disabled`, as it does in `Pressable.js`,\n * `TouchableOpacity.js`, `Switch.js` and `Text.js`. True is always merged; false only overrides\n * something else that says disabled, so a control that is not disabled says nothing rather than\n * saying so on every node.\n */\n protected disabledForAccessibility(): boolean | undefined {\n return undefined;\n }\n\n /**\n * The component's own `checked`, for a control whose checked state is not an accessibility\n * input at all - `Switch`'s `checked` is a `model()`, not one of this class's inputs, so it\n * cannot reach `ngOnChanges` here any more than `disabled` can.\n *\n * It wins over `aria-checked` and `accessibilityState.checked`, as `disabledForAccessibility`\n * does over theirs: what a screen reader announces is the position the control shows.\n */\n protected checkedForAccessibility(): boolean | 'mixed' | undefined {\n return undefined;\n }\n\n /**\n * Write what the inputs say onto the node.\n *\n * This is what thirty host bindings used to do, and it is here rather than there for a reason\n * that was measured: a host binding costs every element that carries it, on every pass, whether\n * or not the app ever set the prop, and mounting four hundred rows spent a third of its time on\n * the accessibility surface alone. Angular calls this once with everything that changed instead.\n *\n * It works with signal inputs, which is easy to assume it does not: `ngOnChanges` fires for\n * them as it does for any other input, because `ngOnChangesSetInput` records a `SimpleChange`\n * before writing the signal. `signal-onchanges.test.ts` is there to keep that fact honest.\n *\n * What remains is the allocation - a signal input builds its node whether or not anything binds\n * to it, and there are forty-six here. Moving prop groups into directives selected by the props\n * they carry (`[accessibilityLabel], [aria-label], ...`) is how that goes away: an element that\n * binds none of them would allocate nothing. Measured on a 400-row mount it is worth about 40ms,\n * at the price of an import per group.\n */\n ngOnChanges(_changes?: SimpleChanges): void {\n this.writeAccessibility();\n this.writeIdentity();\n }\n\n private writeAccessibility(): void {\n const write = this.writer();\n write(\n 'accessible',\n this.accessibleByDefault() ? (this.accessible() ?? true) : this.accessible(),\n );\n write(\n 'accessibilityLabel',\n this.accessibilityLabel() ?? this.ariaLabel() ?? this.labelByDefault(),\n );\n write('accessibilityLabelledBy', this.accessibilityLabelledBy() ?? this.ariaLabelledBy());\n write('accessibilityHint', this.accessibilityHint());\n const role = this.role();\n const aria = role !== undefined && ARIA_ONLY_ROLES.has(role);\n write('role', aria ? role : undefined);\n // An ARIA role is the element's role whatever the component implies, as any explicit one is.\n write(\n 'accessibilityRole',\n this.accessibilityRole() ?? (aria ? undefined : (role ?? this.impliedRole())),\n );\n write('accessibilityState', this.mergedAccessibilityState());\n write('accessibilityValue', this.mergedAccessibilityValue());\n write('accessibilityActions', this.accessibilityActions());\n this.writeDesktopAccessibility(write);\n this.writeVisibility();\n this.publishAriaState(write);\n }\n\n /**\n * The inputs the desktop host reads, each from its native spelling, or else the web one: a\n * heading's level, what describes the view, a field's required and invalid states, an item's\n * place in its set, and a grid's counts.\n */\n private writeDesktopAccessibility(write: (key: string, value: unknown) => void): void {\n const describedBy = this.accessibilityDescribedBy() ?? this.ariaDescribedBy();\n write('accessibilityLevel', this.accessibilityLevel() ?? this.ariaLevel());\n write(\n 'accessibilityDescribedBy',\n typeof describedBy === 'string' ? describedBy.split(/\\s*,\\s*/) : describedBy,\n );\n write('accessibilityRequired', this.accessibilityRequired() ?? this.ariaRequired());\n write('accessibilityInvalid', this.accessibilityInvalid() ?? this.ariaInvalid());\n write('accessibilityPosInSet', this.accessibilityPosInSet() ?? this.ariaPosInSet());\n write('accessibilitySetSize', this.accessibilitySetSize() ?? this.ariaSetSize());\n write('accessibilityRowCount', this.accessibilityRowCount() ?? this.ariaRowCount());\n write('accessibilityColumnCount', this.accessibilityColumnCount() ?? this.ariaColumnCount());\n }\n\n /**\n * The aria states Tailwind has variants for, put back on the node as the attributes they came\n * in as. The inputs consume them, so `[aria-disabled=\"true\"]` and every `aria-*:` utility had\n * nothing to match. Hyphenated, so the engine keeps them for selectors and never sends them.\n */\n private publishAriaState(write: (key: string, value: unknown) => void): void {\n const attribute = (value: unknown) => (value === undefined ? undefined : String(value));\n write('aria-busy', attribute(this.ariaBusy()));\n write('aria-checked', attribute(this.ariaChecked()));\n write('aria-disabled', attribute(this.ariaDisabled()));\n write('aria-expanded', attribute(this.ariaExpanded()));\n write('aria-hidden', attribute(this.ariaHidden()));\n write('aria-selected', attribute(this.ariaSelected()));\n }\n\n /** The half of accessibility that is about what assistive technology may see, and in which language. */\n private writeVisibility(): void {\n const write = (key: string, value: unknown) => this.engine.setProp(this.node, key, value);\n write('accessibilityLiveRegion', this.accessibilityLiveRegion() ?? this.ariaLive());\n write('accessibilityElementsHidden', this.accessibilityElementsHidden() ?? this.ariaHidden());\n write(\n 'importantForAccessibility',\n this.importantForAccessibility() ?? (this.ariaHidden() ? 'no-hide-descendants' : undefined),\n );\n write('accessibilityViewIsModal', this.accessibilityViewIsModal() ?? this.ariaModal());\n write('accessibilityIgnoresInvertColors', this.accessibilityIgnoresInvertColors());\n write('accessibilityLanguage', this.accessibilityLanguage());\n write('accessibilityLargeContentTitle', this.accessibilityLargeContentTitle());\n write('accessibilityShowsLargeContentViewer', this.accessibilityShowsLargeContentViewer());\n write('accessibilityRespondsToUserInteraction', this.accessibilityRespondsToUserInteraction());\n }\n\n /**\n * Writes a prop, and says nothing when it has nothing to say.\n *\n * The `undefined` guard is the whole of it. These two methods rewrite roughly forty props from\n * this class's own inputs on every `ngOnChanges`, so without the guard, anything that reached\n * the node by another route would be overwritten the first time any input changed. Two routes\n * reach the node without going through an input of this class:\n *\n * - A host binding on a component that composes this class in, such as `[accessible]` or\n * `[accessibilityLabel]` set from the composing component's own `host` object.\n * - An element property binding beside a `hostDirectives` entry. A component whose\n * `hostDirectives` entry lists one input (say `disabled`) but not another (say `nativeID`)\n * leaves `[nativeID]` to be applied as a plain property; a bound `[disabled]` beside it would\n * then clobber the id on the next change unless the identity inputs are also listed through\n * explicitly.\n *\n * An input that goes back to `undefined` clears the prop only when this is what set it, so a\n * binding such as `[pointerEvents]=\"busy() ? 'none' : undefined\"` still switches off, and a\n * prop that arrived by one of those other routes is still never touched. Clearing a *class*\n * clears the style it brought, because that goes through the cascade rather than through here.\n */\n private writer(): (key: string, value: unknown) => void {\n return (key, value) => {\n if (value === undefined) {\n // Cleared only if this wrote it: `[pointerEvents]=\"busy() ? 'none' : undefined\"` has to\n // give the view its touches back, and a prop another route set is still left alone.\n if (this.written?.delete(key)) this.engine.setProp(this.node, key, null);\n return;\n }\n (this.written ??= new Set()).add(key);\n this.engine.setProp(this.node, key, value);\n };\n }\n\n /** The props `writer` has set from an input, so it can clear one when its input is unset. */\n private written: Set<string> | null = null;\n\n private writeIdentity(): void {\n const write = this.writer();\n write('nativeID', this.nativeID() ?? this.id());\n write('testID', this.testID());\n write('hitSlop', this.hitSlop());\n write('pointerEvents', this.pointerEvents());\n write('collapsable', this.collapsable());\n write('collapsableChildren', this.collapsableChildren());\n write('removeClippedSubviews', this.removeClippedSubviews());\n write('needsOffscreenAlphaCompositing', this.needsOffscreenAlphaCompositing());\n const focusable = this.focusableByDefault() ? (this.focusable() ?? true) : this.focusable();\n write('focusable', focusable);\n write('tooltip', this.tooltip());\n this.reportKeyboardFocus(focusable === true);\n write('shouldRasterizeIOS', this.shouldRasterizeIOS());\n write('renderToHardwareTextureAndroid', this.renderToHardwareTextureAndroid());\n write('nativeBackgroundAndroid', this.nativeBackgroundAndroid());\n write('nativeForegroundAndroid', this.nativeForegroundAndroid());\n }\n\n /**\n * The defaults a React Native wrapper would have applied, written once when the element is\n * created. `ngOnChanges` writes them again whenever an input changes, so an app that later\n * clears a prop falls back to the default rather than to nothing.\n */\n /**\n * The defaults a React Native wrapper would have applied, for an element nothing was bound on.\n *\n * In `ngOnInit` rather than the constructor because a hook like `accessibleByDefault` is\n * answered from the subclass's own inputs - `Text` asks whether it is pressable - and those\n * fields do not exist yet while the base constructor runs. Each is guarded on its input being\n * unset, because `ngOnChanges` has already run by now and its answer, which merges the default\n * in, is the better one.\n */\n ngOnInit(): void {\n this.initialised = true;\n // A directive with nothing bound to it never sees `ngOnChanges`, so an element that carries a\n // primitive and no bindings would never have its role or state written at all. Cheap to ask,\n // and the answer is no for every element in an app that uses none.\n if (this.contributions.length > 0) this.writeAccessibility();\n if (this.accessible() === undefined && this.accessibleByDefault()) {\n this.engine.setProp(this.node, 'accessible', true);\n }\n if (this.focusable() === undefined && this.focusableByDefault()) {\n this.engine.setProp(this.node, 'focusable', true);\n this.reportKeyboardFocus(true);\n }\n if (this.accessibilityRole() === undefined && this.role() === undefined) {\n const role = this.impliedRole();\n if (role) this.engine.setProp(this.node, 'accessibilityRole', role);\n }\n if (this.accessibilityLabel() === undefined && this.ariaLabel() === undefined) {\n const label = this.labelByDefault();\n if (label !== undefined) this.engine.setProp(this.node, 'accessibilityLabel', label);\n }\n }\n\n /** The role when none is set: one a directive contributes, or else the component's own. */\n private impliedRole(): AccessibilityRole | undefined {\n return this.contributedRole() ?? this.roleByDefault();\n }\n\n /** The first role any directive on this node claims. Two claiming different ones is a bug. */\n private contributedRole(): AccessibilityRole | undefined {\n for (const contribution of this.contributions) {\n if (contribution.role) return contribution.role;\n }\n return undefined;\n }\n\n /** A label the component itself can supply, as `Image` does from `alt`. */\n protected labelByDefault(): string | undefined {\n return undefined;\n }\n\n /**\n * The merged state, for a component whose own inputs feed it - `disabled` on a pressable or a\n * switch, which is a signal of theirs and so cannot reach `ngOnChanges` here.\n *\n * Those components bind this from their host. It returns the *same object* when nothing has\n * changed, which is what keeps a host binding from marking the node dirty on every pass.\n */\n protected accessibilityStateProp(): AccessibilityState | undefined {\n return this.mergedAccessibilityState();\n }\n\n private lastAccessibilityState: AccessibilityState | undefined;\n\n /** Whether anything could put state on this node. For nearly every node on screen, no. */\n private hasState(): boolean {\n return (\n this.accessibilityState() !== undefined ||\n this.ariaBusy() !== undefined ||\n this.ariaChecked() !== undefined ||\n this.ariaDisabled() !== undefined ||\n this.ariaExpanded() !== undefined ||\n this.ariaSelected() !== undefined ||\n !!this.disabledForAccessibility() ||\n this.checkedForAccessibility() !== undefined ||\n this.contributions.length > 0\n );\n }\n\n private mergedAccessibilityState(): AccessibilityState | undefined {\n // Answered without allocating in the common case: this runs from a host binding on every\n // control, on every pass, and most of them have no state to announce.\n if (!this.hasState()) return (this.lastAccessibilityState = undefined);\n const explicit = this.accessibilityState();\n const merged: Record<string, unknown> = { ...explicit };\n const set = (key: keyof AccessibilityState, value: unknown) => {\n if (value !== undefined) merged[key] = value;\n };\n set('busy', this.ariaBusy());\n set('checked', this.ariaChecked());\n set('checked', this.checkedForAccessibility());\n set('disabled', this.ariaDisabled());\n set('disabled', this.disabledOver(merged['disabled']));\n set('expanded', this.ariaExpanded());\n set('selected', this.ariaSelected());\n for (const contribution of this.contributions) {\n const state = contribution.accessibilityState?.();\n for (const key of Object.keys(state ?? {})) {\n set(key as keyof AccessibilityState, (state as Record<string, unknown>)[key]);\n }\n }\n const state = Object.keys(merged).length ? (merged as AccessibilityState) : explicit;\n const last = this.lastAccessibilityState;\n if (last && state && sameState(last, state)) return last;\n return (this.lastAccessibilityState = state);\n }\n\n /** `disabled` over what else said: true always, false only when something said otherwise. */\n private disabledOver(other: unknown): boolean | undefined {\n const own = this.disabledForAccessibility();\n return own || (own === false && other !== undefined) ? own : undefined;\n }\n\n private mergedAccessibilityValue(): AccessibilityValue | undefined {\n const explicit = this.accessibilityValue();\n const merged: Record<string, unknown> = { ...explicit };\n const set = (key: keyof AccessibilityValue, value: unknown) => {\n if (value !== undefined) merged[key] = value;\n };\n set('min', this.ariaValueMin());\n set('max', this.ariaValueMax());\n set('now', this.ariaValueNow());\n set('text', this.ariaValueText());\n return Object.keys(merged).length ? (merged as AccessibilityValue) : explicit;\n }\n}\n\n/**\n * `ViewBase` on its own, for a component whose host is a plain view.\n *\n * No selector: this is only ever a `hostDirectives` entry, and it is the counterpart to\n * `PressBehavior` for the parts of a control that do not take a touch. A radio group is the case\n * that asked for it - it announces itself as a group and holds a value, but pressing it means\n * nothing, and without a `ViewBase` on the node there is nothing to write that role.\n */\n@Directive({})\nexport class ViewBehavior extends ViewBase {}\n"]}
|
package/dist/view.js
CHANGED
|
@@ -8,10 +8,10 @@ import * as i0 from "@angular/core";
|
|
|
8
8
|
* Every prop is on `ViewBase`; styling comes from `[style]`, `class` and the component's CSS.
|
|
9
9
|
*/
|
|
10
10
|
export class View extends ViewBase {
|
|
11
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
12
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: View, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
12
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.3.0", type: View, isStandalone: true, selector: "view", usesInheritance: true, ngImport: i0 });
|
|
13
13
|
}
|
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: View, decorators: [{
|
|
15
15
|
type: Directive,
|
|
16
16
|
args: [{ selector: 'view' }]
|
|
17
17
|
}] });
|
|
@@ -17,5 +17,10 @@ export interface VirtualListLayout {
|
|
|
17
17
|
* column's props name the same keys, so moving between columns overwrites them all.
|
|
18
18
|
*/
|
|
19
19
|
across(column: number, left: number, right: number): Record<string, unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* What says a row takes a line to itself, as a sticky row does, such as a section's header or
|
|
22
|
+
* footer across a grid of its items, or null when nothing does.
|
|
23
|
+
*/
|
|
24
|
+
readonly fullLineOf?: Signal<((item: unknown, index: number) => boolean) | null>;
|
|
20
25
|
}
|
|
21
26
|
export declare const VIRTUAL_LIST_LAYOUT: InjectionToken<VirtualListLayout>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-list-layout.js","sourceRoot":"","sources":["../src/virtual-list-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"virtual-list-layout.js","sourceRoot":"","sources":["../src/virtual-list-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;AAmB5D,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,cAAc,CACnD,kCAAkC,CACnC,CAAC","sourcesContent":["/**\n * How `<virtual-list>` lays items out across its width, when a directive on the list says so.\n *\n * The list places items along its axis and windows them; how many share a line and where each\n * sits across it is a separate decision, and a list that never makes it carries none of its code.\n * A directive on the list's own element provides this, as `[contextMenu]` provides `CONTEXT_MENU`\n * to `<pressable>`, and the list reads it with `{ self: true, optional: true }`.\n */\nimport { InjectionToken, type Signal } from '@angular/core';\n\nexport interface VirtualListLayout {\n /** How many items go on a line. One is a plain list. */\n readonly columns: Signal<number>;\n /**\n * The props that place the item in `column` across a line, given the list's own insets on its\n * left and right. Column 0 is at the start of the line, so the props are logical sides, which\n * layout resolves by direction as React Native resolves the list's own left and right. Every\n * column's props name the same keys, so moving between columns overwrites them all.\n */\n across(column: number, left: number, right: number): Record<string, unknown>;\n /**\n * What says a row takes a line to itself, as a sticky row does, such as a section's header or\n * footer across a grid of its items, or null when nothing does.\n */\n readonly fullLineOf?: Signal<((item: unknown, index: number) => boolean) | null>;\n}\n\nexport const VIRTUAL_LIST_LAYOUT = new InjectionToken<VirtualListLayout>(\n 'angular-native.virtualListLayout',\n);\n"]}
|
|
@@ -17,7 +17,8 @@ import * as i0 from "@angular/core";
|
|
|
17
17
|
* is the same as a plain list's. Items fill a line left to right, right to left in a
|
|
18
18
|
* right-to-left layout, and every column is the same width. A line is as tall as its tallest item,
|
|
19
19
|
* and its items stretch to it, as they do in FlatList's row. A sticky row takes a line to itself,
|
|
20
|
-
* so a month's header pins across the whole grid.
|
|
20
|
+
* so a month's header pins across the whole grid. A row `virtualListFullLine` picks takes one too,
|
|
21
|
+
* such as a section's header that scrolls with the rest.
|
|
21
22
|
*
|
|
22
23
|
* Columns are for vertical lists with `itemHeight`, as FlatList's `numColumns` is vertical only.
|
|
23
24
|
*
|
|
@@ -27,13 +28,16 @@ import * as i0 from "@angular/core";
|
|
|
27
28
|
* last line's, with the next line's first item as its `trailingItem`, where FlatList draws one a
|
|
28
29
|
* line.
|
|
29
30
|
*/
|
|
30
|
-
export declare class VirtualListNumColumns implements VirtualListLayout {
|
|
31
|
+
export declare class VirtualListNumColumns<T = unknown> implements VirtualListLayout {
|
|
31
32
|
/** Items to a line, as FlatList's `numColumns`. */
|
|
32
33
|
readonly numColumns: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
33
34
|
/** Space between one column and the next. `rowGap` on the list spaces the lines. */
|
|
34
35
|
readonly columnGap: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
36
|
+
/** Whether a row takes a line to itself, given each item and its index. */
|
|
37
|
+
readonly fullLine: import("@angular/core").InputSignal<((item: T, index: number) => boolean) | null | undefined>;
|
|
35
38
|
private readonly injector;
|
|
36
39
|
readonly columns: import("@angular/core").Signal<number>;
|
|
40
|
+
readonly fullLineOf: import("@angular/core").Signal<((item: unknown, index: number) => boolean) | null>;
|
|
37
41
|
constructor();
|
|
38
42
|
/**
|
|
39
43
|
* Each column is an equal share of the width, as a percentage, so the line needs no width to
|
|
@@ -42,6 +46,6 @@ export declare class VirtualListNumColumns implements VirtualListLayout {
|
|
|
42
46
|
* puts the gaps between the columns rather than inside them.
|
|
43
47
|
*/
|
|
44
48
|
across(column: number, left: number, right: number): Record<string, unknown>;
|
|
45
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<VirtualListNumColumns
|
|
46
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<VirtualListNumColumns
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VirtualListNumColumns<any>, never>;
|
|
50
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<VirtualListNumColumns<any>, "virtual-list[virtualListNumColumns]", never, { "numColumns": { "alias": "virtualListNumColumns"; "required": false; "isSignal": true; }; "columnGap": { "alias": "virtualListColumnGap"; "required": false; "isSignal": true; }; "fullLine": { "alias": "virtualListFullLine"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
47
51
|
}
|
|
@@ -20,7 +20,8 @@ import * as i0 from "@angular/core";
|
|
|
20
20
|
* is the same as a plain list's. Items fill a line left to right, right to left in a
|
|
21
21
|
* right-to-left layout, and every column is the same width. A line is as tall as its tallest item,
|
|
22
22
|
* and its items stretch to it, as they do in FlatList's row. A sticky row takes a line to itself,
|
|
23
|
-
* so a month's header pins across the whole grid.
|
|
23
|
+
* so a month's header pins across the whole grid. A row `virtualListFullLine` picks takes one too,
|
|
24
|
+
* such as a section's header that scrolls with the rest.
|
|
24
25
|
*
|
|
25
26
|
* Columns are for vertical lists with `itemHeight`, as FlatList's `numColumns` is vertical only.
|
|
26
27
|
*
|
|
@@ -35,6 +36,8 @@ export class VirtualListNumColumns {
|
|
|
35
36
|
numColumns = input(1, { ...(ngDevMode ? { debugName: "numColumns" } : /* istanbul ignore next */ {}), alias: 'virtualListNumColumns', transform: numberOr(1) });
|
|
36
37
|
/** Space between one column and the next. `rowGap` on the list spaces the lines. */
|
|
37
38
|
columnGap = input(0, { ...(ngDevMode ? { debugName: "columnGap" } : /* istanbul ignore next */ {}), alias: 'virtualListColumnGap', transform: numberOr(0) });
|
|
39
|
+
/** Whether a row takes a line to itself, given each item and its index. */
|
|
40
|
+
fullLine = input(undefined, { ...(ngDevMode ? { debugName: "fullLine" } : /* istanbul ignore next */ {}), alias: 'virtualListFullLine' });
|
|
38
41
|
// Looked up once the list exists: the list injects this directive while it is being made.
|
|
39
42
|
injector = inject(Injector);
|
|
40
43
|
columns = computed(() => {
|
|
@@ -42,6 +45,11 @@ export class VirtualListNumColumns {
|
|
|
42
45
|
return Number.isFinite(columns) ? Math.max(1, Math.floor(columns)) : 1;
|
|
43
46
|
}, /* @ts-ignore */
|
|
44
47
|
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
48
|
+
fullLineOf = computed(() => {
|
|
49
|
+
const fullLine = this.fullLine();
|
|
50
|
+
return fullLine ? (item, index) => fullLine(item, index) : null;
|
|
51
|
+
}, /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "fullLineOf" }] : /* istanbul ignore next */ []));
|
|
45
53
|
constructor() {
|
|
46
54
|
if (typeof ngDevMode === 'undefined' || !ngDevMode)
|
|
47
55
|
return;
|
|
@@ -80,12 +88,12 @@ export class VirtualListNumColumns {
|
|
|
80
88
|
marginEnd: spare - marginStart,
|
|
81
89
|
};
|
|
82
90
|
}
|
|
83
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
84
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
91
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: VirtualListNumColumns, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
92
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.3.0", type: VirtualListNumColumns, isStandalone: true, selector: "virtual-list[virtualListNumColumns]", inputs: { numColumns: { classPropertyName: "numColumns", publicName: "virtualListNumColumns", isSignal: true, isRequired: false, transformFunction: null }, columnGap: { classPropertyName: "columnGap", publicName: "virtualListColumnGap", isSignal: true, isRequired: false, transformFunction: null }, fullLine: { classPropertyName: "fullLine", publicName: "virtualListFullLine", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
85
93
|
{ provide: VIRTUAL_LIST_LAYOUT, useExisting: forwardRef(() => VirtualListNumColumns) },
|
|
86
94
|
], ngImport: i0 });
|
|
87
95
|
}
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: VirtualListNumColumns, decorators: [{
|
|
89
97
|
type: Directive,
|
|
90
98
|
args: [{
|
|
91
99
|
selector: 'virtual-list[virtualListNumColumns]',
|
|
@@ -93,5 +101,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
|
|
|
93
101
|
{ provide: VIRTUAL_LIST_LAYOUT, useExisting: forwardRef(() => VirtualListNumColumns) },
|
|
94
102
|
],
|
|
95
103
|
}]
|
|
96
|
-
}], ctorParameters: () => [], propDecorators: { numColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualListNumColumns", required: false }] }], columnGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualListColumnGap", required: false }] }] } });
|
|
104
|
+
}], ctorParameters: () => [], propDecorators: { numColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualListNumColumns", required: false }] }], columnGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualListColumnGap", required: false }] }], fullLine: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualListFullLine", required: false }] }] } });
|
|
97
105
|
//# sourceMappingURL=virtual-list-num-columns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-list-num-columns.js","sourceRoot":"","sources":["../src/virtual-list-num-columns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAA0B,MAAM,0BAA0B,CAAC;;AAEvF
|
|
1
|
+
{"version":3,"file":"virtual-list-num-columns.js","sourceRoot":"","sources":["../src/virtual-list-num-columns.ts"],"names":[],"mappings":"AAAA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K,EAAE,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,OAAO,GAAG;YACrC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,OAAO,GAAG;YACnD,WAAW;YACX,SAAS,EAAE,KAAK,GAAG,WAAW;SAC/B,CAAC;IACJ,CAAC;uGA3DU,qBAAqB;2FAArB,qBAAqB,2gBAJrB;YACT,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,EAAE;SACvF;;2FAEU,qBAAqB;kBANjC,SAAS;mBAAC;oBACT,QAAQ,EAAE,qCAAqC;oBAC/C,SAAS,EAAE;wBACT,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,sBAAsB,CAAC,EAAE;qBACvF;iBACF","sourcesContent":["import { Directive, Injector, computed, effect, forwardRef, inject, input } from '@angular/core';\nimport { numberOr } from './transforms.ts';\nimport { VirtualList } from './virtual-list.ts';\nimport { VIRTUAL_LIST_LAYOUT, type VirtualListLayout } from './virtual-list-layout.ts';\n\n/**\n * FlatList's `numColumns`, on `<virtual-list>` itself: a photo grid or a shop's products, windowed\n * a line at a time.\n *\n * ```html\n * <virtual-list #list [items]=\"photos\" [itemHeight]=\"120\" [rowGap]=\"2\"\n * [virtualListNumColumns]=\"3\" [virtualListColumnGap]=\"2\">\n * @for (row of list.window(); track row.slot) {\n * <image [virtualListRow]=\"row\" [source]=\"row.item.uri\" />\n * }\n * </virtual-list>\n * ```\n *\n * Each item is still one row of the window, with its own slot, key and recycling, so the `@for`\n * is the same as a plain list's. Items fill a line left to right, right to left in a\n * right-to-left layout, and every column is the same width. A line is as tall as its tallest item,\n * and its items stretch to it, as they do in FlatList's row. A sticky row takes a line to itself,\n * so a month's header pins across the whole grid. A row `virtualListFullLine` picks takes one too,\n * such as a section's header that scrolls with the rest.\n *\n * Columns are for vertical lists with `itemHeight`, as FlatList's `numColumns` is vertical only.\n *\n * ponytail: rows that size themselves stay one to a line, with a warning in development, since a\n * line's height would wait on every item in it measuring. FlatList's `columnWrapperStyle` has no\n * equivalent: there is no view per line to style. A separator is drawn under each item but the\n * last line's, with the next line's first item as its `trailingItem`, where FlatList draws one a\n * line.\n */\n@Directive({\n selector: 'virtual-list[virtualListNumColumns]',\n providers: [\n { provide: VIRTUAL_LIST_LAYOUT, useExisting: forwardRef(() => VirtualListNumColumns) },\n ],\n})\nexport class VirtualListNumColumns<T = unknown> implements VirtualListLayout {\n /** Items to a line, as FlatList's `numColumns`. */\n readonly numColumns = input(1, { alias: 'virtualListNumColumns', transform: numberOr(1) });\n /** Space between one column and the next. `rowGap` on the list spaces the lines. */\n readonly columnGap = input(0, { alias: 'virtualListColumnGap', transform: numberOr(0) });\n /** Whether a row takes a line to itself, given each item and its index. */\n readonly fullLine = input<((item: T, index: number) => boolean) | null | undefined>(undefined, {\n alias: 'virtualListFullLine',\n });\n\n // Looked up once the list exists: the list injects this directive while it is being made.\n private readonly injector = inject(Injector);\n\n readonly columns = computed(() => {\n const columns = this.numColumns();\n return Number.isFinite(columns) ? Math.max(1, Math.floor(columns)) : 1;\n });\n\n readonly fullLineOf = computed(() => {\n const fullLine = this.fullLine();\n return fullLine ? (item: unknown, index: number) => fullLine(item as T, index) : null;\n });\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || !ngDevMode) return;\n const unsupported = effect(() => {\n if (this.columns() === 1) return;\n const list = this.injector.get(VirtualList, null, { self: true });\n const why = list?.horizontal()\n ? 'a horizontal list'\n : list?.measuring()\n ? 'rows without itemHeight'\n : null;\n if (!why) return;\n unsupported.destroy();\n console.warn(\n `[angular-native] virtualListNumColumns lays out one item a line on ${why}: columns ` +\n `are for a vertical list with itemHeight, as FlatList's numColumns is vertical only.`,\n );\n });\n }\n\n /**\n * Each column is an equal share of the width, as a percentage, so the line needs no width to\n * be laid out and follows a rotation without one. The padding and gaps are then taken out by\n * margins: every column gives up the same amount, and how much of it is on which side is what\n * puts the gaps between the columns rather than inside them.\n */\n across(column: number, left: number, right: number): Record<string, unknown> {\n const columns = this.columns();\n const gap = this.columnGap();\n const spare = (left + right + (columns - 1) * gap) / columns;\n const marginStart = left - (column * (left + right - gap)) / columns;\n return {\n start: `${(column * 100) / columns}%`,\n end: `${((columns - 1 - column) * 100) / columns}%`,\n marginStart,\n marginEnd: spare - marginStart,\n };\n }\n}\n\ndeclare const ngDevMode: unknown;\n"]}
|
|
@@ -18,10 +18,6 @@ import * as i0 from "@angular/core";
|
|
|
18
18
|
* A row pins under the nearest row before it of each level further out than its own, and stays
|
|
19
19
|
* until the next row of its own level, or of one further out, pushes it off. The rows of
|
|
20
20
|
* `stickyIndices` are at level 0, so the two can be given together.
|
|
21
|
-
*
|
|
22
|
-
* ponytail: rows that size themselves pin level 0 alone, with a warning in development, and
|
|
23
|
-
* deeper rows scroll with the rest: where a row pins under others depends on their heights, which
|
|
24
|
-
* are not known until each has been measured.
|
|
25
21
|
*/
|
|
26
22
|
export declare class VirtualListStickyLevel<T = unknown> implements VirtualListSticky {
|
|
27
23
|
/** A row's level, from 0 for the outermost, or `null` for a row that is not sticky. */
|
|
@@ -31,9 +27,7 @@ export declare class VirtualListStickyLevel<T = unknown> implements VirtualListS
|
|
|
31
27
|
* limits the levels the function gives: the rows of `stickyIndices` pin whatever it is.
|
|
32
28
|
*/
|
|
33
29
|
readonly maxLevels: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
34
|
-
private readonly injector;
|
|
35
30
|
readonly levelOf: import("@angular/core").Signal<((item: unknown, index: number) => number | null) | null>;
|
|
36
|
-
constructor();
|
|
37
31
|
static ɵfac: i0.ɵɵFactoryDeclaration<VirtualListStickyLevel<any>, never>;
|
|
38
32
|
static ɵdir: i0.ɵɵDirectiveDeclaration<VirtualListStickyLevel<any>, "virtual-list[virtualListStickyLevel]", never, { "level": { "alias": "virtualListStickyLevel"; "required": false; "isSignal": true; }; "maxLevels": { "alias": "virtualListMaxStickyLevels"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
39
33
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, computed, forwardRef, input } from '@angular/core';
|
|
2
2
|
import { numberOr } from "./transforms.js";
|
|
3
|
-
import { VirtualList } from "./virtual-list.js";
|
|
4
3
|
import { VIRTUAL_LIST_STICKY } from "./virtual-list-sticky.js";
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
6
5
|
/**
|
|
@@ -21,10 +20,6 @@ import * as i0 from "@angular/core";
|
|
|
21
20
|
* A row pins under the nearest row before it of each level further out than its own, and stays
|
|
22
21
|
* until the next row of its own level, or of one further out, pushes it off. The rows of
|
|
23
22
|
* `stickyIndices` are at level 0, so the two can be given together.
|
|
24
|
-
*
|
|
25
|
-
* ponytail: rows that size themselves pin level 0 alone, with a warning in development, and
|
|
26
|
-
* deeper rows scroll with the rest: where a row pins under others depends on their heights, which
|
|
27
|
-
* are not known until each has been measured.
|
|
28
23
|
*/
|
|
29
24
|
export class VirtualListStickyLevel {
|
|
30
25
|
/** A row's level, from 0 for the outermost, or `null` for a row that is not sticky. */
|
|
@@ -35,8 +30,6 @@ export class VirtualListStickyLevel {
|
|
|
35
30
|
*/
|
|
36
31
|
maxLevels = input(Infinity, { ...(ngDevMode ? { debugName: "maxLevels" } : /* istanbul ignore next */ {}), alias: 'virtualListMaxStickyLevels',
|
|
37
32
|
transform: numberOr(Infinity) });
|
|
38
|
-
// Looked up once the list exists: the list injects this directive while it is being made.
|
|
39
|
-
injector = inject(Injector);
|
|
40
33
|
levelOf = computed(() => {
|
|
41
34
|
const level = this.level();
|
|
42
35
|
if (!level)
|
|
@@ -48,29 +41,12 @@ export class VirtualListStickyLevel {
|
|
|
48
41
|
};
|
|
49
42
|
}, /* @ts-ignore */
|
|
50
43
|
...(ngDevMode ? [{ debugName: "levelOf" }] : /* istanbul ignore next */ []));
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return;
|
|
54
|
-
const unsupported = effect(() => {
|
|
55
|
-
const levelOf = this.levelOf();
|
|
56
|
-
const list = this.injector.get(VirtualList, null, { self: true });
|
|
57
|
-
if (!levelOf || !list?.measuring())
|
|
58
|
-
return;
|
|
59
|
-
if (!list.items().some((item, index) => (levelOf(item, index) ?? 0) > 0))
|
|
60
|
-
return;
|
|
61
|
-
unsupported.destroy();
|
|
62
|
-
console.warn(`[angular-native] virtualListStickyLevel pins level 0 alone on rows without itemHeight: ` +
|
|
63
|
-
`a row pins under others by their heights, which rows that size themselves do not ` +
|
|
64
|
-
`have until they are measured.`);
|
|
65
|
-
}, /* @ts-ignore */
|
|
66
|
-
...(ngDevMode ? [{ debugName: "unsupported" }] : /* istanbul ignore next */ []));
|
|
67
|
-
}
|
|
68
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: VirtualListStickyLevel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
69
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.0", type: VirtualListStickyLevel, isStandalone: true, selector: "virtual-list[virtualListStickyLevel]", inputs: { level: { classPropertyName: "level", publicName: "virtualListStickyLevel", isSignal: true, isRequired: false, transformFunction: null }, maxLevels: { classPropertyName: "maxLevels", publicName: "virtualListMaxStickyLevels", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
44
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: VirtualListStickyLevel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
45
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.3.0", type: VirtualListStickyLevel, isStandalone: true, selector: "virtual-list[virtualListStickyLevel]", inputs: { level: { classPropertyName: "level", publicName: "virtualListStickyLevel", isSignal: true, isRequired: false, transformFunction: null }, maxLevels: { classPropertyName: "maxLevels", publicName: "virtualListMaxStickyLevels", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
70
46
|
{ provide: VIRTUAL_LIST_STICKY, useExisting: forwardRef(() => VirtualListStickyLevel) },
|
|
71
47
|
], ngImport: i0 });
|
|
72
48
|
}
|
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: VirtualListStickyLevel, decorators: [{
|
|
74
50
|
type: Directive,
|
|
75
51
|
args: [{
|
|
76
52
|
selector: 'virtual-list[virtualListStickyLevel]',
|
|
@@ -78,5 +54,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
|
|
|
78
54
|
{ provide: VIRTUAL_LIST_STICKY, useExisting: forwardRef(() => VirtualListStickyLevel) },
|
|
79
55
|
],
|
|
80
56
|
}]
|
|
81
|
-
}],
|
|
57
|
+
}], propDecorators: { level: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualListStickyLevel", required: false }] }], maxLevels: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualListMaxStickyLevels", required: false }] }] } });
|
|
82
58
|
//# sourceMappingURL=virtual-list-sticky-level.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-list-sticky-level.js","sourceRoot":"","sources":["../src/virtual-list-sticky-level.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"virtual-list-sticky-level.js","sourceRoot":"","sources":["../src/virtual-list-sticky-level.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO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, input } from '@angular/core';\nimport { numberOr } from './transforms.ts';\nimport { VIRTUAL_LIST_STICKY, type VirtualListSticky } from './virtual-list-sticky.ts';\n\n/**\n * Sticky rows at more than one level, on `<virtual-list>` itself: a year pinned at the leading\n * edge, its month under it and the day under that, each pushed off by the next of its own level\n * or of one further out.\n *\n * ```html\n * <virtual-list #list [items]=\"rows\" [itemHeight]=\"44\" [virtualListStickyLevel]=\"levelOf\">\n * @for (row of list.window(); track row.slot) {\n * <view [virtualListRow]=\"row\"><text>{{ row.item.label }}</text></view>\n * }\n * </virtual-list>\n * ```\n *\n * `levelOf` is given each item and its index and returns the row's level: 0 for the outermost,\n * 1 for the rows pinned under those, and so on, or `null` for a row that scrolls with the rest.\n * A row pins under the nearest row before it of each level further out than its own, and stays\n * until the next row of its own level, or of one further out, pushes it off. The rows of\n * `stickyIndices` are at level 0, so the two can be given together.\n */\n@Directive({\n selector: 'virtual-list[virtualListStickyLevel]',\n providers: [\n { provide: VIRTUAL_LIST_STICKY, useExisting: forwardRef(() => VirtualListStickyLevel) },\n ],\n})\nexport class VirtualListStickyLevel<T = unknown> implements VirtualListSticky {\n /** A row's level, from 0 for the outermost, or `null` for a row that is not sticky. */\n readonly level = input<\n ((item: T, index: number) => number | null | undefined) | null | undefined\n >(undefined, { alias: 'virtualListStickyLevel' });\n /**\n * How many levels pin at once, from the outermost. Rows deeper than that are not sticky. It\n * limits the levels the function gives: the rows of `stickyIndices` pin whatever it is.\n */\n readonly maxLevels = input(Infinity, {\n alias: 'virtualListMaxStickyLevels',\n transform: numberOr(Infinity),\n });\n\n readonly levelOf = computed(() => {\n const level = this.level();\n if (!level) return null;\n const levels = this.maxLevels();\n return (item: unknown, index: number) => {\n const at = level(item as T, index);\n return typeof at === 'number' && at >= 0 && at < levels ? Math.floor(at) : null;\n };\n });\n}\n"]}
|