@symbiote-native/angular 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/babel-register-composed.cjs +11 -3
  2. package/build/angular/anchor-host-registry.d.ts +2 -0
  3. package/build/angular/anchor-host-registry.js +84 -0
  4. package/build/angular/anchor-host-registry.js.map +1 -0
  5. package/build/angular/components/input-accessory-view/index.d.ts +2 -1
  6. package/build/angular/components/input-accessory-view/index.js +28 -39
  7. package/build/angular/components/input-accessory-view/index.js.map +1 -1
  8. package/build/angular/components/scroll-view/projection.js +70 -48
  9. package/build/angular/components/scroll-view/projection.js.map +1 -1
  10. package/build/angular/components/scroll-view/shared.js +28 -25
  11. package/build/angular/components/scroll-view/shared.js.map +1 -1
  12. package/build/angular/components/scroll-view/sticky-header.d.ts +6 -7
  13. package/build/angular/components/scroll-view/sticky-header.js +82 -65
  14. package/build/angular/components/scroll-view/sticky-header.js.map +1 -1
  15. package/build/angular/components/touchable/index.d.ts +2 -5
  16. package/build/angular/components/touchable/index.js +36 -56
  17. package/build/angular/components/touchable/index.js.map +1 -1
  18. package/build/angular/components/virtualized-list/index.d.ts +5 -20
  19. package/build/angular/components/virtualized-list/index.js +145 -275
  20. package/build/angular/components/virtualized-list/index.js.map +1 -1
  21. package/build/angular/components/virtualized-section-list/index.js +2 -4
  22. package/build/angular/components/virtualized-section-list/index.js.map +1 -1
  23. package/build/angular/index.d.ts +2 -1
  24. package/build/angular/index.js +6 -1
  25. package/build/angular/index.js.map +1 -1
  26. package/build/angular/renderer/index.d.ts +0 -1
  27. package/build/angular/renderer/index.js +5 -60
  28. package/build/angular/renderer/index.js.map +1 -1
  29. package/package.json +4 -3
  30. package/src/__tests__/responder-nested-cd.test.ts +1 -1
  31. package/src/anchor-host-registry.ts +88 -0
  32. package/src/components/input-accessory-view/index.ts +30 -39
  33. package/src/components/scroll-view/projection.ts +76 -46
  34. package/src/components/scroll-view/shared.ts +27 -19
  35. package/src/components/scroll-view/sticky-header.ts +89 -64
  36. package/src/components/touchable/index.ts +52 -66
  37. package/src/components/virtualized-list/index.ts +157 -368
  38. package/src/components/virtualized-section-list/index.ts +6 -3
  39. package/src/index.ts +6 -1
  40. package/src/renderer/index.ts +5 -63
  41. package/src/renderer/renderer.test.ts +2 -1
  42. package/build/bootstrap.d.ts +0 -7
  43. package/build/bootstrap.js +0 -14
  44. package/build/components/activity-indicator/index.android.d.ts +0 -9
  45. package/build/components/activity-indicator/index.android.js +0 -64
  46. package/build/components/activity-indicator/index.d.ts +0 -1
  47. package/build/components/activity-indicator/index.ios.d.ts +0 -5
  48. package/build/components/activity-indicator/index.ios.js +0 -64
  49. package/build/components/activity-indicator/index.js +0 -3
  50. package/build/components/activity-indicator/shared.d.ts +0 -64
  51. package/build/components/activity-indicator/shared.js +0 -424
  52. package/build/components/button.d.ts +0 -60
  53. package/build/components/button.js +0 -456
  54. package/build/components/flat-list/index.d.ts +0 -119
  55. package/build/components/flat-list/index.js +0 -691
  56. package/build/components/image/index.android.d.ts +0 -7
  57. package/build/components/image/index.android.js +0 -88
  58. package/build/components/image/index.d.ts +0 -1
  59. package/build/components/image/index.ios.d.ts +0 -7
  60. package/build/components/image/index.ios.js +0 -88
  61. package/build/components/image/index.js +0 -2
  62. package/build/components/image/shared.d.ts +0 -101
  63. package/build/components/image/shared.js +0 -405
  64. package/build/components/image-background.d.ts +0 -78
  65. package/build/components/image-background.js +0 -583
  66. package/build/components/input-accessory-view/index.d.ts +0 -56
  67. package/build/components/input-accessory-view/index.js +0 -403
  68. package/build/components/keyboard-avoiding-view/index.d.ts +0 -79
  69. package/build/components/keyboard-avoiding-view/index.js +0 -504
  70. package/build/components/modal/index.d.ts +0 -89
  71. package/build/components/modal/index.js +0 -529
  72. package/build/components/pressable/index.d.ts +0 -120
  73. package/build/components/pressable/index.js +0 -639
  74. package/build/components/refresh-control/index.d.ts +0 -83
  75. package/build/components/refresh-control/index.js +0 -509
  76. package/build/components/safe-area-view/index.d.ts +0 -54
  77. package/build/components/safe-area-view/index.js +0 -388
  78. package/build/components/scroll-view/index.android.d.ts +0 -16
  79. package/build/components/scroll-view/index.android.js +0 -228
  80. package/build/components/scroll-view/index.d.ts +0 -3
  81. package/build/components/scroll-view/index.ios.d.ts +0 -6
  82. package/build/components/scroll-view/index.ios.js +0 -113
  83. package/build/components/scroll-view/index.js +0 -5
  84. package/build/components/scroll-view/projection.d.ts +0 -32
  85. package/build/components/scroll-view/projection.js +0 -311
  86. package/build/components/scroll-view/shared.d.ts +0 -225
  87. package/build/components/scroll-view/shared.js +0 -757
  88. package/build/components/scroll-view/sticky-header.d.ts +0 -38
  89. package/build/components/scroll-view/sticky-header.js +0 -257
  90. package/build/components/section-list/index.d.ts +0 -113
  91. package/build/components/section-list/index.js +0 -768
  92. package/build/components/switch/index.android.d.ts +0 -17
  93. package/build/components/switch/index.android.js +0 -107
  94. package/build/components/switch/index.d.ts +0 -1
  95. package/build/components/switch/index.ios.d.ts +0 -16
  96. package/build/components/switch/index.ios.js +0 -106
  97. package/build/components/switch/index.js +0 -3
  98. package/build/components/switch/shared.d.ts +0 -37
  99. package/build/components/switch/shared.js +0 -176
  100. package/build/components/text-input.d.ts +0 -150
  101. package/build/components/text-input.js +0 -821
  102. package/build/components/touchable/index.d.ts +0 -241
  103. package/build/components/touchable/index.js +0 -1672
  104. package/build/components/touchable-native-feedback/index.d.ts +0 -80
  105. package/build/components/touchable-native-feedback/index.js +0 -545
  106. package/build/components/virtualized-list/directives.d.ts +0 -41
  107. package/build/components/virtualized-list/directives.js +0 -249
  108. package/build/components/virtualized-list/index.d.ts +0 -265
  109. package/build/components/virtualized-list/index.js +0 -1343
  110. package/build/components/virtualized-section-list/directives.d.ts +0 -28
  111. package/build/components/virtualized-section-list/directives.js +0 -148
  112. package/build/components/virtualized-section-list/index.d.ts +0 -175
  113. package/build/components/virtualized-section-list/index.js +0 -854
  114. package/build/components.d.ts +0 -39
  115. package/build/components.js +0 -37
  116. package/build/create-portal/index.d.ts +0 -17
  117. package/build/create-portal/index.js +0 -128
  118. package/build/create-tunnel/index.d.ts +0 -29
  119. package/build/create-tunnel/index.js +0 -181
  120. package/build/descriptor-to-angular/index.d.ts +0 -19
  121. package/build/descriptor-to-angular/index.js +0 -186
  122. package/build/host-instance/index.d.ts +0 -2
  123. package/build/host-instance/index.js +0 -36
  124. package/build/index.d.ts +0 -21
  125. package/build/index.js +0 -40
  126. package/build/modules/animated/animated-leaf-binder/index.d.ts +0 -14
  127. package/build/modules/animated/animated-leaf-binder/index.js +0 -90
  128. package/build/modules/animated/animated-leaf-binder.d.ts +0 -14
  129. package/build/modules/animated/animated-leaf-binder.js +0 -90
  130. package/build/modules/animated/create-animated-component.d.ts +0 -48
  131. package/build/modules/animated/create-animated-component.js +0 -425
  132. package/build/modules/animated/index.d.ts +0 -51
  133. package/build/modules/animated/index.js +0 -58
  134. package/build/modules/app-registry/index.d.ts +0 -7
  135. package/build/modules/app-registry/index.js +0 -22
  136. package/build/modules/status-bar/index.d.ts +0 -17
  137. package/build/modules/status-bar/index.js +0 -121
  138. package/build/primitives/index.d.ts +0 -32
  139. package/build/primitives/index.js +0 -386
  140. package/build/primitives/shared.d.ts +0 -83
  141. package/build/primitives/shared.js +0 -230
  142. package/build/render/index.d.ts +0 -11
  143. package/build/render/index.js +0 -170
  144. package/build/renderer/index.d.ts +0 -38
  145. package/build/renderer/index.js +0 -355
  146. package/build/services/color-scheme.service.d.ts +0 -13
  147. package/build/services/color-scheme.service.js +0 -72
  148. package/build/services/index.d.ts +0 -2
  149. package/build/services/index.js +0 -2
  150. package/build/services/window-dimensions.service.d.ts +0 -13
  151. package/build/services/window-dimensions.service.js +0 -83
@@ -1,17 +0,0 @@
1
- import { SwitchBase } from './shared';
2
- export type { ISwitchProps, ISwitchTrackColor } from './shared';
3
- export declare class Switch extends SwitchBase {
4
- private readonly elementRef;
5
- protected readonly platform: {
6
- snapBackCommand: string;
7
- trackColorProps: (value: boolean, trackColor?: {
8
- false?: string;
9
- true?: string;
10
- }) => {
11
- trackColorForFalse: string | undefined;
12
- trackColorForTrue: string | undefined;
13
- trackTintColor: string | undefined;
14
- };
15
- };
16
- get hostProps(): Record<string, unknown>;
17
- }
@@ -1,107 +0,0 @@
1
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
- var _, done = false;
7
- for (var i = decorators.length - 1; i >= 0; i--) {
8
- var context = {};
9
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
- if (kind === "accessor") {
14
- if (result === void 0) continue;
15
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
- if (_ = accept(result.get)) descriptor.get = _;
17
- if (_ = accept(result.set)) descriptor.set = _;
18
- if (_ = accept(result.init)) initializers.unshift(_);
19
- }
20
- else if (_ = accept(result)) {
21
- if (kind === "field") initializers.unshift(_);
22
- else descriptor[key] = _;
23
- }
24
- }
25
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
- done = true;
27
- };
28
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
- var useValue = arguments.length > 2;
30
- for (var i = 0; i < initializers.length; i++) {
31
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
- }
33
- return useValue ? value : void 0;
34
- };
35
- import { CUSTOM_ELEMENTS_SCHEMA, Component, ElementRef, inject } from '@angular/core';
36
- import { anchorHostStyle, SwitchHost, SymbioteHostPropsDirective } from '../../primitives';
37
- import { SwitchBase } from './shared';
38
- let Switch = (() => {
39
- let _classDecorators = [Component({
40
- selector: 'Switch',
41
- standalone: true,
42
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
43
- imports: [SwitchHost, SymbioteHostPropsDirective],
44
- inputs: [
45
- 'value',
46
- 'disabled',
47
- 'trackColor',
48
- 'thumbColor',
49
- 'ios_backgroundColor',
50
- 'style',
51
- 'nativeID',
52
- 'testID',
53
- 'accessibilityLabel',
54
- 'accessibilityRole',
55
- 'accessibilityState',
56
- 'accessibilityValue',
57
- 'accessibilityHint',
58
- 'accessible',
59
- 'role',
60
- 'aria-label',
61
- 'aria-disabled',
62
- 'aria-checked',
63
- ],
64
- outputs: ['valueChange', 'change'],
65
- template: `
66
- <symbiote-switch
67
- #nativeSwitch="symbioteHost"
68
- [symbioteHostProps]="hostProps"
69
- (change)="handleChange($event, nativeSwitch)"
70
- />
71
- `,
72
- })];
73
- let _classDescriptor;
74
- let _classExtraInitializers = [];
75
- let _classThis;
76
- let _classSuper = SwitchBase;
77
- var Switch = class extends _classSuper {
78
- static { _classThis = this; }
79
- static {
80
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
81
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
82
- Switch = _classThis = _classDescriptor.value;
83
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
84
- __runInitializers(_classThis, _classExtraInitializers);
85
- }
86
- // This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
87
- // onto (see anchorHostStyle's doc comment) — NOT the <symbiote-switch> leaf one level down.
88
- elementRef = inject(ElementRef);
89
- platform = {
90
- snapBackCommand: 'setNativeValue',
91
- trackColorProps: (value, trackColor) => ({
92
- trackColorForFalse: trackColor?.false,
93
- trackColorForTrue: trackColor?.true,
94
- trackTintColor: value ? trackColor?.true : trackColor?.false,
95
- }),
96
- };
97
- // The anchor's class-derived style goes first, then whatever SwitchBase already resolved
98
- // (its own explicit `style` @Input plus the ios_backgroundColor fold), so an explicit [style]
99
- // still beats the ambient class.
100
- get hostProps() {
101
- const props = super.hostProps;
102
- return { ...props, style: [anchorHostStyle(this.elementRef), props['style']] };
103
- }
104
- };
105
- return Switch = _classThis;
106
- })();
107
- export { Switch };
@@ -1 +0,0 @@
1
- export * from './index.ios';
@@ -1,16 +0,0 @@
1
- import { SwitchBase } from './shared';
2
- export type { ISwitchProps, ISwitchTrackColor } from './shared';
3
- export declare class Switch extends SwitchBase {
4
- private readonly elementRef;
5
- protected readonly platform: {
6
- snapBackCommand: string;
7
- trackColorProps: (_value: boolean, trackColor?: {
8
- false?: string;
9
- true?: string;
10
- }) => {
11
- onTintColor: string | undefined;
12
- tintColor: string | undefined;
13
- };
14
- };
15
- get hostProps(): Record<string, unknown>;
16
- }
@@ -1,106 +0,0 @@
1
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
- var _, done = false;
7
- for (var i = decorators.length - 1; i >= 0; i--) {
8
- var context = {};
9
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
- if (kind === "accessor") {
14
- if (result === void 0) continue;
15
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
- if (_ = accept(result.get)) descriptor.get = _;
17
- if (_ = accept(result.set)) descriptor.set = _;
18
- if (_ = accept(result.init)) initializers.unshift(_);
19
- }
20
- else if (_ = accept(result)) {
21
- if (kind === "field") initializers.unshift(_);
22
- else descriptor[key] = _;
23
- }
24
- }
25
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
- done = true;
27
- };
28
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
- var useValue = arguments.length > 2;
30
- for (var i = 0; i < initializers.length; i++) {
31
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
- }
33
- return useValue ? value : void 0;
34
- };
35
- import { CUSTOM_ELEMENTS_SCHEMA, Component, ElementRef, inject } from '@angular/core';
36
- import { anchorHostStyle, SwitchHost, SymbioteHostPropsDirective } from '../../primitives';
37
- import { SwitchBase } from './shared';
38
- let Switch = (() => {
39
- let _classDecorators = [Component({
40
- selector: 'Switch',
41
- standalone: true,
42
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
43
- imports: [SwitchHost, SymbioteHostPropsDirective],
44
- inputs: [
45
- 'value',
46
- 'disabled',
47
- 'trackColor',
48
- 'thumbColor',
49
- 'ios_backgroundColor',
50
- 'style',
51
- 'nativeID',
52
- 'testID',
53
- 'accessibilityLabel',
54
- 'accessibilityRole',
55
- 'accessibilityState',
56
- 'accessibilityValue',
57
- 'accessibilityHint',
58
- 'accessible',
59
- 'role',
60
- 'aria-label',
61
- 'aria-disabled',
62
- 'aria-checked',
63
- ],
64
- outputs: ['valueChange', 'change'],
65
- template: `
66
- <symbiote-switch
67
- #nativeSwitch="symbioteHost"
68
- [symbioteHostProps]="hostProps"
69
- (change)="handleChange($event, nativeSwitch)"
70
- />
71
- `,
72
- })];
73
- let _classDescriptor;
74
- let _classExtraInitializers = [];
75
- let _classThis;
76
- let _classSuper = SwitchBase;
77
- var Switch = class extends _classSuper {
78
- static { _classThis = this; }
79
- static {
80
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
81
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
82
- Switch = _classThis = _classDescriptor.value;
83
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
84
- __runInitializers(_classThis, _classExtraInitializers);
85
- }
86
- // This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
87
- // onto (see anchorHostStyle's doc comment) — NOT the <symbiote-switch> leaf one level down.
88
- elementRef = inject(ElementRef);
89
- platform = {
90
- snapBackCommand: 'setValue',
91
- trackColorProps: (_value, trackColor) => ({
92
- onTintColor: trackColor?.true,
93
- tintColor: trackColor?.false,
94
- }),
95
- };
96
- // The anchor's class-derived style goes first, then whatever SwitchBase already resolved
97
- // (its own explicit `style` @Input plus the ios_backgroundColor fold), so an explicit [style]
98
- // still beats the ambient class.
99
- get hostProps() {
100
- const props = super.hostProps;
101
- return { ...props, style: [anchorHostStyle(this.elementRef), props['style']] };
102
- }
103
- };
104
- return Switch = _classThis;
105
- })();
106
- export { Switch };
@@ -1,3 +0,0 @@
1
- // Base/default Switch. Re-exports the iOS build; Metro picks index.ios.ts / index.android.ts
2
- // in platform bundles. The Angular lifecycle reuses the shared Switch reducer + render fold.
3
- export * from './index.ios';
@@ -1,37 +0,0 @@
1
- import { EventEmitter } from '@angular/core';
2
- import type { ISwitchPlatform, ISwitchProps, ISwitchTrackColor } from '@symbiote-native/components';
3
- import { type ISymbioteEvent, type IStyleProp, type IViewStyle } from '@symbiote-native/engine';
4
- export type { ISwitchProps, ISwitchTrackColor } from '@symbiote-native/components';
5
- 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'>;
6
- type ISwitchHostPlatform = ISwitchPlatform & {
7
- snapBackCommand: string;
8
- };
9
- type IHostProps = Record<string, unknown>;
10
- export declare abstract class SwitchBase implements ISwitchInputs {
11
- readonly valueChange: EventEmitter<boolean>;
12
- readonly change: EventEmitter<ISymbioteEvent>;
13
- value: boolean | undefined;
14
- disabled: boolean | undefined;
15
- trackColor: ISwitchTrackColor | undefined;
16
- thumbColor: string | undefined;
17
- ios_backgroundColor: string | undefined;
18
- style: IStyleProp<IViewStyle> | undefined;
19
- nativeID: string | undefined;
20
- testID: string | undefined;
21
- accessibilityLabel: string | undefined;
22
- accessibilityRole: ISwitchInputs['accessibilityRole'];
23
- accessibilityState: ISwitchInputs['accessibilityState'];
24
- accessibilityValue: ISwitchInputs['accessibilityValue'];
25
- accessibilityHint: string | undefined;
26
- accessible: boolean | undefined;
27
- role: ISwitchInputs['role'];
28
- 'aria-label': string | undefined;
29
- 'aria-disabled': boolean | undefined;
30
- 'aria-checked': boolean | 'mixed' | undefined;
31
- protected abstract readonly platform: ISwitchHostPlatform;
32
- private switchState;
33
- get hostProps(): IHostProps;
34
- handleChange(event: unknown, node: unknown): void;
35
- private snapBackIfNeeded;
36
- private inputProps;
37
- }
@@ -1,176 +0,0 @@
1
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
- var _, done = false;
7
- for (var i = decorators.length - 1; i >= 0; i--) {
8
- var context = {};
9
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
- if (kind === "accessor") {
14
- if (result === void 0) continue;
15
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
- if (_ = accept(result.get)) descriptor.get = _;
17
- if (_ = accept(result.set)) descriptor.set = _;
18
- if (_ = accept(result.init)) initializers.unshift(_);
19
- }
20
- else if (_ = accept(result)) {
21
- if (kind === "field") initializers.unshift(_);
22
- else descriptor[key] = _;
23
- }
24
- }
25
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
- done = true;
27
- };
28
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
- var useValue = arguments.length > 2;
30
- for (var i = 0; i < initializers.length; i++) {
31
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
- }
33
- return useValue ? value : void 0;
34
- };
35
- import { Directive, EventEmitter, Output } from '@angular/core';
36
- import { renderSwitch, resolveAccessibilityProps } from '@symbiote-native/components';
37
- import { createInitialSwitchState, shouldSnapBack, switchReducer, valueFromChange, } from '@symbiote-native/components';
38
- import { dispatchViewCommand, dlog, isSymbioteNode, whenCommitted, } from '@symbiote-native/engine';
39
- function readSwitchNode(value) {
40
- if (isSymbioteNode(value))
41
- return value;
42
- if (typeof value === 'object' &&
43
- value !== null &&
44
- 'node' in value &&
45
- isSymbioteNode(value.node)) {
46
- return value.node;
47
- }
48
- return null;
49
- }
50
- function isSwitchEvent(event) {
51
- return (typeof event === 'object' &&
52
- event !== null &&
53
- 'nativeEvent' in event &&
54
- typeof event.nativeEvent === 'object' &&
55
- event.nativeEvent !== null);
56
- }
57
- // @Directive() (no selector) is the Angular-sanctioned decorator for an abstract base whose
58
- // concrete subclasses are real @Components — ngc's AOT build (NG2007) requires it the moment the
59
- // base itself carries decorated members (@Output() here), mirroring ScrollViewBase.
60
- let SwitchBase = (() => {
61
- let _classDecorators = [Directive()];
62
- let _classDescriptor;
63
- let _classExtraInitializers = [];
64
- let _classThis;
65
- let _valueChange_decorators;
66
- let _valueChange_initializers = [];
67
- let _valueChange_extraInitializers = [];
68
- let _change_decorators;
69
- let _change_initializers = [];
70
- let _change_extraInitializers = [];
71
- var SwitchBase = class {
72
- static { _classThis = this; }
73
- static {
74
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
75
- _valueChange_decorators = [Output()];
76
- _change_decorators = [Output()];
77
- __esDecorate(null, null, _valueChange_decorators, { kind: "field", name: "valueChange", static: false, private: false, access: { has: obj => "valueChange" in obj, get: obj => obj.valueChange, set: (obj, value) => { obj.valueChange = value; } }, metadata: _metadata }, _valueChange_initializers, _valueChange_extraInitializers);
78
- __esDecorate(null, null, _change_decorators, { kind: "field", name: "change", static: false, private: false, access: { has: obj => "change" in obj, get: obj => obj.change, set: (obj, value) => { obj.change = value; } }, metadata: _metadata }, _change_initializers, _change_extraInitializers);
79
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
80
- SwitchBase = _classThis = _classDescriptor.value;
81
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
82
- __runInitializers(_classThis, _classExtraInitializers);
83
- }
84
- // The value/change lifecycle as real Angular events: `(valueChange)="onToggle($event)"`, not
85
- // `[onValueChange]="onToggle"` — mirrors Pressable's press/hover @Output() conversion. Unlike
86
- // Pressable's createPressHandlers, handleChange() below calls `.emit()` unconditionally: it needs
87
- // no "was this bound" adapter because EventEmitter.emit() is already a safe no-op with no subscribers.
88
- valueChange = __runInitializers(this, _valueChange_initializers, new EventEmitter());
89
- change = (__runInitializers(this, _valueChange_extraInitializers), __runInitializers(this, _change_initializers, new EventEmitter()));
90
- value = __runInitializers(this, _change_extraInitializers);
91
- disabled;
92
- trackColor;
93
- thumbColor;
94
- ios_backgroundColor;
95
- style;
96
- nativeID;
97
- testID;
98
- accessibilityLabel;
99
- accessibilityRole;
100
- accessibilityState;
101
- accessibilityValue;
102
- accessibilityHint;
103
- accessible;
104
- role;
105
- 'aria-label';
106
- 'aria-disabled';
107
- 'aria-checked';
108
- switchState = createInitialSwitchState();
109
- get hostProps() {
110
- const props = resolveAccessibilityProps(this.inputProps());
111
- const { value, disabled, trackColor, thumbColor, ios_backgroundColor, style, onValueChange: _onValueChange, ...passthrough } = props;
112
- return renderSwitch({
113
- value: value === true,
114
- disabled,
115
- trackColor,
116
- thumbColor,
117
- ios_backgroundColor,
118
- style,
119
- passthrough,
120
- }, this.platform).props;
121
- }
122
- handleChange(event, node) {
123
- if (!isSwitchEvent(event))
124
- return;
125
- this.change.emit(event);
126
- const next = valueFromChange(event);
127
- dlog(`Switch onChange value=${String(next)} eventCount=${String(event.nativeEvent.eventCount)}`);
128
- if (next === undefined)
129
- return;
130
- this.valueChange.emit(next);
131
- this.switchState = switchReducer(this.switchState, { type: 'native-reported', value: next });
132
- const hostNode = readSwitchNode(node);
133
- if (hostNode === null)
134
- return;
135
- queueMicrotask(() => this.snapBackIfNeeded(hostNode));
136
- }
137
- snapBackIfNeeded(node) {
138
- const fabricValue = this.value === true;
139
- if (!shouldSnapBack(this.switchState, fabricValue)) {
140
- dlog(`Switch snap-back no-op reported=${String(this.switchState.lastNativeReport)} value=${fabricValue}`);
141
- return;
142
- }
143
- dlog(`Switch ${this.platform.snapBackCommand} snap-back reported=${String(this.switchState.lastNativeReport)} value=${fabricValue}`);
144
- whenCommitted(node, () => {
145
- dispatchViewCommand(node, this.platform.snapBackCommand, [fabricValue]);
146
- });
147
- }
148
- inputProps() {
149
- const props = {
150
- value: this.value,
151
- disabled: this.disabled,
152
- trackColor: this.trackColor,
153
- thumbColor: this.thumbColor,
154
- ios_backgroundColor: this.ios_backgroundColor,
155
- style: this.style,
156
- };
157
- return {
158
- ...props,
159
- nativeID: this.nativeID,
160
- testID: this.testID,
161
- accessibilityLabel: this.accessibilityLabel,
162
- accessibilityRole: this.accessibilityRole,
163
- accessibilityState: this.accessibilityState,
164
- accessibilityValue: this.accessibilityValue,
165
- accessibilityHint: this.accessibilityHint,
166
- accessible: this.accessible,
167
- role: this.role,
168
- 'aria-label': this['aria-label'],
169
- 'aria-disabled': this['aria-disabled'],
170
- 'aria-checked': this['aria-checked'],
171
- };
172
- }
173
- };
174
- return SwitchBase = _classThis;
175
- })();
176
- export { SwitchBase };
@@ -1,150 +0,0 @@
1
- import { EventEmitter, type AfterViewInit, type OnChanges, type OnDestroy, type SimpleChanges } from '@angular/core';
2
- import { type IAccessibilityProps, type IAccessibilityStateValue, type IAriaProps, type IEnterKeyHint, type IInputMode, type ISubmitBehavior, type ITextInputEventHandler, type ITextInputHandle, type ITextInputSelection } from '@symbiote-native/components';
3
- import { type IStyleProp, type ISymbioteEvent, type ITextStyle } from '@symbiote-native/engine';
4
- export type { ITextInputHandle, ITextInputSelection, IInputMode, IEnterKeyHint, ISubmitBehavior };
5
- export interface IAngularTextInputProps extends IAccessibilityProps, IAriaProps {
6
- value?: string;
7
- defaultValue?: string;
8
- placeholder?: string;
9
- placeholderTextColor?: string;
10
- editable?: boolean;
11
- keyboardType?: string;
12
- secureTextEntry?: boolean;
13
- maxLength?: number;
14
- multiline?: boolean;
15
- selection?: ITextInputSelection;
16
- autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters';
17
- autoCorrect?: boolean;
18
- autoComplete?: string;
19
- textContentType?: string;
20
- autoFocus?: boolean;
21
- showSoftInputOnFocus?: boolean;
22
- returnKeyType?: string;
23
- selectTextOnFocus?: boolean;
24
- scrollEnabled?: boolean;
25
- numberOfLines?: number;
26
- textAlign?: 'left' | 'center' | 'right';
27
- blurOnSubmit?: boolean;
28
- inputMode?: IInputMode;
29
- enterKeyHint?: IEnterKeyHint;
30
- readOnly?: boolean;
31
- submitBehavior?: ISubmitBehavior;
32
- cursorColor?: string;
33
- selectionColor?: string;
34
- selectionHandleColor?: string;
35
- underlineColorAndroid?: string;
36
- inputAccessoryViewID?: string;
37
- style?: IStyleProp<ITextStyle>;
38
- onValueChange?: (text: string) => void;
39
- onChange?: ITextInputEventHandler;
40
- onFocus?: ITextInputEventHandler;
41
- onBlur?: ITextInputEventHandler;
42
- onEndEditing?: ITextInputEventHandler;
43
- onSubmitEditing?: ITextInputEventHandler;
44
- onKeyPress?: ITextInputEventHandler;
45
- onSelectionChange?: ITextInputEventHandler;
46
- onContentSizeChange?: ITextInputEventHandler;
47
- }
48
- export type IAngularTextInputInputs = Omit<IAngularTextInputProps, 'onValueChange' | 'onChange' | 'onFocus' | 'onBlur' | 'onEndEditing' | 'onSubmitEditing' | 'onKeyPress' | 'onSelectionChange' | 'onContentSizeChange' | 'onAccessibilityAction' | 'onAccessibilityTap' | 'onMagicTap' | 'onAccessibilityEscape'>;
49
- export declare class TextInput implements IAngularTextInputInputs, ITextInputHandle, OnChanges, AfterViewInit, OnDestroy {
50
- value?: string;
51
- defaultValue?: string;
52
- placeholder?: string;
53
- placeholderTextColor?: string;
54
- editable?: boolean;
55
- keyboardType?: string;
56
- secureTextEntry?: boolean;
57
- maxLength?: number;
58
- multiline?: boolean;
59
- selection?: ITextInputSelection;
60
- autoCapitalize?: IAngularTextInputProps['autoCapitalize'];
61
- autoCorrect?: boolean;
62
- autoComplete?: string;
63
- textContentType?: string;
64
- autoFocus?: boolean;
65
- showSoftInputOnFocus?: boolean;
66
- returnKeyType?: string;
67
- selectTextOnFocus?: boolean;
68
- scrollEnabled?: boolean;
69
- numberOfLines?: number;
70
- textAlign?: IAngularTextInputProps['textAlign'];
71
- blurOnSubmit?: boolean;
72
- inputMode?: IInputMode;
73
- enterKeyHint?: IEnterKeyHint;
74
- readOnly?: boolean;
75
- submitBehavior?: ISubmitBehavior;
76
- cursorColor?: string;
77
- selectionColor?: string;
78
- selectionHandleColor?: string;
79
- underlineColorAndroid?: string;
80
- inputAccessoryViewID?: string;
81
- style?: IStyleProp<ITextStyle>;
82
- testID?: string;
83
- nativeID?: string;
84
- readonly valueChange: EventEmitter<string>;
85
- readonly change: EventEmitter<ISymbioteEvent>;
86
- readonly focusEvent: EventEmitter<ISymbioteEvent>;
87
- readonly blurEvent: EventEmitter<ISymbioteEvent>;
88
- readonly endEditing: EventEmitter<ISymbioteEvent>;
89
- readonly submitEditing: EventEmitter<ISymbioteEvent>;
90
- readonly keyPress: EventEmitter<ISymbioteEvent>;
91
- readonly selectionChange: EventEmitter<ISymbioteEvent>;
92
- readonly contentSizeChange: EventEmitter<ISymbioteEvent>;
93
- readonly accessibilityAction: EventEmitter<ISymbioteEvent>;
94
- readonly accessibilityTap: EventEmitter<ISymbioteEvent>;
95
- readonly magicTap: EventEmitter<ISymbioteEvent>;
96
- readonly accessibilityEscape: EventEmitter<ISymbioteEvent>;
97
- accessible?: boolean;
98
- accessibilityLabel?: string;
99
- accessibilityHint?: string;
100
- accessibilityRole?: IAccessibilityProps['accessibilityRole'];
101
- accessibilityState?: IAccessibilityStateValue;
102
- accessibilityValue?: IAccessibilityProps['accessibilityValue'];
103
- accessibilityActions?: IAccessibilityProps['accessibilityActions'];
104
- accessibilityLabelledBy?: string | string[];
105
- importantForAccessibility?: IAccessibilityProps['importantForAccessibility'];
106
- accessibilityLiveRegion?: IAccessibilityProps['accessibilityLiveRegion'];
107
- screenReaderFocusable?: boolean;
108
- accessibilityViewIsModal?: boolean;
109
- accessibilityElementsHidden?: boolean;
110
- accessibilityIgnoresInvertColors?: boolean;
111
- accessibilityLanguage?: string;
112
- accessibilityRespondsToUserInteraction?: boolean;
113
- accessibilityShowsLargeContentViewer?: boolean;
114
- accessibilityLargeContentTitle?: string;
115
- role?: IAriaProps['role'];
116
- ariaLabel?: string;
117
- ariaLabelledBy?: string;
118
- ariaLive?: IAriaProps['aria-live'];
119
- ariaHidden?: boolean;
120
- ariaBusy?: boolean;
121
- ariaChecked?: boolean | 'mixed';
122
- ariaDisabled?: boolean;
123
- ariaExpanded?: boolean;
124
- ariaSelected?: boolean;
125
- private hostRef?;
126
- private readonly elementRef;
127
- private mostRecentEventCount;
128
- private lastNativeText;
129
- private focused;
130
- private cancelAutoFocus?;
131
- get isMultiline(): boolean;
132
- get hostProps(): Record<string, unknown>;
133
- ngOnChanges(changes: SimpleChanges): void;
134
- ngAfterViewInit(): void;
135
- ngOnDestroy(): void;
136
- handleChange(event: unknown): void;
137
- handleFocus(event: unknown): void;
138
- handleBlur(event: unknown): void;
139
- emit(emitter: EventEmitter<ISymbioteEvent>, event: unknown): void;
140
- focus(): void;
141
- blur(): void;
142
- clear(): void;
143
- isFocused(): boolean;
144
- setSelection(start: number, end: number): void;
145
- private commitControlledValue;
146
- private buildPassthrough;
147
- private get foldedNativeProps();
148
- private get foldedAccessibility();
149
- private get hostNode();
150
- }