@ng-native/components 0.13.0 → 0.15.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.
Files changed (41) hide show
  1. package/dist/keyboard-avoiding-view.js +3 -2
  2. package/dist/keyboard-avoiding-view.js.map +1 -1
  3. package/dist/markdown-blocks.d.ts +18 -1
  4. package/dist/markdown-blocks.js +112 -4
  5. package/dist/markdown-blocks.js.map +1 -1
  6. package/dist/markdown-columns.d.ts +24 -0
  7. package/dist/markdown-columns.js +58 -0
  8. package/dist/markdown-columns.js.map +1 -0
  9. package/dist/markdown-stream.d.ts +31 -0
  10. package/dist/markdown-stream.js +282 -0
  11. package/dist/markdown-stream.js.map +1 -0
  12. package/dist/markdown.d.ts +30 -3
  13. package/dist/markdown.js +131 -41
  14. package/dist/markdown.js.map +1 -1
  15. package/dist/modal.d.ts +8 -2
  16. package/dist/modal.js +8 -5
  17. package/dist/modal.js.map +1 -1
  18. package/dist/pressable.js +6 -6
  19. package/dist/pressable.js.map +1 -1
  20. package/dist/section-list.js +4 -4
  21. package/dist/section-list.js.map +1 -1
  22. package/dist/swipe-refresh-layout.js +1 -1
  23. package/dist/swipe-refresh-layout.js.map +1 -1
  24. package/dist/text-input.d.ts +6 -1
  25. package/dist/text-input.js +8 -2
  26. package/dist/text-input.js.map +1 -1
  27. package/dist/touchable-opacity.js +3 -2
  28. package/dist/touchable-opacity.js.map +1 -1
  29. package/dist/transforms.d.ts +6 -0
  30. package/dist/transforms.js +8 -0
  31. package/dist/transforms.js.map +1 -1
  32. package/dist/view-base.d.ts +1 -1
  33. package/dist/view-base.js +6 -4
  34. package/dist/view-base.js.map +1 -1
  35. package/dist/virtual-list.js +6 -5
  36. package/dist/virtual-list.js.map +1 -1
  37. package/dist/written-props.js +1 -0
  38. package/dist/written-props.js.map +1 -1
  39. package/dist/zero-size-warning.js +2 -2
  40. package/dist/zero-size-warning.js.map +1 -1
  41. package/package.json +3 -3
@@ -1 +1 @@
1
-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AE,uBAAuB;wBAChD,mBAAmB,EAAE,mBAAmB;wBACxC,sBAAsB,EAAE,sBAAsB;wBAC9C,qBAAqB,EAAE,qBAAqB;wBAC5C,UAAU,EAAE,wBAAwB;qBACrC;iBACF","sourcesContent":["import {\n Directive,\n type SimpleChanges,\n afterRenderEffect,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { Keyboard } from '@ng-native/device';\nimport type { NativeSyntheticEvent } from '@ng-native/fabric';\nimport { ControlledModel } from './controlled-model.ts';\nimport type { TextInputChangePayload } from './events.ts';\nimport { optionalBoolean, optionalNumber } from './transforms.ts';\nimport { ViewBase } from './view-base.ts';\n\nexport type KeyboardType =\n | 'default'\n | 'number-pad'\n | 'decimal-pad'\n | 'numeric'\n | 'email-address'\n | 'phone-pad'\n | 'url'\n | 'ascii-capable'\n | 'numbers-and-punctuation'\n | 'name-phone-pad'\n | 'twitter'\n | 'web-search'\n | 'visible-password';\nexport type ReturnKeyType =\n | 'done'\n | 'go'\n | 'next'\n | 'search'\n | 'send'\n | 'none'\n | 'previous'\n | 'default'\n | 'emergency-call'\n | 'google'\n | 'join'\n | 'route'\n | 'yahoo';\nexport type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline';\n\n/**\n * A text field, wired for signal forms. Commits as `TextInput`, single or multi line by prop.\n *\n * `value` is a `model()`, which is all `FormValueControl<string>` requires, so binding it into a\n * form is `<text-input [formField]=\"f.name\" />` with no adapter class. The rest of the contract is\n * declared too, because Signal Forms only writes to inputs of those names: `disabled` and\n * `readonly` turn `editable` off, `invalid` and `touched` come out as `data-invalid` and\n * `data-touched` for a stylesheet, and `touch` fires from the native blur - there is no DOM one\n * for the form to hear instead. `(changeText)` carries\n * the new string alone, as RN's `onChangeText` does; the raw `(change)`, `(focus)`, `(blur)`,\n * `(submitEditing)`, `(endEditing)`, `(selectionChange)`, `(keyPress)`, `(contentSizeChange)`\n * and `(scroll)` are element events typed in `events.ts`.\n *\n * The interesting part is the echo. A native text field owns state the user is actively\n * changing, so JS and native disagree constantly. RN's protocol: native reports an `eventCount`\n * with every change, JS passes the most recent one back as a prop, and native ignores a `text`\n * update whose count is stale, meaning the user has typed since. Without it, a controlled input\n * fights the cursor and drops characters under fast typing.\n *\n * The other direction is native holding text the app does not: a value set from code after the\n * user has typed, or a keystroke the app refused or rewrote. It is controlled as RN's field is -\n * bind `value` and the app's value is what the field shows - so once each pass has rendered, the\n * field compares the model with the text native last reported and sends the difference as the\n * `setTextAndSelection` command. See `ControlledModel` for how a refusal reaches the model.\n * A value set that way is also measured again, since Fabric sizes the field from native state\n * that takes the new text only after measuring it: a composer cleared after sending shrinks.\n */\n@Directive({\n selector: 'text-input',\n exportAs: 'textInput',\n host: {\n '[text]': 'value()',\n '[mostRecentEventCount]': 'eventCount()',\n '[multiline]': 'multiline()',\n '[scrollEnabled]': 'scrollEnabled()',\n '[editable]': 'resolvedEditable()',\n // `disabled` is an input of ours, so it cannot reach `ngOnChanges` on the base; this is\n // the one binding that keeps the announced state in step with it.\n '[accessibilityState]': 'accessibilityStateProp()',\n '[attr.data-disabled]': \"disabled() ? '' : null\",\n '[attr.data-invalid]': \"invalid() ? '' : null\",\n '[attr.data-touched]': \"touched() ? '' : null\",\n '(blur)': 'touch.emit()',\n '(focus)': 'onFocus()',\n '[placeholder]': 'placeholder()',\n '[placeholderTextColor]': 'placeholderTextColor()',\n '[keyboardType]': 'keyboardType()',\n '[returnKeyType]': 'returnKeyType()',\n '[submitBehavior]': 'resolvedSubmitBehavior()',\n '[secureTextEntry]': 'secureTextEntry()',\n '[autoCapitalize]': 'autoCapitalize()',\n '[autoCorrect]': 'autoCorrect()',\n '[autoFocus]': 'autoFocus()',\n '[maxLength]': 'maxLength()',\n '[numberOfLines]': 'numberOfLines()',\n '[selection]': 'selection()',\n '[selectionColor]': 'selectionColor()',\n '[selectTextOnFocus]': 'selectTextOnFocus()',\n '[caretHidden]': 'caretHidden()',\n '[contextMenuHidden]': 'contextMenuHidden()',\n '[textAlign]': 'textAlign()',\n '[allowFontScaling]': 'allowFontScaling()',\n '[maxFontSizeMultiplier]': 'maxFontSizeMultiplier()',\n '[inputAccessoryViewID]': 'inputAccessoryViewID()',\n '[clearButtonMode]': 'clearButtonMode()',\n '[clearTextOnFocus]': 'clearTextOnFocus()',\n '[enablesReturnKeyAutomatically]': 'enablesReturnKeyAutomatically()',\n '[keyboardAppearance]': 'keyboardAppearance()',\n '[passwordRules]': 'passwordRules()',\n '[spellCheck]': 'spellCheck()',\n '[smartInsertDelete]': 'smartInsertDelete()',\n '[dataDetectorTypes]': 'dataDetectorTypes()',\n '[textContentType]': 'textContentType()',\n '[autoComplete]': 'autoComplete()',\n '[underlineColorAndroid]': 'underlineColorAndroid()',\n '[cursorColor]': 'cursorColor()',\n '[selectionHandleColor]': 'selectionHandleColor()',\n '[textAlignVertical]': 'textAlignVertical()',\n '[importantForAutofill]': 'importantForAutofill()',\n '[showSoftInputOnFocus]': 'showSoftInputOnFocus()',\n '[disableFullscreenUI]': 'disableFullscreenUI()',\n '[inlineImageLeft]': 'inlineImageLeft()',\n '[inlineImagePadding]': 'inlineImagePadding()',\n '[textBreakStrategy]': 'textBreakStrategy()',\n '(change)': 'onNativeChange($event)',\n },\n})\nexport class TextInput extends ViewBase {\n readonly value = model<string>('');\n /** The new text alone, on every native change. */\n readonly changeText = output<string>();\n /** Focus left the field. What Signal Forms marks a field touched from. */\n readonly touch = output<void>();\n\n /** Refuse input and announce as disabled. Wins over `editable`. */\n readonly disabled = input(undefined, { transform: optionalBoolean });\n /** Refuse input, though still announced as enabled. Wins over `editable`. */\n readonly readonly = input(undefined, { transform: optionalBoolean });\n /** Published as `data-invalid`; nothing native reads it. */\n readonly invalid = input(false, { transform: booleanAttribute });\n /** Published as `data-touched`; nothing native reads it. */\n readonly touched = input(false, { transform: booleanAttribute });\n\n /** Allow more than one line. */\n readonly multiline = input(undefined, { transform: optionalBoolean });\n /** iOS: whether a multiline field scrolls its text; off, it grows with it instead. */\n readonly scrollEnabled = input(undefined, { transform: optionalBoolean });\n /** Set to false to make the field read-only. */\n readonly editable = input(undefined, { transform: optionalBoolean });\n /** Shown while the field is empty. */\n readonly placeholder = input<string>();\n readonly placeholderTextColor = input<string>();\n /** Which keyboard to show. */\n readonly keyboardType = input<KeyboardType>();\n /** The label on the return key. */\n readonly returnKeyType = input<ReturnKeyType>();\n /** What return does. Defaults to `blurAndSubmit` on one line and `newline` on many. */\n readonly submitBehavior = input<SubmitBehavior>();\n /** Hide what is typed, for passwords. */\n readonly secureTextEntry = input(undefined, { transform: optionalBoolean });\n /** When the keyboard capitalises. Defaults to `sentences`. */\n readonly autoCapitalize = input<'none' | 'sentences' | 'words' | 'characters'>();\n /** Auto-correct while typing. Defaults to true. */\n readonly autoCorrect = input(undefined, { transform: optionalBoolean });\n /** Focus the field as soon as it mounts. */\n readonly autoFocus = input(undefined, { transform: optionalBoolean });\n /** The most characters allowed, enforced natively so nothing flickers. */\n readonly maxLength = input(undefined, { transform: optionalNumber });\n /** Android: the height of a multiline field, in lines. */\n readonly numberOfLines = input(undefined, { transform: optionalNumber });\n /** The selected range, or the caret when `start` equals `end`. */\n readonly selection = input<{ readonly start: number; readonly end?: number }>();\n readonly selectionColor = input<string>();\n /** Select everything on focus. */\n readonly selectTextOnFocus = input(undefined, { transform: optionalBoolean });\n readonly caretHidden = input(undefined, { transform: optionalBoolean });\n /** Disable the copy, paste and share menu. */\n readonly contextMenuHidden = input(undefined, { transform: optionalBoolean });\n readonly textAlign = input<'left' | 'center' | 'right'>();\n readonly allowFontScaling = input(undefined, { transform: optionalBoolean });\n readonly maxFontSizeMultiplier = input(undefined, { transform: optionalNumber });\n /** iOS: the `nativeID` of an `<input-accessory-view>` to dock above the keyboard. */\n readonly inputAccessoryViewID = input<string>();\n /** iOS: when the clear button shows. */\n readonly clearButtonMode = input<'never' | 'while-editing' | 'unless-editing' | 'always'>();\n /** iOS: empty the field on focus. */\n readonly clearTextOnFocus = input(undefined, { transform: optionalBoolean });\n /** iOS: disable the return key while the field is empty. */\n readonly enablesReturnKeyAutomatically = input(undefined, { transform: optionalBoolean });\n /** iOS: the keyboard's colour scheme. */\n readonly keyboardAppearance = input<'default' | 'light' | 'dark'>();\n /** iOS: rules for a generated password, in Apple's Password Rules syntax. */\n readonly passwordRules = input<string>();\n /** iOS: underline misspellings. Follows `autoCorrect` by default. */\n readonly spellCheck = input(undefined, { transform: optionalBoolean });\n /** iOS: add and remove spaces around pasted and deleted words. */\n readonly smartInsertDelete = input(undefined, { transform: optionalBoolean });\n /** iOS, multiline: turn phone numbers, links and addresses into taps. */\n readonly dataDetectorTypes = input<string | readonly string[]>();\n /** iOS: what the field holds, so the system can autofill it. */\n readonly textContentType = input<string>();\n /** Android: the autofill hint. */\n readonly autoComplete = input<string>();\n /**\n * Android: the underline colour, transparent by default.\n *\n * Not a taste call. Android's `EditText` carries the platform's own underline in its background\n * drawable, so a field with a border of its own draws two: the app's box, and a grey line\n * through it that turns blue on focus. React Native's `TextInput` defaults this prop to\n * `'transparent'` for exactly that reason, and this is that default rather than a new opinion.\n * Ignored on iOS, where the native field has no such chrome.\n */\n readonly underlineColorAndroid = input<string>('transparent');\n /** Android: the caret colour. */\n readonly cursorColor = input<string>();\n /** Android: the selection handle colour. */\n readonly selectionHandleColor = input<string>();\n /** Android: where text sits in a tall field. */\n readonly textAlignVertical = input<'auto' | 'top' | 'bottom' | 'center'>();\n /** Android: whether autofill may fill this field. */\n readonly importantForAutofill = input<\n 'auto' | 'no' | 'noExcludeDescendants' | 'yes' | 'yesExcludeDescendants'\n >();\n /** Android: set to false to focus without raising the keyboard. */\n readonly showSoftInputOnFocus = input(undefined, { transform: optionalBoolean });\n /** Android: keep the field in place in landscape rather than going full screen. */\n readonly disableFullscreenUI = input(undefined, { transform: optionalBoolean });\n /** Android: a drawable resource shown at the left of the field. */\n readonly inlineImageLeft = input<string>();\n readonly inlineImagePadding = input(undefined, { transform: optionalNumber });\n /** Android: the line-breaking strategy. */\n readonly textBreakStrategy = input<'simple' | 'highQuality' | 'balanced'>();\n\n protected readonly eventCount = signal(0);\n\n protected readonly resolvedEditable = computed(() =>\n this.disabled() || this.readonly() ? false : this.editable(),\n );\n\n protected override disabledForAccessibility(): boolean | undefined {\n return this.disabled();\n }\n\n protected readonly resolvedSubmitBehavior = computed(() => {\n const explicit = this.submitBehavior();\n // A single-line field has no line to add, so `newline` collapses to the default.\n if (explicit && (this.multiline() || explicit !== 'newline')) return explicit;\n return this.multiline() ? 'newline' : 'blurAndSubmit';\n });\n\n private readonly keyboard = inject(Keyboard);\n /** What native last reported, so a value set from code can be told from an echo. */\n private lastNativeText: string | null = null;\n private readonly control = new ControlledModel(this.value, 'value');\n\n constructor() {\n super();\n // RN's layout effect, keyed as RN keys it: the value, and the count every native change\n // moves on, so a refusal that leaves the value where it was is compared all the same. After\n // render rather than as an ordinary effect, because an accepted edit only reaches the model\n // during change detection, and comparing before it has would send the old text back.\n afterRenderEffect({\n write: () => {\n const desired = this.value();\n const count = this.eventCount();\n if (this.lastNativeText === null || this.lastNativeText === desired) return;\n // The `text` prop alone may be ignored as stale, so send it as a command with the count\n // native expects.\n this.lastNativeText = desired;\n this.engine.dispatchCommand(this.node, 'setTextAndSelection', [count, desired, -1, -1]);\n // Fabric sized the field for the text it had; see `HostEngine.remeasure`.\n this.engine.remeasure(this.node);\n },\n });\n }\n\n override ngOnChanges(changes: SimpleChanges): void {\n super.ngOnChanges(changes);\n this.control.noteChanges(changes);\n }\n\n /**\n * With the keyboard already up, keep the field clear of it. UIKit scrolls a field clear as the\n * keyboard rises, not when focus moves from one field to another beneath it, which is what a\n * form's Next key does; native form screens keep the new field on screen either way.\n */\n protected onFocus(): void {\n const { height, screenY } = this.keyboard.metrics();\n if (height > 0 && screenY !== undefined)\n this.engine.reveal(this.node, { visibleBottom: screenY });\n }\n\n /** Bring the keyboard up on this field. A view command, so it reaches native directly. */\n focus(): void {\n this.engine.dispatchCommand(this.node, 'focus');\n }\n\n blur(): void {\n this.engine.dispatchCommand(this.node, 'blur');\n }\n\n /** Empty the field. */\n clear(): void {\n this.value.set('');\n }\n\n /** Move the caret, or select a range. */\n setSelection(start: number, end = start): void {\n this.engine.dispatchCommand(this.node, 'setTextAndSelection', [\n this.eventCount(),\n null,\n start,\n end,\n ]);\n }\n\n /** Whether this field currently has the keyboard. */\n isFocused(): boolean {\n return this.engine.focused === this.node;\n }\n\n protected onNativeChange(event: NativeSyntheticEvent<Partial<TextInputChangePayload>>): void {\n const native = event.nativeEvent;\n const text = native?.text ?? '';\n // Order matters, as it does in RN: the value first, the count last.\n this.lastNativeText = text;\n this.control.propose(text);\n this.eventCount.set(native?.eventCount ?? this.eventCount() + 1);\n this.changeText.emit(text);\n }\n}\n"]}
1
+ {"version":3,"file":"text-input.js","sourceRoot":"","sources":["../src/text-input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;;AAgC1C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AA8DH,MAAM,OAAO,SAAU,SAAQ,QAAQ;IAC5B,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC,CAAC;IACnC,kDAAkD;IACzC,UAAU,GAAG,MAAM,EAAU,CAAC;IACvC,0EAA0E;IACjE,KAAK,GAAG,MAAM,EAAQ,CAAC;IAEhC,mEAAmE;IAC1D,QAAQ,GAAG,KAAK,CAAC,SAAS,gFAAI,SAAS,EAAE,eAAe,GAAG,CAAC;IACrE,6EAA6E;IACpE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oB,EAAE,oBAAoB;wBAC1C,yBAAyB,EAAE,yBAAyB;wBACpD,wBAAwB,EAAE,wBAAwB;wBAClD,mBAAmB,EAAE,mBAAmB;wBACxC,oBAAoB,EAAE,oBAAoB;wBAC1C,iCAAiC,EAAE,iCAAiC;wBACpE,sBAAsB,EAAE,sBAAsB;wBAC9C,iBAAiB,EAAE,iBAAiB;wBACpC,cAAc,EAAE,cAAc;wBAC9B,qBAAqB,EAAE,qBAAqB;wBAC5C,qBAAqB,EAAE,qBAAqB;wBAC5C,mBAAmB,EAAE,mBAAmB;wBACxC,gBAAgB,EAAE,gBAAgB;wBAClC,yBAAyB,EAAE,yBAAyB;wBACpD,eAAe,EAAE,eAAe;wBAChC,wBAAwB,EAAE,wBAAwB;wBAClD,qBAAqB,EAAE,qBAAqB;wBAC5C,wBAAwB,EAAE,wBAAwB;wBAClD,wBAAwB,EAAE,wBAAwB;wBAClD,uBAAuB,EAAE,uBAAuB;wBAChD,mBAAmB,EAAE,mBAAmB;wBACxC,sBAAsB,EAAE,sBAAsB;wBAC9C,qBAAqB,EAAE,qBAAqB;wBAC5C,UAAU,EAAE,wBAAwB;qBACrC;iBACF","sourcesContent":["import {\n Directive,\n type SimpleChanges,\n afterRenderEffect,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { Keyboard } from '@ng-native/device';\nimport type { NativeSyntheticEvent } from '@ng-native/fabric';\nimport { ControlledModel } from './controlled-model.ts';\nimport type { TextInputChangePayload } from './events.ts';\nimport { optionalBoolean, optionalNumber } from './transforms.ts';\nimport { ViewBase } from './view-base.ts';\n\nexport type KeyboardType =\n | 'default'\n | 'number-pad'\n | 'decimal-pad'\n | 'numeric'\n | 'email-address'\n | 'phone-pad'\n | 'url'\n | 'ascii-capable'\n | 'numbers-and-punctuation'\n | 'name-phone-pad'\n | 'twitter'\n | 'web-search'\n | 'visible-password';\nexport type ReturnKeyType =\n | 'done'\n | 'go'\n | 'next'\n | 'search'\n | 'send'\n | 'none'\n | 'previous'\n | 'default'\n | 'emergency-call'\n | 'google'\n | 'join'\n | 'route'\n | 'yahoo';\nexport type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline';\n\n/**\n * A text field, wired for signal forms. Commits as `TextInput`, single or multi line by prop.\n *\n * `value` is a `model()`, which is all `FormValueControl<string>` requires, so binding it into a\n * form is `<text-input [formField]=\"f.name\" />` with no adapter class. The rest of the contract is\n * declared too, because Signal Forms only writes to inputs of those names: `disabled` and\n * `readonly` turn `editable` off, `invalid` and `touched` come out as `data-invalid` and\n * `data-touched` for a stylesheet, and `touch` fires from the native blur - there is no DOM one\n * for the form to hear instead. `(changeText)` carries\n * the new string alone, as RN's `onChangeText` does; the raw `(change)`, `(focus)`, `(blur)`,\n * `(submitEditing)`, `(endEditing)`, `(selectionChange)`, `(keyPress)`, `(contentSizeChange)`\n * and `(scroll)` are element events typed in `events.ts`.\n *\n * The interesting part is the echo. A native text field owns state the user is actively\n * changing, so JS and native disagree constantly. RN's protocol: native reports an `eventCount`\n * with every change, JS passes the most recent one back as a prop, and native ignores a `text`\n * update whose count is stale, meaning the user has typed since. Without it, a controlled input\n * fights the cursor and drops characters under fast typing.\n *\n * The other direction is native holding text the app does not: a value set from code after the\n * user has typed, or a keystroke the app refused or rewrote. It is controlled as RN's field is -\n * bind `value` and the app's value is what the field shows - so once each pass has rendered, the\n * field compares the model with the text native last reported and sends the difference as the\n * `setTextAndSelection` command. See `ControlledModel` for how a refusal reaches the model.\n * A value set that way is also measured again, since Fabric sizes the field from native state\n * that takes the new text only after measuring it: a composer cleared after sending shrinks.\n */\n@Directive({\n selector: 'text-input',\n exportAs: 'textInput',\n host: {\n '[text]': 'value()',\n '[mostRecentEventCount]': 'eventCount()',\n '[multiline]': 'multiline()',\n '[scrollEnabled]': 'scrollEnabled()',\n '[editable]': 'resolvedEditable()',\n // `disabled` is an input of ours, so it cannot reach `ngOnChanges` on the base; this is\n // the one binding that keeps the announced state in step with it.\n '[accessibilityState]': 'accessibilityStateProp()',\n '[attr.data-disabled]': \"disabled() ? '' : null\",\n '[attr.data-invalid]': \"invalid() ? '' : null\",\n '[attr.data-touched]': \"touched() ? '' : null\",\n '(blur)': 'touch.emit()',\n '(focus)': 'onFocus()',\n '[placeholder]': 'placeholder()',\n '[placeholderTextColor]': 'placeholderTextColor()',\n '[keyboardType]': 'keyboardType()',\n '[returnKeyType]': 'returnKeyType()',\n '[submitBehavior]': 'resolvedSubmitBehavior()',\n '[secureTextEntry]': 'secureTextEntry()',\n '[autoCapitalize]': 'autoCapitalize()',\n '[autoCorrect]': 'autoCorrect()',\n '[autoFocus]': 'autoFocus()',\n '[maxLength]': 'maxLength()',\n '[numberOfLines]': 'numberOfLines()',\n '[rows]': 'rows()',\n '[selection]': 'selection()',\n '[selectionColor]': 'selectionColor()',\n '[selectTextOnFocus]': 'selectTextOnFocus()',\n '[caretHidden]': 'caretHidden()',\n '[contextMenuHidden]': 'contextMenuHidden()',\n '[textAlign]': 'textAlign()',\n '[allowFontScaling]': 'allowFontScaling()',\n '[maxFontSizeMultiplier]': 'maxFontSizeMultiplier()',\n '[inputAccessoryViewID]': 'inputAccessoryViewID()',\n '[clearButtonMode]': 'clearButtonMode()',\n '[clearTextOnFocus]': 'clearTextOnFocus()',\n '[enablesReturnKeyAutomatically]': 'enablesReturnKeyAutomatically()',\n '[keyboardAppearance]': 'keyboardAppearance()',\n '[passwordRules]': 'passwordRules()',\n '[spellCheck]': 'spellCheck()',\n '[smartInsertDelete]': 'smartInsertDelete()',\n '[dataDetectorTypes]': 'dataDetectorTypes()',\n '[textContentType]': 'textContentType()',\n '[autoComplete]': 'autoComplete()',\n '[underlineColorAndroid]': 'underlineColorAndroid()',\n '[cursorColor]': 'cursorColor()',\n '[selectionHandleColor]': 'selectionHandleColor()',\n '[textAlignVertical]': 'textAlignVertical()',\n '[importantForAutofill]': 'importantForAutofill()',\n '[showSoftInputOnFocus]': 'showSoftInputOnFocus()',\n '[disableFullscreenUI]': 'disableFullscreenUI()',\n '[inlineImageLeft]': 'inlineImageLeft()',\n '[inlineImagePadding]': 'inlineImagePadding()',\n '[textBreakStrategy]': 'textBreakStrategy()',\n '(change)': 'onNativeChange($event)',\n },\n})\nexport class TextInput extends ViewBase {\n readonly value = model<string>('');\n /** The new text alone, on every native change. */\n readonly changeText = output<string>();\n /** Focus left the field. What Signal Forms marks a field touched from. */\n readonly touch = output<void>();\n\n /** Refuse input and announce as disabled. Wins over `editable`. */\n readonly disabled = input(undefined, { transform: optionalBoolean });\n /** Refuse input, though still announced as enabled. Wins over `editable`. */\n readonly readonly = input(undefined, { transform: optionalBoolean });\n /** Published as `data-invalid`; nothing native reads it. */\n readonly invalid = input(false, { transform: booleanAttribute });\n /** Published as `data-touched`; nothing native reads it. */\n readonly touched = input(false, { transform: booleanAttribute });\n\n /** Allow more than one line. */\n readonly multiline = input(undefined, { transform: optionalBoolean });\n /** iOS: whether a multiline field scrolls its text; off, it grows with it instead. */\n readonly scrollEnabled = input(undefined, { transform: optionalBoolean });\n /** Set to false to make the field read-only. */\n readonly editable = input(undefined, { transform: optionalBoolean });\n /** Shown while the field is empty. */\n readonly placeholder = input<string>();\n readonly placeholderTextColor = input<string>();\n /** Which keyboard to show. */\n readonly keyboardType = input<KeyboardType>();\n /** The label on the return key. */\n readonly returnKeyType = input<ReturnKeyType>();\n /** What return does. Defaults to `blurAndSubmit` on one line and `newline` on many. */\n readonly submitBehavior = input<SubmitBehavior>();\n /** Hide what is typed, for passwords. */\n readonly secureTextEntry = input(undefined, { transform: optionalBoolean });\n /** When the keyboard capitalises. Defaults to `sentences`. */\n readonly autoCapitalize = input<'none' | 'sentences' | 'words' | 'characters'>();\n /** Auto-correct while typing. Defaults to true. */\n readonly autoCorrect = input(undefined, { transform: optionalBoolean });\n /** Focus the field as soon as it mounts. */\n readonly autoFocus = input(undefined, { transform: optionalBoolean });\n /** The most characters allowed, enforced natively so nothing flickers. */\n readonly maxLength = input(undefined, { transform: optionalNumber });\n /** Android: the height of a multiline field, in lines. */\n readonly numberOfLines = input(undefined, { transform: optionalNumber });\n /**\n * How many lines of its `line-height` a multiline field is tall, where nothing sets its height,\n * as a `<textarea rows>` is. Read by the engine, which sizes the field; never sent to native.\n */\n readonly rows = input(undefined, { transform: optionalNumber });\n /** The selected range, or the caret when `start` equals `end`. */\n readonly selection = input<{ readonly start: number; readonly end?: number }>();\n readonly selectionColor = input<string>();\n /** Select everything on focus. */\n readonly selectTextOnFocus = input(undefined, { transform: optionalBoolean });\n readonly caretHidden = input(undefined, { transform: optionalBoolean });\n /** Disable the copy, paste and share menu. */\n readonly contextMenuHidden = input(undefined, { transform: optionalBoolean });\n readonly textAlign = input<'left' | 'center' | 'right'>();\n readonly allowFontScaling = input(undefined, { transform: optionalBoolean });\n readonly maxFontSizeMultiplier = input(undefined, { transform: optionalNumber });\n /** iOS: the `nativeID` of an `<input-accessory-view>` to dock above the keyboard. */\n readonly inputAccessoryViewID = input<string>();\n /** iOS: when the clear button shows. */\n readonly clearButtonMode = input<'never' | 'while-editing' | 'unless-editing' | 'always'>();\n /** iOS: empty the field on focus. */\n readonly clearTextOnFocus = input(undefined, { transform: optionalBoolean });\n /** iOS: disable the return key while the field is empty. */\n readonly enablesReturnKeyAutomatically = input(undefined, { transform: optionalBoolean });\n /** iOS: the keyboard's colour scheme. */\n readonly keyboardAppearance = input<'default' | 'light' | 'dark'>();\n /** iOS: rules for a generated password, in Apple's Password Rules syntax. */\n readonly passwordRules = input<string>();\n /** iOS: underline misspellings. Follows `autoCorrect` by default. */\n readonly spellCheck = input(undefined, { transform: optionalBoolean });\n /** iOS: add and remove spaces around pasted and deleted words. */\n readonly smartInsertDelete = input(undefined, { transform: optionalBoolean });\n /** iOS, multiline: turn phone numbers, links and addresses into taps. */\n readonly dataDetectorTypes = input<string | readonly string[]>();\n /** iOS: what the field holds, so the system can autofill it. */\n readonly textContentType = input<string>();\n /** Android: the autofill hint. */\n readonly autoComplete = input<string>();\n /**\n * Android: the underline colour, transparent by default.\n *\n * Not a taste call. Android's `EditText` carries the platform's own underline in its background\n * drawable, so a field with a border of its own draws two: the app's box, and a grey line\n * through it that turns blue on focus. React Native's `TextInput` defaults this prop to\n * `'transparent'` for exactly that reason, and this is that default rather than a new opinion.\n * Ignored on iOS, where the native field has no such chrome.\n */\n readonly underlineColorAndroid = input<string>('transparent');\n /** Android: the caret colour. */\n readonly cursorColor = input<string>();\n /** Android: the selection handle colour. */\n readonly selectionHandleColor = input<string>();\n /** Android: where text sits in a tall field. */\n readonly textAlignVertical = input<'auto' | 'top' | 'bottom' | 'center'>();\n /** Android: whether autofill may fill this field. */\n readonly importantForAutofill = input<\n 'auto' | 'no' | 'noExcludeDescendants' | 'yes' | 'yesExcludeDescendants'\n >();\n /** Android: set to false to focus without raising the keyboard. */\n readonly showSoftInputOnFocus = input(undefined, { transform: optionalBoolean });\n /** Android: keep the field in place in landscape rather than going full screen. */\n readonly disableFullscreenUI = input(undefined, { transform: optionalBoolean });\n /** Android: a drawable resource shown at the left of the field. */\n readonly inlineImageLeft = input<string>();\n readonly inlineImagePadding = input(undefined, { transform: optionalNumber });\n /** Android: the line-breaking strategy. */\n readonly textBreakStrategy = input<'simple' | 'highQuality' | 'balanced'>();\n\n protected readonly eventCount = signal(0);\n\n protected readonly resolvedEditable = computed(() =>\n this.disabled() || this.readonly() ? false : this.editable(),\n );\n\n protected override disabledForAccessibility(): boolean | undefined {\n return this.disabled();\n }\n\n protected readonly resolvedSubmitBehavior = computed(() => {\n const explicit = this.submitBehavior();\n // A single-line field has no line to add, so `newline` collapses to the default.\n if (explicit && (this.multiline() || explicit !== 'newline')) return explicit;\n return this.multiline() ? 'newline' : 'blurAndSubmit';\n });\n\n private readonly keyboard = inject(Keyboard);\n /** What native last reported, so a value set from code can be told from an echo. */\n private lastNativeText: string | null = null;\n private readonly control = new ControlledModel(this.value, 'value');\n\n constructor() {\n super();\n // RN's layout effect, keyed as RN keys it: the value, and the count every native change\n // moves on, so a refusal that leaves the value where it was is compared all the same. After\n // render rather than as an ordinary effect, because an accepted edit only reaches the model\n // during change detection, and comparing before it has would send the old text back.\n afterRenderEffect({\n write: () => {\n const desired = this.value();\n const count = this.eventCount();\n if (this.lastNativeText === null || this.lastNativeText === desired) return;\n // The `text` prop alone may be ignored as stale, so send it as a command with the count\n // native expects.\n this.lastNativeText = desired;\n this.engine.dispatchCommand(this.node, 'setTextAndSelection', [count, desired, -1, -1]);\n // Fabric sized the field for the text it had; see `HostEngine.remeasure`.\n this.engine.remeasure(this.node);\n },\n });\n }\n\n override ngOnChanges(changes: SimpleChanges): void {\n super.ngOnChanges(changes);\n this.control.noteChanges(changes);\n }\n\n /**\n * With the keyboard already up, keep the field clear of it. UIKit scrolls a field clear as the\n * keyboard rises, not when focus moves from one field to another beneath it, which is what a\n * form's Next key does; native form screens keep the new field on screen either way.\n */\n protected onFocus(): void {\n const { height, screenY } = this.keyboard.metrics();\n if (height > 0 && screenY !== undefined)\n this.engine.reveal(this.node, { visibleBottom: screenY });\n }\n\n /** Bring the keyboard up on this field. A view command, so it reaches native directly. */\n focus(): void {\n this.engine.dispatchCommand(this.node, 'focus');\n }\n\n blur(): void {\n this.engine.dispatchCommand(this.node, 'blur');\n }\n\n /** Empty the field. */\n clear(): void {\n this.value.set('');\n }\n\n /** Move the caret, or select a range. */\n setSelection(start: number, end = start): void {\n this.engine.dispatchCommand(this.node, 'setTextAndSelection', [\n this.eventCount(),\n null,\n start,\n end,\n ]);\n }\n\n /** Whether this field currently has the keyboard. */\n isFocused(): boolean {\n return this.engine.focused === this.node;\n }\n\n protected onNativeChange(event: NativeSyntheticEvent<Partial<TextInputChangePayload>>): void {\n const native = event.nativeEvent;\n const text = native?.text ?? '';\n // Order matters, as it does in RN: the value first, the count last.\n this.lastNativeText = text;\n this.control.propose(text);\n this.eventCount.set(native?.eventCount ?? this.eventCount() + 1);\n this.changeText.emit(text);\n }\n}\n"]}
@@ -1,5 +1,6 @@
1
- import { Component, DestroyRef, effect, inject, input, numberAttribute, signal, untracked, } from '@angular/core';
1
+ import { Component, DestroyRef, effect, inject, input, signal, untracked } from '@angular/core';
2
2
  import { ControlBase } from "./pressable.js";
3
+ import { numberOr } from "./transforms.js";
3
4
  import * as i0 from "@angular/core";
4
5
  /**
5
6
  * A pressable that dims while pressed, as RN's `TouchableOpacity` does.
@@ -29,7 +30,7 @@ export class TouchableOpacity extends ControlBase {
29
30
  return this.disabledByAnyState();
30
31
  }
31
32
  /** The opacity while pressed. */
32
- activeOpacity = input(0.2, { ...(ngDevMode ? { debugName: "activeOpacity" } : /* istanbul ignore next */ {}), transform: numberAttribute });
33
+ activeOpacity = input(0.2, { ...(ngDevMode ? { debugName: "activeOpacity" } : /* istanbul ignore next */ {}), transform: numberOr(0.2) });
33
34
  /** Undefined at rest, so the caller's own `[style]` opacity shows through. */
34
35
  opacity = signal(undefined, /* @ts-ignore */
35
36
  ...(ngDevMode ? [{ debugName: "opacity" }] : /* istanbul ignore next */ []));
@@ -1 +1 @@
1
- {"version":3,"file":"touchable-opacity.js","sourceRoot":"","sources":["../src/touchable-opacity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,MAAM,EACN,MAAM,EACN,KAAK,EACL,eAAe,EACf,MAAM,EACN,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;;AAE7C;;;;;;;;;;;;GAYG;AA0BH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C,gGAAgG;IAC7E,mBAAmB;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAEkB,kBAAkB;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAEkB,wBAAwB;QACzC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;IAEkB,aAAa;QAC9B,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC;IACnC,CAAC;IAED,iCAAiC;IACxB,aAAa,GAAG,KAAK,CAAC,GAAG,qFAAI,S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,YAChB,kBAAkB,QAgBtB;wBACJ,iBAAiB,EAAE,WAAW;wBAC9B,iBAAiB,EAAE,WAAW;wBAC9B,iBAAiB,EAAE,UAAU;qBAC9B","sourcesContent":["import {\n Component,\n DestroyRef,\n effect,\n inject,\n input,\n numberAttribute,\n signal,\n untracked,\n} from '@angular/core';\nimport { ControlBase } from './pressable.ts';\n\n/**\n * A pressable that dims while pressed, as RN's `TouchableOpacity` does.\n *\n * The fade is a CSS transition rather than a JavaScript tween: the component sets the target\n * opacity and the engine eases to it. React Native's own timings are asymmetric - 150ms in,\n * 250ms out - which is a thing CSS expresses exactly, because the duration in force is the one on\n * the state being entered. That is what the two rules below are.\n *\n * The opacity is a binding rather than a rule because `activeOpacity` is an input, and it returns\n * to `undefined` when the fade finishes so a caller's own `[style]` opacity is in charge again at\n * rest. `transitionend` is the engine's own event, the same one Angular's `animate.leave` waits\n * for.\n */\n@Component({\n selector: 'touchable-opacity',\n template: `<ng-content />`,\n exportAs: 'touchableOpacity',\n styles: `\n /*\n * The resting opacity is stated rather than left out, because a transition needs a value to\n * ease *from*: a property appearing for the first time is recorded and left alone, which is\n * CSS's own rule and would make every fade in a snap. Inline style still wins over this, so a\n * caller's own opacity is untouched.\n */\n :host {\n opacity: 1;\n transition: opacity 250ms ease-in-out;\n }\n :host(.pressed) {\n transition: opacity 150ms ease-in-out;\n }\n `,\n host: {\n '[style.opacity]': 'opacity()',\n '[class.pressed]': 'pressed()',\n '(transitionend)': 'settle()',\n },\n})\nexport class TouchableOpacity extends ControlBase {\n /** `TouchableOpacity.js`: `accessible={this.props.accessible !== false}`, and focusable too. */\n protected override accessibleByDefault(): boolean {\n return true;\n }\n\n protected override focusableByDefault(): boolean {\n return true;\n }\n\n protected override disabledForAccessibility(): boolean | undefined {\n return this.disabled();\n }\n\n protected override pressDisabled(): boolean {\n return this.disabledByAnyState();\n }\n\n /** The opacity while pressed. */\n readonly activeOpacity = input(0.2, { transform: numberAttribute });\n\n /** Undefined at rest, so the caller's own `[style]` opacity shows through. */\n protected readonly opacity = signal<number | undefined>(undefined);\n\n /** What to ease back to: whatever the caller had before the press. */\n private resting = 1;\n\n constructor() {\n super();\n // Reacts to `pressed` alone. Reading `opacity` here would re-run the effect on the value it\n // just wrote, and a press that arrives mid-fade would restart from the wrong end.\n effect(() => {\n const pressed = this.pressed();\n untracked(() => {\n if (pressed) {\n // Remembered on the way in, so the fade out returns to it rather than to 1.\n const style = this.node.props['style'] as { opacity?: number } | undefined;\n this.resting = this.opacity() ?? style?.opacity ?? 1;\n this.opacity.set(this.activeOpacity());\n } else if (this.opacity() !== undefined) {\n this.opacity.set(this.resting);\n }\n });\n });\n // A component destroyed mid-fade leaves a transition the engine would go on advancing.\n inject(DestroyRef).onDestroy(() => this.opacity.set(undefined));\n }\n\n /**\n * The fade is over. Letting go of the value hands the opacity back to whatever the caller's own\n * style says, which is the same number we just eased to - so nothing moves, and a caller who\n * changes it later is not fighting a binding of ours.\n */\n protected settle(): void {\n if (!this.pressed()) this.opacity.set(undefined);\n }\n}\n"]}
1
+ {"version":3,"file":"touchable-opacity.js","sourceRoot":"","sources":["../src/touchable-opacity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;;AAE3C;;;;;;;;;;;;GAYG;AA0BH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C,gGAAgG;IAC7E,mBAAmB;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAEkB,kBAAkB;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAEkB,wBAAwB;QACzC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;IAEkB,aAAa;QAC9B,OAAO,IAAI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C;uGAvDU,gBAAgB;2FAAhB,gBAAgB,kaAvBjB,gBAAgB;;2FAuBf,gBAAgB;kBAzB5B,SAAS;+BACE,mBAAmB,YACnB,gBAAgB,YAChB,kBAAkB,QAgBtB;wBACJ,iBAAiB,EAAE,WAAW;wBAC9B,iBAAiB,EAAE,WAAW;wBAC9B,iBAAiB,EAAE,UAAU;qBAC9B","sourcesContent":["import { Component, DestroyRef, effect, inject, input, signal, untracked } from '@angular/core';\nimport { ControlBase } from './pressable.ts';\nimport { numberOr } from './transforms.ts';\n\n/**\n * A pressable that dims while pressed, as RN's `TouchableOpacity` does.\n *\n * The fade is a CSS transition rather than a JavaScript tween: the component sets the target\n * opacity and the engine eases to it. React Native's own timings are asymmetric - 150ms in,\n * 250ms out - which is a thing CSS expresses exactly, because the duration in force is the one on\n * the state being entered. That is what the two rules below are.\n *\n * The opacity is a binding rather than a rule because `activeOpacity` is an input, and it returns\n * to `undefined` when the fade finishes so a caller's own `[style]` opacity is in charge again at\n * rest. `transitionend` is the engine's own event, the same one Angular's `animate.leave` waits\n * for.\n */\n@Component({\n selector: 'touchable-opacity',\n template: `<ng-content />`,\n exportAs: 'touchableOpacity',\n styles: `\n /*\n * The resting opacity is stated rather than left out, because a transition needs a value to\n * ease *from*: a property appearing for the first time is recorded and left alone, which is\n * CSS's own rule and would make every fade in a snap. Inline style still wins over this, so a\n * caller's own opacity is untouched.\n */\n :host {\n opacity: 1;\n transition: opacity 250ms ease-in-out;\n }\n :host(.pressed) {\n transition: opacity 150ms ease-in-out;\n }\n `,\n host: {\n '[style.opacity]': 'opacity()',\n '[class.pressed]': 'pressed()',\n '(transitionend)': 'settle()',\n },\n})\nexport class TouchableOpacity extends ControlBase {\n /** `TouchableOpacity.js`: `accessible={this.props.accessible !== false}`, and focusable too. */\n protected override accessibleByDefault(): boolean {\n return true;\n }\n\n protected override focusableByDefault(): boolean {\n return true;\n }\n\n protected override disabledForAccessibility(): boolean | undefined {\n return this.disabled();\n }\n\n protected override pressDisabled(): boolean {\n return this.disabledByAnyState();\n }\n\n /** The opacity while pressed. */\n readonly activeOpacity = input(0.2, { transform: numberOr(0.2) });\n\n /** Undefined at rest, so the caller's own `[style]` opacity shows through. */\n protected readonly opacity = signal<number | undefined>(undefined);\n\n /** What to ease back to: whatever the caller had before the press. */\n private resting = 1;\n\n constructor() {\n super();\n // Reacts to `pressed` alone. Reading `opacity` here would re-run the effect on the value it\n // just wrote, and a press that arrives mid-fade would restart from the wrong end.\n effect(() => {\n const pressed = this.pressed();\n untracked(() => {\n if (pressed) {\n // Remembered on the way in, so the fade out returns to it rather than to 1.\n const style = this.node.props['style'] as { opacity?: number } | undefined;\n this.resting = this.opacity() ?? style?.opacity ?? 1;\n this.opacity.set(this.activeOpacity());\n } else if (this.opacity() !== undefined) {\n this.opacity.set(this.resting);\n }\n });\n });\n // A component destroyed mid-fade leaves a transition the engine would go on advancing.\n inject(DestroyRef).onDestroy(() => this.opacity.set(undefined));\n }\n\n /**\n * The fade is over. Letting go of the value hands the opacity back to whatever the caller's own\n * style says, which is the same number we just eased to - so nothing moves, and a caller who\n * changes it later is not fighting a binding of ours.\n */\n protected settle(): void {\n if (!this.pressed()) this.opacity.set(undefined);\n }\n}\n"]}
@@ -1,2 +1,8 @@
1
1
  export declare function optionalBoolean(value: unknown): boolean | undefined;
2
2
  export declare function optionalNumber(value: unknown): number | undefined;
3
+ /**
4
+ * The transform for a number input with a default: `[delayLongPress]="undefined"` is the default,
5
+ * as a prop left out is, where `numberAttribute` alone makes it `NaN`. So is anything else that
6
+ * is not a number.
7
+ */
8
+ export declare function numberOr(fallback: number): (value: unknown) => number;
@@ -14,4 +14,12 @@ export function optionalBoolean(value) {
14
14
  export function optionalNumber(value) {
15
15
  return value === undefined ? undefined : numberAttribute(value);
16
16
  }
17
+ /**
18
+ * The transform for a number input with a default: `[delayLongPress]="undefined"` is the default,
19
+ * as a prop left out is, where `numberAttribute` alone makes it `NaN`. So is anything else that
20
+ * is not a number.
21
+ */
22
+ export function numberOr(fallback) {
23
+ return (value) => numberAttribute(value, fallback);
24
+ }
17
25
  //# sourceMappingURL=transforms.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transforms.js","sourceRoot":"","sources":["../src/transforms.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAElE,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AAClE,CAAC","sourcesContent":["/**\n * Input transforms for props that native reads as \"set\" or \"not set\".\n *\n * Angular's own `booleanAttribute` turns an absent input into `false`, which is right for a DOM\n * attribute and wrong for a native prop: `accessible` unset means \"the platform decides\", and\n * sending `false` for every boolean a view never mentioned would put a dozen props on every\n * node. These keep `undefined` as undefined and otherwise behave as Angular's do, so `<view\n * collapsable=\"false\">` and `<view [collapsable]=\"false\">` both mean false.\n */\nimport { booleanAttribute, numberAttribute } from '@angular/core';\n\nexport function optionalBoolean(value: unknown): boolean | undefined {\n return value === undefined ? undefined : booleanAttribute(value);\n}\n\nexport function optionalNumber(value: unknown): number | undefined {\n return value === undefined ? undefined : numberAttribute(value);\n}\n"]}
1
+ {"version":3,"file":"transforms.js","sourceRoot":"","sources":["../src/transforms.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAElE,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AAClE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,QAAgB;IACvC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACrD,CAAC","sourcesContent":["/**\n * Input transforms for props that native reads as \"set\" or \"not set\".\n *\n * Angular's own `booleanAttribute` turns an absent input into `false`, which is right for a DOM\n * attribute and wrong for a native prop: `accessible` unset means \"the platform decides\", and\n * sending `false` for every boolean a view never mentioned would put a dozen props on every\n * node. These keep `undefined` as undefined and otherwise behave as Angular's do, so `<view\n * collapsable=\"false\">` and `<view [collapsable]=\"false\">` both mean false.\n */\nimport { booleanAttribute, numberAttribute } from '@angular/core';\n\nexport function optionalBoolean(value: unknown): boolean | undefined {\n return value === undefined ? undefined : booleanAttribute(value);\n}\n\nexport function optionalNumber(value: unknown): number | undefined {\n return value === undefined ? undefined : numberAttribute(value);\n}\n\n/**\n * The transform for a number input with a default: `[delayLongPress]=\"undefined\"` is the default,\n * as a prop left out is, where `numberAttribute` alone makes it `NaN`. So is anything else that\n * is not a number.\n */\nexport function numberOr(fallback: number): (value: unknown) => number {\n return (value) => numberAttribute(value, fallback);\n}\n"]}
@@ -140,7 +140,7 @@ export declare abstract class ViewBase {
140
140
  /** `aria-busy`. */
141
141
  readonly ariaBusy: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
142
142
  /** `aria-checked`. */
143
- readonly ariaChecked: import("@angular/core").InputSignal<boolean | "mixed" | undefined>;
143
+ readonly ariaChecked: import("@angular/core").InputSignalWithTransform<boolean | "mixed" | undefined, unknown>;
144
144
  /** `aria-disabled`. */
145
145
  readonly ariaDisabled: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
146
146
  /** `aria-expanded`. */
package/dist/view-base.js CHANGED
@@ -96,10 +96,10 @@ function declareProps(ctor, node) {
96
96
  declared.add(ctor);
97
97
  const def = ctor.ɵcmp ??
98
98
  ctor.ɵdir;
99
- const name = node.name;
100
- if (!name || !def?.inputs)
99
+ const tag = node.tag;
100
+ if (!tag || !def?.inputs)
101
101
  return;
102
- declareNativeProps(name, [...Object.keys(def.inputs), ...WRITTEN_PROPS]);
102
+ declareNativeProps(tag, [...Object.keys(def.inputs), ...WRITTEN_PROPS]);
103
103
  }
104
104
  function stripConsumedAttributes(ctor, node) {
105
105
  const { ɵcmp, ɵdir } = ctor;
@@ -209,7 +209,9 @@ export class ViewBase {
209
209
  /** `aria-busy`. */
210
210
  ariaBusy = input(undefined, { ...(ngDevMode ? { debugName: "ariaBusy" } : /* istanbul ignore next */ {}), alias: 'aria-busy', transform: optionalBoolean });
211
211
  /** `aria-checked`. */
212
- ariaChecked = input(undefined, { ...(ngDevMode ? { debugName: "ariaChecked" } : /* istanbul ignore next */ {}), alias: 'aria-checked' });
212
+ ariaChecked = input(undefined, { ...(ngDevMode ? { debugName: "ariaChecked" } : /* istanbul ignore next */ {}), alias: 'aria-checked',
213
+ // Written as an attribute it is text, and native takes a boolean or `mixed`.
214
+ transform: (value) => (value === 'mixed' ? 'mixed' : optionalBoolean(value)) });
213
215
  /** `aria-disabled`. */
214
216
  ariaDisabled = input(undefined, { ...(ngDevMode ? { debugName: "ariaDisabled" } : /* istanbul ignore next */ {}), alias: 'aria-disabled',
215
217
  transform: optionalBoolean });
@@ -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,UAAU,EAAE,SAAS,EAAE,kBAAk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AQ,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 { HostEngine, claimHost, 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/**\n * Angular writes a static attribute to the element as well as feeding it to the input of the\n * same name, so `<switch thumbColor=\"#fff\">` leaves a stray `thumbColor` prop on the node next to\n * the `thumbTintColor` the input produces. The inputs of the directive are what consumed them,\n * so those names come off the node; a host binding puts back any that native does read.\n *\n * Walking the *node's* props rather than the directive's inputs is not a detail. This runs for\n * every element on screen, a primitive declares some forty-five inputs, and at this point the node\n * usually has no props at all - bindings have not run yet, so only static attributes are there.\n * The other way round it was forty-five `delete`s per element on an object that had none of them,\n * which is both wasted work and the way to push an object into dictionary mode.\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 def =\n (ctor as { ɵcmp?: { inputs?: object }; ɵdir?: { inputs?: object } }).ɵcmp ??\n (ctor as { ɵdir?: { inputs?: object } }).ɵdir;\n const name = (node as { name?: string }).name;\n if (!name || !def?.inputs) return;\n declareNativeProps(name, [...Object.keys(def.inputs), ...WRITTEN_PROPS]);\n}\n\nfunction stripConsumedAttributes(ctor: unknown, node: HostNode): void {\n // A directive with no selector is only ever a `hostDirectives` entry, which exposes the inputs\n // it lists and no others, so an attribute of the same name as the rest was not consumed.\n type Def = { inputs?: Record<string, unknown>; selectors?: readonly unknown[] };\n const { ɵcmp, ɵdir } = ctor as { ɵcmp?: Def; ɵdir?: Def };\n const def = ɵcmp ?? (ɵdir?.selectors?.length ? ɵdir : undefined);\n const inputs = def?.inputs;\n if (!inputs) return;\n // A host that has not put a bag on the node yet has no attributes to take off it. Read\n // unconditionally, this threw `Cannot convert undefined or null to object` on the first\n // component a browser host ever mounted, before anything rendered - which is a hard crash\n // standing between this package and a second platform, for a loop with nothing to do.\n const props = node.props as Record<string, unknown> | undefined;\n if (!props) return;\n for (const name of Object.keys(props)) {\n if (name in inputs) delete props[name];\n }\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.host ?? 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 claimHost(this.node);\n stripConsumedAttributes(this.constructor, this.node);\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, { alias: 'aria-checked' });\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 /** Custom actions a screen reader can invoke; each arrives as `(accessibilityAction)`. */\n readonly accessibilityActions = input<readonly AccessibilityAction[]>();\n /** Android: announce changes to this view's content without focus moving to it. */\n readonly accessibilityLiveRegion = input<AccessibilityLiveRegion>();\n /** `aria-live`. */\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.writeVisibility();\n this.publishAriaState(write);\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,UAAU,EAAE,SAAS,EAAE,kBAAkB,EAAiB,MAAM,mBAAmB,CAAC;AAE7F,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;;AAyEnD;;;GAGG;A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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 { HostEngine, claimHost, 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/**\n * Angular writes a static attribute to the element as well as feeding it to the input of the\n * same name, so `<switch thumbColor=\"#fff\">` leaves a stray `thumbColor` prop on the node next to\n * the `thumbTintColor` the input produces. The inputs of the directive are what consumed them,\n * so those names come off the node; a host binding puts back any that native does read.\n *\n * Walking the *node's* props rather than the directive's inputs is not a detail. This runs for\n * every element on screen, a primitive declares some forty-five inputs, and at this point the node\n * usually has no props at all - bindings have not run yet, so only static attributes are there.\n * The other way round it was forty-five `delete`s per element on an object that had none of them,\n * which is both wasted work and the way to push an object into dictionary mode.\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 def =\n (ctor as { ɵcmp?: { inputs?: object }; ɵdir?: { inputs?: object } }).ɵcmp ??\n (ctor as { ɵdir?: { inputs?: object } }).ɵdir;\n const tag = (node as { tag?: string }).tag;\n if (!tag || !def?.inputs) return;\n declareNativeProps(tag, [...Object.keys(def.inputs), ...WRITTEN_PROPS]);\n}\n\nfunction stripConsumedAttributes(ctor: unknown, node: HostNode): void {\n // A directive with no selector is only ever a `hostDirectives` entry, which exposes the inputs\n // it lists and no others, so an attribute of the same name as the rest was not consumed.\n type Def = { inputs?: Record<string, unknown>; selectors?: readonly unknown[] };\n const { ɵcmp, ɵdir } = ctor as { ɵcmp?: Def; ɵdir?: Def };\n const def = ɵcmp ?? (ɵdir?.selectors?.length ? ɵdir : undefined);\n const inputs = def?.inputs;\n if (!inputs) return;\n // A host that has not put a bag on the node yet has no attributes to take off it. Read\n // unconditionally, this threw `Cannot convert undefined or null to object` on the first\n // component a browser host ever mounted, before anything rendered - which is a hard crash\n // standing between this package and a second platform, for a loop with nothing to do.\n const props = node.props as Record<string, unknown> | undefined;\n if (!props) return;\n for (const name of Object.keys(props)) {\n if (name in inputs) delete props[name];\n }\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.host ?? 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 claimHost(this.node);\n stripConsumedAttributes(this.constructor, this.node);\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 /** Custom actions a screen reader can invoke; each arrives as `(accessibilityAction)`. */\n readonly accessibilityActions = input<readonly AccessibilityAction[]>();\n /** Android: announce changes to this view's content without focus moving to it. */\n readonly accessibilityLiveRegion = input<AccessibilityLiveRegion>();\n /** `aria-live`. */\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.writeVisibility();\n this.publishAriaState(write);\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,4 +1,4 @@
1
- import { Component, DestroyRef, Directive, ElementRef, TemplateRef, afterEveryRender, booleanAttribute, computed, contentChild, effect, inject, input, linkedSignal, numberAttribute, output, signal, untracked, viewChild, } from '@angular/core';
1
+ import { Component, DestroyRef, Directive, ElementRef, TemplateRef, afterEveryRender, booleanAttribute, computed, contentChild, effect, inject, input, linkedSignal, output, signal, untracked, viewChild, } from '@angular/core';
2
2
  import { nativePlatform, pinnedRange, } from '@ng-native/fabric';
3
3
  import { HeightIndex } from "./height-index.js";
4
4
  import { dismissKeyboardOnTap } from "./keyboard-taps.js";
@@ -8,6 +8,7 @@ import { TemplateSlot } from "./template-slot.js";
8
8
  import { ZeroSizeWarning, checksZeroSize, written } from "./zero-size-warning.js";
9
9
  import { View } from "./view.js";
10
10
  import { ScrollViewProps } from "./scroll-view-props.js";
11
+ import { numberOr } from "./transforms.js";
11
12
  import * as i0 from "@angular/core";
12
13
  /**
13
14
  * Marks the template drawn between two rows: `<ng-template virtualListSeparator let-leading>`.
@@ -133,7 +134,7 @@ export class VirtualList extends ScrollViewProps {
133
134
  contentPadding = input(0, /* @ts-ignore */
134
135
  ...(ngDevMode ? [{ debugName: "contentPadding" }] : /* istanbul ignore next */ []));
135
136
  /** Space between one row and the next, along the axis: not before the first or after the last. */
136
- rowGap = input(0, { ...(ngDevMode ? { debugName: "rowGap" } : /* istanbul ignore next */ {}), transform: numberAttribute });
137
+ rowGap = input(0, { ...(ngDevMode ? { debugName: "rowGap" } : /* istanbul ignore next */ {}), transform: numberOr(0) });
137
138
  /**
138
139
  * An item's identity, as FlatList's `keyExtractor`: what a measured height, a slot and a held
139
140
  * position follow across an insert. Without it an item is its own key, which is enough for items
@@ -153,9 +154,9 @@ export class VirtualList extends ScrollViewProps {
153
154
  maintainVisibleContentPosition = input(/* @ts-ignore */
154
155
  ...(ngDevMode ? [undefined, { debugName: "maintainVisibleContentPosition" }] : /* istanbul ignore next */ []));
155
156
  /** Rows rendered beyond each edge of the viewport, to cover fling gaps. */
156
- overscan = input(4, { ...(ngDevMode ? { debugName: "overscan" } : /* istanbul ignore next */ {}), transform: numberAttribute });
157
+ overscan = input(4, { ...(ngDevMode ? { debugName: "overscan" } : /* istanbul ignore next */ {}), transform: numberOr(4) });
157
158
  /** How close to the end, in viewport heights, `(endReached)` fires. RN's default is 2. */
158
- endReachedThreshold = input(2, { ...(ngDevMode ? { debugName: "endReachedThreshold" } : /* istanbul ignore next */ {}), transform: numberAttribute });
159
+ endReachedThreshold = input(2, { ...(ngDevMode ? { debugName: "endReachedThreshold" } : /* istanbul ignore next */ {}), transform: numberOr(2) });
159
160
  /** Lay the rows out along x instead of y, and scroll that way. */
160
161
  horizontal = input(false, { ...(ngDevMode ? { debugName: "horizontal" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
161
162
  /** Start at the end and scroll backwards, with every row flipped back the right way up. */
@@ -172,7 +173,7 @@ export class VirtualList extends ScrollViewProps {
172
173
  keyboardShouldPersistTaps = input('never', /* @ts-ignore */
173
174
  ...(ngDevMode ? [{ debugName: "keyboardShouldPersistTaps" }] : /* istanbul ignore next */ []));
174
175
  /** How much of a row must be on screen to count as viewable. RN's default is 0, meaning any. */
175
- itemVisiblePercentThreshold = input(0, { ...(ngDevMode ? { debugName: "itemVisiblePercentThreshold" } : /* istanbul ignore next */ {}), transform: numberAttribute });
176
+ itemVisiblePercentThreshold = input(0, { ...(ngDevMode ? { debugName: "itemVisiblePercentThreshold" } : /* istanbul ignore next */ {}), transform: numberOr(0) });
176
177
  /**
177
178
  * The scroll position is within `endReachedThreshold` of the end: once per item count, and again
178
179
  * after the list has scrolled away from the end and come back.