@symbiote-native/angular 0.6.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +3 -3
  2. package/bin/symbiote-angular-dev.cjs +20 -19
  3. package/build/angular/anchor-host-registry.js +2 -2
  4. package/build/angular/anchor-host-registry.js.map +1 -1
  5. package/build/angular/bootstrap.js +1 -1
  6. package/build/angular/bootstrap.js.map +1 -1
  7. package/build/angular/components/activity-indicator/index.android.d.ts +2 -1
  8. package/build/angular/components/activity-indicator/index.android.js +12 -4
  9. package/build/angular/components/activity-indicator/index.android.js.map +1 -1
  10. package/build/angular/components/activity-indicator/index.ios.d.ts +2 -1
  11. package/build/angular/components/activity-indicator/index.ios.js +8 -3
  12. package/build/angular/components/activity-indicator/index.ios.js.map +1 -1
  13. package/build/angular/components/activity-indicator/shared.d.ts +1 -1
  14. package/build/angular/components/activity-indicator/shared.js +4 -4
  15. package/build/angular/components/activity-indicator/shared.js.map +1 -1
  16. package/build/angular/components/button.d.ts +4 -2
  17. package/build/angular/components/button.js +41 -22
  18. package/build/angular/components/button.js.map +1 -1
  19. package/build/angular/components/flat-list/index.d.ts +6 -4
  20. package/build/angular/components/flat-list/index.js +80 -50
  21. package/build/angular/components/flat-list/index.js.map +1 -1
  22. package/build/angular/components/image/index.android.d.ts +8 -3
  23. package/build/angular/components/image/index.android.js +42 -10
  24. package/build/angular/components/image/index.android.js.map +1 -1
  25. package/build/angular/components/image/index.ios.d.ts +8 -3
  26. package/build/angular/components/image/index.ios.js +42 -10
  27. package/build/angular/components/image/index.ios.js.map +1 -1
  28. package/build/angular/components/image/shared.d.ts +4 -1
  29. package/build/angular/components/image/shared.js +51 -8
  30. package/build/angular/components/image/shared.js.map +1 -1
  31. package/build/angular/components/image-background.d.ts +2 -1
  32. package/build/angular/components/image-background.js +26 -10
  33. package/build/angular/components/image-background.js.map +1 -1
  34. package/build/angular/components/input-accessory-view/index.d.ts +9 -4
  35. package/build/angular/components/input-accessory-view/index.js +49 -10
  36. package/build/angular/components/input-accessory-view/index.js.map +1 -1
  37. package/build/angular/components/keyboard-avoiding-view/index.d.ts +3 -1
  38. package/build/angular/components/keyboard-avoiding-view/index.js +44 -12
  39. package/build/angular/components/keyboard-avoiding-view/index.js.map +1 -1
  40. package/build/angular/components/modal/index.d.ts +11 -8
  41. package/build/angular/components/modal/index.js +51 -29
  42. package/build/angular/components/modal/index.js.map +1 -1
  43. package/build/angular/components/pressable/index.d.ts +12 -6
  44. package/build/angular/components/pressable/index.js +66 -13
  45. package/build/angular/components/pressable/index.js.map +1 -1
  46. package/build/angular/components/refresh-control/index.d.ts +8 -4
  47. package/build/angular/components/refresh-control/index.js +54 -16
  48. package/build/angular/components/refresh-control/index.js.map +1 -1
  49. package/build/angular/components/safe-area-view/index.d.ts +9 -4
  50. package/build/angular/components/safe-area-view/index.js +48 -9
  51. package/build/angular/components/safe-area-view/index.js.map +1 -1
  52. package/build/angular/components/scroll-view/index.android.d.ts +2 -3
  53. package/build/angular/components/scroll-view/index.android.js +88 -61
  54. package/build/angular/components/scroll-view/index.android.js.map +1 -1
  55. package/build/angular/components/scroll-view/index.ios.d.ts +2 -3
  56. package/build/angular/components/scroll-view/index.ios.js +24 -18
  57. package/build/angular/components/scroll-view/index.ios.js.map +1 -1
  58. package/build/angular/components/scroll-view/projection.d.ts +35 -0
  59. package/build/angular/components/scroll-view/projection.js +279 -53
  60. package/build/angular/components/scroll-view/projection.js.map +1 -1
  61. package/build/angular/components/scroll-view/shared.d.ts +14 -5
  62. package/build/angular/components/scroll-view/shared.js +225 -75
  63. package/build/angular/components/scroll-view/shared.js.map +1 -1
  64. package/build/angular/components/scroll-view/sticky-header.js +21 -22
  65. package/build/angular/components/scroll-view/sticky-header.js.map +1 -1
  66. package/build/angular/components/section-list/index.d.ts +7 -1
  67. package/build/angular/components/section-list/index.js +91 -54
  68. package/build/angular/components/section-list/index.js.map +1 -1
  69. package/build/angular/components/switch/index.android.d.ts +7 -3
  70. package/build/angular/components/switch/index.android.js +52 -10
  71. package/build/angular/components/switch/index.android.js.map +1 -1
  72. package/build/angular/components/switch/index.ios.d.ts +7 -3
  73. package/build/angular/components/switch/index.ios.js +52 -10
  74. package/build/angular/components/switch/index.ios.js.map +1 -1
  75. package/build/angular/components/switch/shared.d.ts +13 -4
  76. package/build/angular/components/switch/shared.js +71 -7
  77. package/build/angular/components/switch/shared.js.map +1 -1
  78. package/build/angular/components/text-input.d.ts +11 -3
  79. package/build/angular/components/text-input.js +68 -8
  80. package/build/angular/components/text-input.js.map +1 -1
  81. package/build/angular/components/touchable/index.d.ts +40 -9
  82. package/build/angular/components/touchable/index.js +303 -67
  83. package/build/angular/components/touchable/index.js.map +1 -1
  84. package/build/angular/components/touchable-native-feedback/index.d.ts +6 -3
  85. package/build/angular/components/touchable-native-feedback/index.js +63 -27
  86. package/build/angular/components/touchable-native-feedback/index.js.map +1 -1
  87. package/build/angular/components/virtualized-list/directives.js +22 -18
  88. package/build/angular/components/virtualized-list/directives.js.map +1 -1
  89. package/build/angular/components/virtualized-list/index.d.ts +15 -4
  90. package/build/angular/components/virtualized-list/index.js +326 -94
  91. package/build/angular/components/virtualized-list/index.js.map +1 -1
  92. package/build/angular/components/virtualized-section-list/directives.js +12 -12
  93. package/build/angular/components/virtualized-section-list/directives.js.map +1 -1
  94. package/build/angular/components/virtualized-section-list/index.d.ts +19 -1
  95. package/build/angular/components/virtualized-section-list/index.js +93 -22
  96. package/build/angular/components/virtualized-section-list/index.js.map +1 -1
  97. package/build/angular/components.d.ts +2 -2
  98. package/build/angular/components.js +5 -0
  99. package/build/angular/components.js.map +1 -1
  100. package/build/angular/create-portal/index.js +34 -36
  101. package/build/angular/create-portal/index.js.map +1 -1
  102. package/build/angular/create-tunnel/index.js +19 -22
  103. package/build/angular/create-tunnel/index.js.map +1 -1
  104. package/build/angular/descriptor-to-angular/index.js +6 -4
  105. package/build/angular/descriptor-to-angular/index.js.map +1 -1
  106. package/build/angular/diagnostics.d.ts +33 -0
  107. package/build/angular/diagnostics.js +82 -0
  108. package/build/angular/diagnostics.js.map +1 -0
  109. package/build/angular/host-instance/index.js +1 -1
  110. package/build/angular/host-instance/index.js.map +1 -1
  111. package/build/angular/index.d.ts +9 -4
  112. package/build/angular/index.js +17 -3
  113. package/build/angular/index.js.map +1 -1
  114. package/build/angular/modules/animated/animated-leaf-binder.d.ts +1 -7
  115. package/build/angular/modules/animated/animated-leaf-binder.js +22 -72
  116. package/build/angular/modules/animated/animated-leaf-binder.js.map +1 -1
  117. package/build/angular/modules/animated/create-animated-component.d.ts +11 -6
  118. package/build/angular/modules/animated/create-animated-component.js +106 -55
  119. package/build/angular/modules/animated/create-animated-component.js.map +1 -1
  120. package/build/angular/modules/status-bar/index.js +4 -4
  121. package/build/angular/modules/status-bar/index.js.map +1 -1
  122. package/build/angular/primitives/index.d.ts +20 -3
  123. package/build/angular/primitives/index.js +84 -48
  124. package/build/angular/primitives/index.js.map +1 -1
  125. package/build/angular/primitives/shared.d.ts +48 -2
  126. package/build/angular/primitives/shared.js +158 -11
  127. package/build/angular/primitives/shared.js.map +1 -1
  128. package/build/angular/render/index.js +69 -38
  129. package/build/angular/render/index.js.map +1 -1
  130. package/build/angular/renderer/index.d.ts +1 -0
  131. package/build/angular/renderer/index.js +37 -2
  132. package/build/angular/renderer/index.js.map +1 -1
  133. package/build/angular/services/color-scheme.service.js +3 -3
  134. package/build/angular/services/color-scheme.service.js.map +1 -1
  135. package/build/angular/services/window-dimensions.service.js +4 -4
  136. package/build/angular/services/window-dimensions.service.js.map +1 -1
  137. package/package.json +10 -8
  138. package/src/anchor-host-registry.ts +2 -2
  139. package/src/bootstrap.ts +4 -1
  140. package/src/components/activity-indicator/index.android.ts +8 -1
  141. package/src/components/activity-indicator/index.ios.ts +4 -0
  142. package/src/components/activity-indicator/shared.ts +32 -13
  143. package/src/components/button.ts +46 -19
  144. package/src/components/flat-list/index.ts +122 -62
  145. package/src/components/image/index.android.ts +58 -7
  146. package/src/components/image/index.ios.ts +58 -7
  147. package/src/components/image/shared.ts +92 -21
  148. package/src/components/image-background.ts +29 -9
  149. package/src/components/input-accessory-view/index.ts +67 -12
  150. package/src/components/keyboard-avoiding-view/index.ts +61 -15
  151. package/src/components/modal/index.ts +72 -33
  152. package/src/components/pressable/index.ts +117 -28
  153. package/src/components/refresh-control/index.ts +74 -18
  154. package/src/components/safe-area-view/index.ts +64 -10
  155. package/src/components/scroll-view/index.android.ts +62 -47
  156. package/src/components/scroll-view/index.ios.ts +19 -17
  157. package/src/components/scroll-view/projection.ts +363 -64
  158. package/src/components/scroll-view/shared.ts +312 -90
  159. package/src/components/scroll-view/sticky-header.ts +36 -24
  160. package/src/components/section-list/index.ts +86 -53
  161. package/src/components/switch/index.android.ts +60 -8
  162. package/src/components/switch/index.ios.ts +60 -8
  163. package/src/components/switch/shared.ts +93 -6
  164. package/src/components/text-input.ts +95 -13
  165. package/src/components/touchable/index.ts +348 -64
  166. package/src/components/touchable-native-feedback/index.ts +94 -31
  167. package/src/components/virtualized-list/directives.ts +19 -5
  168. package/src/components/virtualized-list/index.ts +380 -85
  169. package/src/components/virtualized-section-list/directives.ts +6 -3
  170. package/src/components/virtualized-section-list/index.ts +146 -33
  171. package/src/components.ts +9 -1
  172. package/src/create-portal/index.ts +31 -31
  173. package/src/create-tunnel/index.ts +16 -17
  174. package/src/descriptor-to-angular/index.ts +29 -8
  175. package/src/diagnostics.ts +138 -0
  176. package/src/host-instance/index.ts +9 -3
  177. package/src/index.ts +61 -3
  178. package/src/modules/animated/animated-leaf-binder.ts +28 -77
  179. package/src/modules/animated/create-animated-component.ts +115 -47
  180. package/src/modules/app-registry/index.ts +9 -9
  181. package/src/modules/status-bar/index.ts +13 -4
  182. package/src/primitives/index.ts +47 -2
  183. package/src/primitives/shared.ts +170 -10
  184. package/src/render/index.ts +77 -39
  185. package/src/renderer/index.ts +76 -14
  186. package/src/services/color-scheme.service.ts +3 -1
  187. package/src/services/window-dimensions.service.ts +11 -4
  188. package/build/angular/modules/animated/animated-leaf-binder/index.d.ts +0 -14
  189. package/build/angular/modules/animated/animated-leaf-binder/index.js +0 -91
  190. package/build/angular/modules/animated/animated-leaf-binder/index.js.map +0 -1
  191. package/src/modules/animated/animated-leaf-binder/index.ts +0 -101
@@ -1,7 +1,9 @@
1
- import { CUSTOM_ELEMENTS_SCHEMA, Component, ElementRef, inject } from '@angular/core';
2
- import { anchorHostStyle, SwitchHost, SymbioteHostPropsDirective } from '../../primitives';
1
+ import { CUSTOM_ELEMENTS_SCHEMA, Component, ElementRef, forwardRef, inject, signal, } from '@angular/core';
2
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
+ import { anchorHostStyle, SwitchHost, SymbioteHostPropsDirective, SymbioteStyleInputDirective, } from '../../primitives';
3
4
  import { SwitchBase } from './shared';
4
5
  import * as i0 from "@angular/core";
6
+ import * as i1 from "../../primitives/shared";
5
7
  export class Switch extends SwitchBase {
6
8
  // This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
7
9
  // onto (see anchorHostStyle's doc comment) — NOT the <symbiote-switch> leaf one level down.
@@ -14,29 +16,69 @@ export class Switch extends SwitchBase {
14
16
  trackTintColor: value ? trackColor?.true : trackColor?.false,
15
17
  }),
16
18
  };
19
+ // The anchor's class-derived style is written by the renderer's addClass/removeClass and never
20
+ // reaches Angular's input pipeline (a bare `class="x"` never appears in SimpleChanges — see
21
+ // anchorHostStyle's doc comment), so SwitchBase's inputsRevision cannot see it. Hence its own
22
+ // signal: a plain field read inside a computed() would be untracked and the bag would go stale
23
+ // the moment a `[class.x]`/`[ngClass]` toggled.
24
+ //
25
+ // ngDoCheck is the right cadence: render3's callHooks flushes a node's pre-order hooks at the
26
+ // next `ɵɵadvance` past it (or in refreshView's post-template flush), i.e. AFTER the declaring
27
+ // template's ɵɵclassProp wrote the class onto this element and BEFORE this component's own view
28
+ // refreshes — the exact window a class poll needs. callHooks also runs under
29
+ // setActiveConsumer(null), so the write registers no dependency on the caller's view (no NG0600).
30
+ // commitClassStyle allocates a fresh style array only when a token actually moved, so signal.set's
31
+ // own Object.is check makes an unchanged poll a no-op that dirties nothing.
32
+ //
33
+ // Known gap, shared with every other component polling this way (Pressable, SafeAreaView,
34
+ // TouchableNativeFeedback): `[ngClass]` applies its tokens from NgClass's OWN ngDoCheck, and a
35
+ // node's hooks flush in registration order with the component's first, so an [ngClass] flip lands
36
+ // one pass after this poll reads it. `class=` and `[class.x]` are written by the declaring
37
+ // template's styling instructions and so are always current here.
38
+ anchorStyle = signal(undefined, /* @ts-ignore */
39
+ ...(ngDevMode ? [{ debugName: "anchorStyle" }] : /* istanbul ignore next */ []));
40
+ ngDoCheck() {
41
+ this.anchorStyle.set(anchorHostStyle(this.elementRef));
42
+ }
17
43
  // The anchor's class-derived style goes first, then whatever SwitchBase already resolved
18
44
  // (its own explicit `style` @Input plus the ios_backgroundColor fold), so an explicit [style]
19
45
  // still beats the ambient class.
20
- get hostProps() {
21
- const props = super.hostProps;
22
- return { ...props, style: [anchorHostStyle(this.elementRef), props['style']] };
46
+ buildHostProps() {
47
+ const props = super.buildHostProps();
48
+ return { ...props, style: [this.anchorStyle(), props['style']] };
23
49
  }
24
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Switch, deps: null, target: i0.ɵɵFactoryTarget.Component });
25
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: Switch, isStandalone: true, selector: "Switch", inputs: { value: "value", disabled: "disabled", trackColor: "trackColor", thumbColor: "thumbColor", ios_backgroundColor: "ios_backgroundColor", style: "style", nativeID: "nativeID", testID: "testID", accessibilityLabel: "accessibilityLabel", accessibilityRole: "accessibilityRole", accessibilityState: "accessibilityState", accessibilityValue: "accessibilityValue", accessibilityHint: "accessibilityHint", accessible: "accessible", role: "role", "aria-label": "aria-label", "aria-disabled": "aria-disabled", "aria-checked": "aria-checked" }, outputs: { valueChange: "valueChange", change: "change" }, usesInheritance: true, ngImport: i0, template: `
50
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: Switch, deps: null, target: i0.ɵɵFactoryTarget.Component });
51
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: Switch, isStandalone: true, selector: "Switch", inputs: { value: "value", disabled: "disabled", trackColor: "trackColor", thumbColor: "thumbColor", ios_backgroundColor: "ios_backgroundColor", style: "style", nativeID: "nativeID", testID: "testID", accessibilityLabel: "accessibilityLabel", accessibilityRole: "accessibilityRole", accessibilityState: "accessibilityState", accessibilityValue: "accessibilityValue", accessibilityHint: "accessibilityHint", accessible: "accessible", role: "role", "aria-label": "aria-label", "aria-disabled": "aria-disabled", "aria-checked": "aria-checked" }, outputs: { valueChange: "valueChange", change: "change" }, providers: [
52
+ {
53
+ provide: NG_VALUE_ACCESSOR,
54
+ useExisting: forwardRef(() => Switch),
55
+ multi: true,
56
+ },
57
+ ], usesInheritance: true, hostDirectives: [{ directive: i1.SymbioteStyleInputDirective, inputs: ["style", "style"] }], ngImport: i0, template: `
26
58
  <symbiote-switch
27
59
  #nativeSwitch="symbioteHost"
28
- [symbioteHostProps]="hostProps"
60
+ [symbioteHostProps]="hostProps()"
29
61
  (change)="handleChange($event, nativeSwitch)"
30
62
  />
31
63
  `, isInline: true, dependencies: [{ kind: "component", type: SwitchHost, selector: "symbiote-switch" }, { kind: "directive", type: SymbioteHostPropsDirective, selector: "[symbioteHostProps]", inputs: ["symbioteHostProps"], exportAs: ["symbioteHost"] }] });
32
64
  }
33
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Switch, decorators: [{
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: Switch, decorators: [{
34
66
  type: Component,
35
67
  args: [{
36
68
  selector: 'Switch',
37
69
  standalone: true,
70
+ hostDirectives: [
71
+ { directive: SymbioteStyleInputDirective, inputs: ['style'] },
72
+ ],
38
73
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
39
74
  imports: [SwitchHost, SymbioteHostPropsDirective],
75
+ providers: [
76
+ {
77
+ provide: NG_VALUE_ACCESSOR,
78
+ useExisting: forwardRef(() => Switch),
79
+ multi: true,
80
+ },
81
+ ],
40
82
  inputs: [
41
83
  'value',
42
84
  'disabled',
@@ -61,7 +103,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
61
103
  template: `
62
104
  <symbiote-switch
63
105
  #nativeSwitch="symbioteHost"
64
- [symbioteHostProps]="hostProps"
106
+ [symbioteHostProps]="hostProps()"
65
107
  (change)="handleChange($event, nativeSwitch)"
66
108
  />
67
109
  `,
@@ -1 +1 @@
1
- {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../../src/components/switch/index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;;AAqCtC,MAAM,OAAO,MAAO,SAAQ,UAAU;IACpC,6FAA6F;IAC7F,4FAA4F;IAC3E,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAE9B,QAAQ,GAAG;QAC5B,eAAe,EAAE,gBAAgB;QACjC,eAAe,EAAE,CAAC,KAAc,EAAE,UAA8C,EAAE,EAAE,CAAC,CAAC;YACpF,kBAAkB,EAAE,UAAU,EAAE,KAAK;YACrC,iBAAiB,EAAE,UAAU,EAAE,IAAI;YACnC,cAAc,EAAE,KAAK,CAAC,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK;SAC7D,CAAC;KACH,CAAC;IAEF,yFAAyF;IACzF,8FAA8F;IAC9F,iCAAiC;IACjC,IAAa,SAAS;QACpB,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC;QAC9B,OAAO,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;IACjF,CAAC;uGApBU,MAAM;2FAAN,MAAM,krBARP;;;;;;GAMT,4DA5BS,UAAU,4DAAE,0BAA0B;;2FA8BrC,MAAM;kBAlClB,SAAS;mBAAC;oBACT,QAAQ,EAAE,QAAQ;oBAClB,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,sBAAsB,CAAC;oBACjC,OAAO,EAAE,CAAC,UAAU,EAAE,0BAA0B,CAAC;oBACjD,MAAM,EAAE;wBACN,OAAO;wBACP,UAAU;wBACV,YAAY;wBACZ,YAAY;wBACZ,qBAAqB;wBACrB,OAAO;wBACP,UAAU;wBACV,QAAQ;wBACR,oBAAoB;wBACpB,mBAAmB;wBACnB,oBAAoB;wBACpB,oBAAoB;wBACpB,mBAAmB;wBACnB,YAAY;wBACZ,MAAM;wBACN,YAAY;wBACZ,eAAe;wBACf,cAAc;qBACf;oBACD,OAAO,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC;oBAClC,QAAQ,EAAE;;;;;;GAMT;iBACF"}
1
+ {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../../src/components/switch/index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,UAAU,EACV,MAAM,EACN,MAAM,GAEP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACL,eAAe,EACf,UAAU,EACV,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,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AAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;gBACrC,KAAK,EAAE,IAAI;aACZ;SACF,8IAsBS;;;;;;GAMT,4DAnCS,UAAU,4DAAE,0BAA0B;;2FAqCrC,MAAM;kBA5ClB,SAAS;mBAAC;oBACT,QAAQ,EAAE,QAAQ;oBAClB,UAAU,EAAE,IAAI;oBAChB,cAAc,EAAE;wBACd,EAAE,SAAS,EAAE,2BAA2B,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE;qBAC9D;oBACD,OAAO,EAAE,CAAC,sBAAsB,CAAC;oBACjC,OAAO,EAAE,CAAC,UAAU,EAAE,0BAA0B,CAAC;oBACjD,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC;4BACrC,KAAK,EAAE,IAAI;yBACZ;qBACF;oBACD,MAAM,EAAE;wBACN,OAAO;wBACP,UAAU;wBACV,YAAY;wBACZ,YAAY;wBACZ,qBAAqB;wBACrB,OAAO;wBACP,UAAU;wBACV,QAAQ;wBACR,oBAAoB;wBACpB,mBAAmB;wBACnB,oBAAoB;wBACpB,oBAAoB;wBACpB,mBAAmB;wBACnB,YAAY;wBACZ,MAAM;wBACN,YAAY;wBACZ,eAAe;wBACf,cAAc;qBACf;oBACD,OAAO,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC;oBAClC,QAAQ,EAAE;;;;;;GAMT;iBACF"}
@@ -1,7 +1,9 @@
1
+ import { type DoCheck } from '@angular/core';
1
2
  import { SwitchBase } from './shared';
2
3
  import * as i0 from "@angular/core";
4
+ import * as i1 from "../../primitives/shared";
3
5
  export type { ISwitchProps, ISwitchTrackColor } from './shared';
4
- export declare class Switch extends SwitchBase {
6
+ export declare class Switch extends SwitchBase implements DoCheck {
5
7
  private readonly elementRef;
6
8
  protected readonly platform: {
7
9
  snapBackCommand: string;
@@ -13,7 +15,9 @@ export declare class Switch extends SwitchBase {
13
15
  tintColor: string | undefined;
14
16
  };
15
17
  };
16
- get hostProps(): Record<string, unknown>;
18
+ private readonly anchorStyle;
19
+ ngDoCheck(): void;
20
+ protected buildHostProps(): Record<string, unknown>;
17
21
  static ɵfac: i0.ɵɵFactoryDeclaration<Switch, never>;
18
- static ɵcmp: i0.ɵɵComponentDeclaration<Switch, "Switch", never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "trackColor": { "alias": "trackColor"; "required": false; }; "thumbColor": { "alias": "thumbColor"; "required": false; }; "ios_backgroundColor": { "alias": "ios_backgroundColor"; "required": false; }; "style": { "alias": "style"; "required": false; }; "nativeID": { "alias": "nativeID"; "required": false; }; "testID": { "alias": "testID"; "required": false; }; "accessibilityLabel": { "alias": "accessibilityLabel"; "required": false; }; "accessibilityRole": { "alias": "accessibilityRole"; "required": false; }; "accessibilityState": { "alias": "accessibilityState"; "required": false; }; "accessibilityValue": { "alias": "accessibilityValue"; "required": false; }; "accessibilityHint": { "alias": "accessibilityHint"; "required": false; }; "accessible": { "alias": "accessible"; "required": false; }; "role": { "alias": "role"; "required": false; }; "aria-label": { "alias": "aria-label"; "required": false; }; "aria-disabled": { "alias": "aria-disabled"; "required": false; }; "aria-checked": { "alias": "aria-checked"; "required": false; }; }, { "valueChange": "valueChange"; "change": "change"; }, never, never, true, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<Switch, "Switch", never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "trackColor": { "alias": "trackColor"; "required": false; }; "thumbColor": { "alias": "thumbColor"; "required": false; }; "ios_backgroundColor": { "alias": "ios_backgroundColor"; "required": false; }; "style": { "alias": "style"; "required": false; }; "nativeID": { "alias": "nativeID"; "required": false; }; "testID": { "alias": "testID"; "required": false; }; "accessibilityLabel": { "alias": "accessibilityLabel"; "required": false; }; "accessibilityRole": { "alias": "accessibilityRole"; "required": false; }; "accessibilityState": { "alias": "accessibilityState"; "required": false; }; "accessibilityValue": { "alias": "accessibilityValue"; "required": false; }; "accessibilityHint": { "alias": "accessibilityHint"; "required": false; }; "accessible": { "alias": "accessible"; "required": false; }; "role": { "alias": "role"; "required": false; }; "aria-label": { "alias": "aria-label"; "required": false; }; "aria-disabled": { "alias": "aria-disabled"; "required": false; }; "aria-checked": { "alias": "aria-checked"; "required": false; }; }, { "valueChange": "valueChange"; "change": "change"; }, never, never, true, [{ directive: typeof i1.SymbioteStyleInputDirective; inputs: { "style": "style"; }; outputs: {}; }]>;
19
23
  }
@@ -1,7 +1,9 @@
1
- import { CUSTOM_ELEMENTS_SCHEMA, Component, ElementRef, inject } from '@angular/core';
2
- import { anchorHostStyle, SwitchHost, SymbioteHostPropsDirective } from '../../primitives';
1
+ import { CUSTOM_ELEMENTS_SCHEMA, Component, ElementRef, forwardRef, inject, signal, } from '@angular/core';
2
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
+ import { anchorHostStyle, SwitchHost, SymbioteHostPropsDirective, SymbioteStyleInputDirective, } from '../../primitives';
3
4
  import { SwitchBase } from './shared';
4
5
  import * as i0 from "@angular/core";
6
+ import * as i1 from "../../primitives/shared";
5
7
  export class Switch extends SwitchBase {
6
8
  // This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
7
9
  // onto (see anchorHostStyle's doc comment) — NOT the <symbiote-switch> leaf one level down.
@@ -13,29 +15,69 @@ export class Switch extends SwitchBase {
13
15
  tintColor: trackColor?.false,
14
16
  }),
15
17
  };
18
+ // The anchor's class-derived style is written by the renderer's addClass/removeClass and never
19
+ // reaches Angular's input pipeline (a bare `class="x"` never appears in SimpleChanges — see
20
+ // anchorHostStyle's doc comment), so SwitchBase's inputsRevision cannot see it. Hence its own
21
+ // signal: a plain field read inside a computed() would be untracked and the bag would go stale
22
+ // the moment a `[class.x]`/`[ngClass]` toggled.
23
+ //
24
+ // ngDoCheck is the right cadence: render3's callHooks flushes a node's pre-order hooks at the
25
+ // next `ɵɵadvance` past it (or in refreshView's post-template flush), i.e. AFTER the declaring
26
+ // template's ɵɵclassProp wrote the class onto this element and BEFORE this component's own view
27
+ // refreshes — the exact window a class poll needs. callHooks also runs under
28
+ // setActiveConsumer(null), so the write registers no dependency on the caller's view (no NG0600).
29
+ // commitClassStyle allocates a fresh style array only when a token actually moved, so signal.set's
30
+ // own Object.is check makes an unchanged poll a no-op that dirties nothing.
31
+ //
32
+ // Known gap, shared with every other component polling this way (Pressable, SafeAreaView,
33
+ // TouchableNativeFeedback): `[ngClass]` applies its tokens from NgClass's OWN ngDoCheck, and a
34
+ // node's hooks flush in registration order with the component's first, so an [ngClass] flip lands
35
+ // one pass after this poll reads it. `class=` and `[class.x]` are written by the declaring
36
+ // template's styling instructions and so are always current here.
37
+ anchorStyle = signal(undefined, /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "anchorStyle" }] : /* istanbul ignore next */ []));
39
+ ngDoCheck() {
40
+ this.anchorStyle.set(anchorHostStyle(this.elementRef));
41
+ }
16
42
  // The anchor's class-derived style goes first, then whatever SwitchBase already resolved
17
43
  // (its own explicit `style` @Input plus the ios_backgroundColor fold), so an explicit [style]
18
44
  // still beats the ambient class.
19
- get hostProps() {
20
- const props = super.hostProps;
21
- return { ...props, style: [anchorHostStyle(this.elementRef), props['style']] };
45
+ buildHostProps() {
46
+ const props = super.buildHostProps();
47
+ return { ...props, style: [this.anchorStyle(), props['style']] };
22
48
  }
23
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Switch, deps: null, target: i0.ɵɵFactoryTarget.Component });
24
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: Switch, isStandalone: true, selector: "Switch", inputs: { value: "value", disabled: "disabled", trackColor: "trackColor", thumbColor: "thumbColor", ios_backgroundColor: "ios_backgroundColor", style: "style", nativeID: "nativeID", testID: "testID", accessibilityLabel: "accessibilityLabel", accessibilityRole: "accessibilityRole", accessibilityState: "accessibilityState", accessibilityValue: "accessibilityValue", accessibilityHint: "accessibilityHint", accessible: "accessible", role: "role", "aria-label": "aria-label", "aria-disabled": "aria-disabled", "aria-checked": "aria-checked" }, outputs: { valueChange: "valueChange", change: "change" }, usesInheritance: true, ngImport: i0, template: `
49
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: Switch, deps: null, target: i0.ɵɵFactoryTarget.Component });
50
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: Switch, isStandalone: true, selector: "Switch", inputs: { value: "value", disabled: "disabled", trackColor: "trackColor", thumbColor: "thumbColor", ios_backgroundColor: "ios_backgroundColor", style: "style", nativeID: "nativeID", testID: "testID", accessibilityLabel: "accessibilityLabel", accessibilityRole: "accessibilityRole", accessibilityState: "accessibilityState", accessibilityValue: "accessibilityValue", accessibilityHint: "accessibilityHint", accessible: "accessible", role: "role", "aria-label": "aria-label", "aria-disabled": "aria-disabled", "aria-checked": "aria-checked" }, outputs: { valueChange: "valueChange", change: "change" }, providers: [
51
+ {
52
+ provide: NG_VALUE_ACCESSOR,
53
+ useExisting: forwardRef(() => Switch),
54
+ multi: true,
55
+ },
56
+ ], usesInheritance: true, hostDirectives: [{ directive: i1.SymbioteStyleInputDirective, inputs: ["style", "style"] }], ngImport: i0, template: `
25
57
  <symbiote-switch
26
58
  #nativeSwitch="symbioteHost"
27
- [symbioteHostProps]="hostProps"
59
+ [symbioteHostProps]="hostProps()"
28
60
  (change)="handleChange($event, nativeSwitch)"
29
61
  />
30
62
  `, isInline: true, dependencies: [{ kind: "component", type: SwitchHost, selector: "symbiote-switch" }, { kind: "directive", type: SymbioteHostPropsDirective, selector: "[symbioteHostProps]", inputs: ["symbioteHostProps"], exportAs: ["symbioteHost"] }] });
31
63
  }
32
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Switch, decorators: [{
64
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: Switch, decorators: [{
33
65
  type: Component,
34
66
  args: [{
35
67
  selector: 'Switch',
36
68
  standalone: true,
69
+ hostDirectives: [
70
+ { directive: SymbioteStyleInputDirective, inputs: ['style'] },
71
+ ],
37
72
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
38
73
  imports: [SwitchHost, SymbioteHostPropsDirective],
74
+ providers: [
75
+ {
76
+ provide: NG_VALUE_ACCESSOR,
77
+ useExisting: forwardRef(() => Switch),
78
+ multi: true,
79
+ },
80
+ ],
39
81
  inputs: [
40
82
  'value',
41
83
  'disabled',
@@ -60,7 +102,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
60
102
  template: `
61
103
  <symbiote-switch
62
104
  #nativeSwitch="symbioteHost"
63
- [symbioteHostProps]="hostProps"
105
+ [symbioteHostProps]="hostProps()"
64
106
  (change)="handleChange($event, nativeSwitch)"
65
107
  />
66
108
  `,
@@ -1 +1 @@
1
- {"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../../src/components/switch/index.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;;AAqCtC,MAAM,OAAO,MAAO,SAAQ,UAAU;IACpC,6FAA6F;IAC7F,4FAA4F;IAC3E,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAE9B,QAAQ,GAAG;QAC5B,eAAe,EAAE,UAAU;QAC3B,eAAe,EAAE,CAAC,MAAe,EAAE,UAA8C,EAAE,EAAE,CAAC,CAAC;YACrF,WAAW,EAAE,UAAU,EAAE,IAAI;YAC7B,SAAS,EAAE,UAAU,EAAE,KAAK;SAC7B,CAAC;KACH,CAAC;IAEF,yFAAyF;IACzF,8FAA8F;IAC9F,iCAAiC;IACjC,IAAa,SAAS;QACpB,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC;QAC9B,OAAO,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;IACjF,CAAC;uGAnBU,MAAM;2FAAN,MAAM,krBARP;;;;;;GAMT,4DA5BS,UAAU,4DAAE,0BAA0B;;2FA8BrC,MAAM;kBAlClB,SAAS;mBAAC;oBACT,QAAQ,EAAE,QAAQ;oBAClB,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,sBAAsB,CAAC;oBACjC,OAAO,EAAE,CAAC,UAAU,EAAE,0BAA0B,CAAC;oBACjD,MAAM,EAAE;wBACN,OAAO;wBACP,UAAU;wBACV,YAAY;wBACZ,YAAY;wBACZ,qBAAqB;wBACrB,OAAO;wBACP,UAAU;wBACV,QAAQ;wBACR,oBAAoB;wBACpB,mBAAmB;wBACnB,oBAAoB;wBACpB,oBAAoB;wBACpB,mBAAmB;wBACnB,YAAY;wBACZ,MAAM;wBACN,YAAY;wBACZ,eAAe;wBACf,cAAc;qBACf;oBACD,OAAO,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC;oBAClC,QAAQ,EAAE;;;;;;GAMT;iBACF"}
1
+ {"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../../src/components/switch/index.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,UAAU,EACV,MAAM,EACN,MAAM,GAEP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACL,eAAe,EACf,UAAU,EACV,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC;AA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SACF,8IAsBS;;;;;;GAMT,4DAnCS,UAAU,4DAAE,0BAA0B;;2FAqCrC,MAAM;kBA5ClB,SAAS;mBAAC;oBACT,QAAQ,EAAE,QAAQ;oBAClB,UAAU,EAAE,IAAI;oBAChB,cAAc,EAAE;wBACd,EAAE,SAAS,EAAE,2BAA2B,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE;qBAC9D;oBACD,OAAO,EAAE,CAAC,sBAAsB,CAAC;oBACjC,OAAO,EAAE,CAAC,UAAU,EAAE,0BAA0B,CAAC;oBACjD,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC;4BACrC,KAAK,EAAE,IAAI;yBACZ;qBACF;oBACD,MAAM,EAAE;wBACN,OAAO;wBACP,UAAU;wBACV,YAAY;wBACZ,YAAY;wBACZ,qBAAqB;wBACrB,OAAO;wBACP,UAAU;wBACV,QAAQ;wBACR,oBAAoB;wBACpB,mBAAmB;wBACnB,oBAAoB;wBACpB,oBAAoB;wBACpB,mBAAmB;wBACnB,YAAY;wBACZ,MAAM;wBACN,YAAY;wBACZ,eAAe;wBACf,cAAc;qBACf;oBACD,OAAO,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC;oBAClC,QAAQ,EAAE;;;;;;GAMT;iBACF"}
@@ -1,14 +1,15 @@
1
- import { EventEmitter } from '@angular/core';
1
+ import { EventEmitter, type OnChanges } from '@angular/core';
2
+ import type { ControlValueAccessor } from '@angular/forms';
2
3
  import type { ISwitchPlatform, ISwitchProps, ISwitchTrackColor } from '@symbiote-native/components';
3
4
  import { type ISymbioteEvent, type IStyleProp, type IViewStyle } from '@symbiote-native/engine';
4
5
  import * as i0 from "@angular/core";
5
- export type { ISwitchProps, ISwitchTrackColor } from '@symbiote-native/components';
6
+ export type { ISwitchProps, ISwitchTrackColor, } from '@symbiote-native/components';
6
7
  export type ISwitchInputs = Pick<ISwitchProps, 'value' | 'disabled' | 'trackColor' | 'thumbColor' | 'ios_backgroundColor' | 'style' | 'nativeID' | 'testID' | 'accessibilityLabel' | 'accessibilityRole' | 'accessibilityState' | 'accessibilityValue' | 'accessibilityHint' | 'accessible' | 'role' | 'aria-label' | 'aria-disabled' | 'aria-checked'>;
7
8
  type ISwitchHostPlatform = ISwitchPlatform & {
8
9
  snapBackCommand: string;
9
10
  };
10
11
  type IHostProps = Record<string, unknown>;
11
- export declare abstract class SwitchBase implements ISwitchInputs {
12
+ export declare abstract class SwitchBase implements ISwitchInputs, ControlValueAccessor, OnChanges {
12
13
  readonly valueChange: EventEmitter<boolean>;
13
14
  readonly change: EventEmitter<ISymbioteEvent>;
14
15
  value: boolean | undefined;
@@ -31,9 +32,17 @@ export declare abstract class SwitchBase implements ISwitchInputs {
31
32
  'aria-checked': boolean | 'mixed' | undefined;
32
33
  protected abstract readonly platform: ISwitchHostPlatform;
33
34
  private switchState;
34
- get hostProps(): IHostProps;
35
+ private readonly changeDetector;
36
+ private readonly inputsRevision;
37
+ ngOnChanges(): void;
38
+ readonly hostProps: import("@angular/core").Signal<IHostProps>;
39
+ protected buildHostProps(): IHostProps;
35
40
  handleChange(event: unknown, node: unknown): void;
36
41
  private snapBackIfNeeded;
42
+ writeValue(value: boolean | null): void;
43
+ registerOnChange(fn: (value: boolean) => void): void;
44
+ registerOnTouched(fn: () => void): void;
45
+ setDisabledState(isDisabled: boolean): void;
37
46
  private inputProps;
38
47
  static ɵfac: i0.ɵɵFactoryDeclaration<SwitchBase, never>;
39
48
  static ɵdir: i0.ɵɵDirectiveDeclaration<SwitchBase, never, never, {}, { "valueChange": "valueChange"; "change": "change"; }, never, never, true, never>;
@@ -1,5 +1,5 @@
1
- import { Directive, EventEmitter, Output } from '@angular/core';
2
- import { renderSwitch, resolveAccessibilityProps } from '@symbiote-native/components';
1
+ import { ChangeDetectorRef, Directive, EventEmitter, Output, computed, inject, signal, } from '@angular/core';
2
+ import { renderSwitch, resolveAccessibilityProps, } from '@symbiote-native/components';
3
3
  import { createInitialSwitchState, shouldSnapBack, switchReducer, valueFromChange, } from '@symbiote-native/components';
4
4
  import { dispatchViewCommand, dlog, isSymbioteNode, whenCommitted, } from '@symbiote-native/engine';
5
5
  import * as i0 from "@angular/core";
@@ -49,8 +49,44 @@ export class SwitchBase {
49
49
  'aria-label';
50
50
  'aria-disabled';
51
51
  'aria-checked';
52
+ // NOT a hostProps dependency - only snapBackIfNeeded reads it, and the bag's `value` comes from
53
+ // the @Input, not from this reducer state. So it stays a plain field; if a future change makes
54
+ // the bag read it, it must become a signal first (see inputsRevision's note).
52
55
  switchState = createInitialSwitchState();
53
- get hostProps() {
56
+ // Only setDisabledState()/writeValue() need this: @angular/forms mutates `value`/`disabled` from
57
+ // OUTSIDE Angular's own binding path, which doesn't itself schedule a tick under zoneless CD.
58
+ changeDetector = inject(ChangeDetectorRef);
59
+ // Bridges the non-reactive @Input fields into the reactive graph so hostProps below can be a
60
+ // memoized computed(). Signal inputs would make this unnecessary, but `input()` is visible only
61
+ // to the AOT compiler and this package's unit suite runs on JIT - see the
62
+ // `angular-adapter-change-detection` skill, §6. `signal()`/`computed()` are plain runtime APIs
63
+ // and need no compiler support, which is what makes this bridge possible at all.
64
+ //
65
+ // Bumped from ngOnChanges (covers every @Input) AND from the two ControlValueAccessor writers
66
+ // below, which assign `value`/`disabled` from OUTSIDE Angular's binding path and so never reach
67
+ // ngOnChanges. ONLY a genuine dependency of the bag may bump it - widening it to "bump on
68
+ // everything" silently un-memoizes the bag and defeats the point. State that is not an @Input
69
+ // and is not one of those two writers needs its OWN signal instead (the platform components'
70
+ // anchor style is exactly that case).
71
+ inputsRevision = signal(0, /* @ts-ignore */
72
+ ...(ngDevMode ? [{ debugName: "inputsRevision" }] : /* istanbul ignore next */ []));
73
+ ngOnChanges() {
74
+ this.inputsRevision.update(revision => revision + 1);
75
+ }
76
+ // MEASURED 2026-08-16: as a getter this rebuilt the bag on every refresh of this view, so
77
+ // `[symbioteHostProps]`'s reference check failed every time and every key was re-pushed through
78
+ // Renderer2 -> routeProp - pure waste when nothing changed. computed() returns the SAME object
79
+ // until a tracked dependency actually changes, and the input setter then skips the whole spread.
80
+ //
81
+ // A computed FIELD cannot be overridden by a subclass accessor the way a getter can, so the
82
+ // platform components override buildHostProps() below and this stays the single memoization
83
+ // point for every platform.
84
+ hostProps = computed(() => {
85
+ this.inputsRevision();
86
+ return this.buildHostProps();
87
+ }, /* @ts-ignore */
88
+ ...(ngDevMode ? [{ debugName: "hostProps" }] : /* istanbul ignore next */ []));
89
+ buildHostProps() {
54
90
  const props = resolveAccessibilityProps(this.inputProps());
55
91
  const { value, disabled, trackColor, thumbColor, ios_backgroundColor, style, onValueChange: _onValueChange, ...passthrough } = props;
56
92
  return renderSwitch({
@@ -72,7 +108,10 @@ export class SwitchBase {
72
108
  if (next === undefined)
73
109
  return;
74
110
  this.valueChange.emit(next);
75
- this.switchState = switchReducer(this.switchState, { type: 'native-reported', value: next });
111
+ this.switchState = switchReducer(this.switchState, {
112
+ type: 'native-reported',
113
+ value: next,
114
+ });
76
115
  const hostNode = readSwitchNode(node);
77
116
  if (hostNode === null)
78
117
  return;
@@ -89,6 +128,31 @@ export class SwitchBase {
89
128
  dispatchViewCommand(node, this.platform.snapBackCommand, [fabricValue]);
90
129
  });
91
130
  }
131
+ // ControlValueAccessor — `value` is a plain field feeding `hostProps` on every CD check, no
132
+ // ngOnChanges/stale-safe commit dance to guard (unlike TextInput, a boolean toggle has no
133
+ // keystroke to race), so writeValue()/setDisabledState() can set it straight.
134
+ writeValue(value) {
135
+ this.value = value ?? false;
136
+ // `value` feeds hostProps but this write bypasses Angular's binding path, so ngOnChanges never
137
+ // fires for it - without the bump the memoized bag would keep reporting the old value and the
138
+ // switch would stop reflecting a form-driven change.
139
+ this.inputsRevision.update(revision => revision + 1);
140
+ this.changeDetector.markForCheck();
141
+ }
142
+ registerOnChange(fn) {
143
+ this.valueChange.subscribe(fn);
144
+ }
145
+ registerOnTouched(fn) {
146
+ // Switch has no blur concept (it's a discrete toggle, not a text field) — `change` is the
147
+ // closest touched signal, same convention Angular's own checkbox CVAs use.
148
+ this.change.subscribe(() => fn());
149
+ }
150
+ setDisabledState(isDisabled) {
151
+ this.disabled = isDisabled;
152
+ // Same reason as writeValue: an @angular/forms write that never reaches ngOnChanges.
153
+ this.inputsRevision.update(revision => revision + 1);
154
+ this.changeDetector.markForCheck();
155
+ }
92
156
  inputProps() {
93
157
  const props = {
94
158
  value: this.value,
@@ -114,10 +178,10 @@ export class SwitchBase {
114
178
  'aria-checked': this['aria-checked'],
115
179
  };
116
180
  }
117
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SwitchBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
118
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: SwitchBase, isStandalone: true, outputs: { valueChange: "valueChange", change: "change" }, ngImport: i0 });
181
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SwitchBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
182
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: SwitchBase, isStandalone: true, outputs: { valueChange: "valueChange", change: "change" }, usesOnChanges: true, ngImport: i0 });
119
183
  }
120
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SwitchBase, decorators: [{
184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SwitchBase, decorators: [{
121
185
  type: Directive
122
186
  }], propDecorators: { valueChange: [{
123
187
  type: Output
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/components/switch/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,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BAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC;YAChC,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC;YACtC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC;SACrC,CAAC;IACJ,CAAC;uGAnHmB,UAAU;2FAAV,UAAU;;2FAAV,UAAU;kBAD/B,SAAS;;sBAMP,MAAM;;sBACN,MAAM"}
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/components/switch/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,GAEP,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,YAAY,EACZ,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,aAAa,EACb,eAAe,GAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,mBAAmB,EACnB,IAAI,EACJ,cAAc,EACd,aAAa,GAKd,MAAM,yBAAyB,CAAC;;AAiCjC,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,cAAc,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACxC,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,IAAI,KAAK;QACf,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAC1B,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC;IACpB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,CACL,OAAO,KAAK,KAA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c,EAAE,IAAI,CAAC,cAAc,CAAC;SACrC,CAAC;IACJ,CAAC;uGA1LmB,UAAU;2FAAV,UAAU;;2FAAV,UAAU;kBAD/B,SAAS;;sBAQP,MAAM;;sBACN,MAAM"}
@@ -1,8 +1,10 @@
1
1
  import { EventEmitter, type AfterViewInit, type OnChanges, type OnDestroy, type SimpleChanges } from '@angular/core';
2
+ import { type ControlValueAccessor } from '@angular/forms';
2
3
  import { type IAccessibilityProps, type IAccessibilityStateValue, type IAriaProps, type IEnterKeyHint, type IInputMode, type ISubmitBehavior, type ITextInputEventHandler, type ITextInputHandle, type ITextInputSelection } from '@symbiote-native/components';
3
4
  import { type IStyleProp, type ISymbioteEvent, type ITextStyle } from '@symbiote-native/engine';
4
5
  import * as i0 from "@angular/core";
5
- export type { ITextInputHandle, ITextInputSelection, IInputMode, IEnterKeyHint, ISubmitBehavior };
6
+ import * as i1 from "../primitives/shared";
7
+ export type { ITextInputHandle, ITextInputSelection, IInputMode, IEnterKeyHint, ISubmitBehavior, };
6
8
  export interface IAngularTextInputProps extends IAccessibilityProps, IAriaProps {
7
9
  value?: string;
8
10
  defaultValue?: string;
@@ -47,7 +49,7 @@ export interface IAngularTextInputProps extends IAccessibilityProps, IAriaProps
47
49
  onContentSizeChange?: ITextInputEventHandler;
48
50
  }
49
51
  export type IAngularTextInputInputs = Omit<IAngularTextInputProps, 'onValueChange' | 'onChange' | 'onFocus' | 'onBlur' | 'onEndEditing' | 'onSubmitEditing' | 'onKeyPress' | 'onSelectionChange' | 'onContentSizeChange' | 'onAccessibilityAction' | 'onAccessibilityTap' | 'onMagicTap' | 'onAccessibilityEscape'>;
50
- export declare class TextInput implements IAngularTextInputInputs, ITextInputHandle, OnChanges, AfterViewInit, OnDestroy {
52
+ export declare class TextInput implements IAngularTextInputInputs, ITextInputHandle, OnChanges, AfterViewInit, OnDestroy, ControlValueAccessor {
51
53
  value?: string;
52
54
  defaultValue?: string;
53
55
  placeholder?: string;
@@ -125,13 +127,19 @@ export declare class TextInput implements IAngularTextInputInputs, ITextInputHan
125
127
  ariaSelected?: boolean;
126
128
  private hostRef?;
127
129
  private readonly elementRef;
130
+ private readonly changeDetector;
128
131
  private mostRecentEventCount;
129
132
  private lastNativeText;
130
133
  private focused;
131
134
  private cancelAutoFocus?;
135
+ private isFirstFormWrite;
132
136
  get isMultiline(): boolean;
133
137
  get hostProps(): Record<string, unknown>;
134
138
  ngOnChanges(changes: SimpleChanges): void;
139
+ writeValue(value: string | null): void;
140
+ registerOnChange(fn: (value: string) => void): void;
141
+ registerOnTouched(fn: () => void): void;
142
+ setDisabledState(isDisabled: boolean): void;
135
143
  ngAfterViewInit(): void;
136
144
  ngOnDestroy(): void;
137
145
  handleChange(event: unknown): void;
@@ -149,5 +157,5 @@ export declare class TextInput implements IAngularTextInputInputs, ITextInputHan
149
157
  private get foldedAccessibility();
150
158
  private get hostNode();
151
159
  static ɵfac: i0.ɵɵFactoryDeclaration<TextInput, never>;
152
- static ɵcmp: i0.ɵɵComponentDeclaration<TextInput, "TextInput", never, { "value": { "alias": "value"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "placeholderTextColor": { "alias": "placeholderTextColor"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; "keyboardType": { "alias": "keyboardType"; "required": false; }; "secureTextEntry": { "alias": "secureTextEntry"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "multiline": { "alias": "multiline"; "required": false; }; "selection": { "alias": "selection"; "required": false; }; "autoCapitalize": { "alias": "autoCapitalize"; "required": false; }; "autoCorrect": { "alias": "autoCorrect"; "required": false; }; "autoComplete": { "alias": "autoComplete"; "required": false; }; "textContentType": { "alias": "textContentType"; "required": false; }; "autoFocus": { "alias": "autoFocus"; "required": false; }; "showSoftInputOnFocus": { "alias": "showSoftInputOnFocus"; "required": false; }; "returnKeyType": { "alias": "returnKeyType"; "required": false; }; "selectTextOnFocus": { "alias": "selectTextOnFocus"; "required": false; }; "scrollEnabled": { "alias": "scrollEnabled"; "required": false; }; "numberOfLines": { "alias": "numberOfLines"; "required": false; }; "textAlign": { "alias": "textAlign"; "required": false; }; "blurOnSubmit": { "alias": "blurOnSubmit"; "required": false; }; "inputMode": { "alias": "inputMode"; "required": false; }; "enterKeyHint": { "alias": "enterKeyHint"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; "submitBehavior": { "alias": "submitBehavior"; "required": false; }; "cursorColor": { "alias": "cursorColor"; "required": false; }; "selectionColor": { "alias": "selectionColor"; "required": false; }; "selectionHandleColor": { "alias": "selectionHandleColor"; "required": false; }; "underlineColorAndroid": { "alias": "underlineColorAndroid"; "required": false; }; "inputAccessoryViewID": { "alias": "inputAccessoryViewID"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testID": { "alias": "testID"; "required": false; }; "nativeID": { "alias": "nativeID"; "required": false; }; "accessible": { "alias": "accessible"; "required": false; }; "accessibilityLabel": { "alias": "accessibilityLabel"; "required": false; }; "accessibilityHint": { "alias": "accessibilityHint"; "required": false; }; "accessibilityRole": { "alias": "accessibilityRole"; "required": false; }; "accessibilityState": { "alias": "accessibilityState"; "required": false; }; "accessibilityValue": { "alias": "accessibilityValue"; "required": false; }; "accessibilityActions": { "alias": "accessibilityActions"; "required": false; }; "accessibilityLabelledBy": { "alias": "accessibilityLabelledBy"; "required": false; }; "importantForAccessibility": { "alias": "importantForAccessibility"; "required": false; }; "accessibilityLiveRegion": { "alias": "accessibilityLiveRegion"; "required": false; }; "screenReaderFocusable": { "alias": "screenReaderFocusable"; "required": false; }; "accessibilityViewIsModal": { "alias": "accessibilityViewIsModal"; "required": false; }; "accessibilityElementsHidden": { "alias": "accessibilityElementsHidden"; "required": false; }; "accessibilityIgnoresInvertColors": { "alias": "accessibilityIgnoresInvertColors"; "required": false; }; "accessibilityLanguage": { "alias": "accessibilityLanguage"; "required": false; }; "accessibilityRespondsToUserInteraction": { "alias": "accessibilityRespondsToUserInteraction"; "required": false; }; "accessibilityShowsLargeContentViewer": { "alias": "accessibilityShowsLargeContentViewer"; "required": false; }; "accessibilityLargeContentTitle": { "alias": "accessibilityLargeContentTitle"; "required": false; }; "role": { "alias": "role"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; }; "ariaLive": { "alias": "aria-live"; "required": false; }; "ariaHidden": { "alias": "aria-hidden"; "required": false; }; "ariaBusy": { "alias": "aria-busy"; "required": false; }; "ariaChecked": { "alias": "aria-checked"; "required": false; }; "ariaDisabled": { "alias": "aria-disabled"; "required": false; }; "ariaExpanded": { "alias": "aria-expanded"; "required": false; }; "ariaSelected": { "alias": "aria-selected"; "required": false; }; }, { "valueChange": "valueChange"; "change": "change"; "focusEvent": "focus"; "blurEvent": "blur"; "endEditing": "endEditing"; "submitEditing": "submitEditing"; "keyPress": "keyPress"; "selectionChange": "selectionChange"; "contentSizeChange": "contentSizeChange"; "accessibilityAction": "accessibilityAction"; "accessibilityTap": "accessibilityTap"; "magicTap": "magicTap"; "accessibilityEscape": "accessibilityEscape"; }, never, never, true, never>;
160
+ static ɵcmp: i0.ɵɵComponentDeclaration<TextInput, "TextInput", never, { "value": { "alias": "value"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "placeholderTextColor": { "alias": "placeholderTextColor"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; "keyboardType": { "alias": "keyboardType"; "required": false; }; "secureTextEntry": { "alias": "secureTextEntry"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "multiline": { "alias": "multiline"; "required": false; }; "selection": { "alias": "selection"; "required": false; }; "autoCapitalize": { "alias": "autoCapitalize"; "required": false; }; "autoCorrect": { "alias": "autoCorrect"; "required": false; }; "autoComplete": { "alias": "autoComplete"; "required": false; }; "textContentType": { "alias": "textContentType"; "required": false; }; "autoFocus": { "alias": "autoFocus"; "required": false; }; "showSoftInputOnFocus": { "alias": "showSoftInputOnFocus"; "required": false; }; "returnKeyType": { "alias": "returnKeyType"; "required": false; }; "selectTextOnFocus": { "alias": "selectTextOnFocus"; "required": false; }; "scrollEnabled": { "alias": "scrollEnabled"; "required": false; }; "numberOfLines": { "alias": "numberOfLines"; "required": false; }; "textAlign": { "alias": "textAlign"; "required": false; }; "blurOnSubmit": { "alias": "blurOnSubmit"; "required": false; }; "inputMode": { "alias": "inputMode"; "required": false; }; "enterKeyHint": { "alias": "enterKeyHint"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; "submitBehavior": { "alias": "submitBehavior"; "required": false; }; "cursorColor": { "alias": "cursorColor"; "required": false; }; "selectionColor": { "alias": "selectionColor"; "required": false; }; "selectionHandleColor": { "alias": "selectionHandleColor"; "required": false; }; "underlineColorAndroid": { "alias": "underlineColorAndroid"; "required": false; }; "inputAccessoryViewID": { "alias": "inputAccessoryViewID"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testID": { "alias": "testID"; "required": false; }; "nativeID": { "alias": "nativeID"; "required": false; }; "accessible": { "alias": "accessible"; "required": false; }; "accessibilityLabel": { "alias": "accessibilityLabel"; "required": false; }; "accessibilityHint": { "alias": "accessibilityHint"; "required": false; }; "accessibilityRole": { "alias": "accessibilityRole"; "required": false; }; "accessibilityState": { "alias": "accessibilityState"; "required": false; }; "accessibilityValue": { "alias": "accessibilityValue"; "required": false; }; "accessibilityActions": { "alias": "accessibilityActions"; "required": false; }; "accessibilityLabelledBy": { "alias": "accessibilityLabelledBy"; "required": false; }; "importantForAccessibility": { "alias": "importantForAccessibility"; "required": false; }; "accessibilityLiveRegion": { "alias": "accessibilityLiveRegion"; "required": false; }; "screenReaderFocusable": { "alias": "screenReaderFocusable"; "required": false; }; "accessibilityViewIsModal": { "alias": "accessibilityViewIsModal"; "required": false; }; "accessibilityElementsHidden": { "alias": "accessibilityElementsHidden"; "required": false; }; "accessibilityIgnoresInvertColors": { "alias": "accessibilityIgnoresInvertColors"; "required": false; }; "accessibilityLanguage": { "alias": "accessibilityLanguage"; "required": false; }; "accessibilityRespondsToUserInteraction": { "alias": "accessibilityRespondsToUserInteraction"; "required": false; }; "accessibilityShowsLargeContentViewer": { "alias": "accessibilityShowsLargeContentViewer"; "required": false; }; "accessibilityLargeContentTitle": { "alias": "accessibilityLargeContentTitle"; "required": false; }; "role": { "alias": "role"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; }; "ariaLive": { "alias": "aria-live"; "required": false; }; "ariaHidden": { "alias": "aria-hidden"; "required": false; }; "ariaBusy": { "alias": "aria-busy"; "required": false; }; "ariaChecked": { "alias": "aria-checked"; "required": false; }; "ariaDisabled": { "alias": "aria-disabled"; "required": false; }; "ariaExpanded": { "alias": "aria-expanded"; "required": false; }; "ariaSelected": { "alias": "aria-selected"; "required": false; }; }, { "valueChange": "valueChange"; "change": "change"; "focusEvent": "focus"; "blurEvent": "blur"; "endEditing": "endEditing"; "submitEditing": "submitEditing"; "keyPress": "keyPress"; "selectionChange": "selectionChange"; "contentSizeChange": "contentSizeChange"; "accessibilityAction": "accessibilityAction"; "accessibilityTap": "accessibilityTap"; "magicTap": "magicTap"; "accessibilityEscape": "accessibilityEscape"; }, never, never, true, [{ directive: typeof i1.SymbioteStyleInputDirective; inputs: { "style": "style"; }; outputs: {}; }]>;
153
161
  }