@angular/core 18.0.0-next.4 → 18.0.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/src/application/application_ref.mjs +4 -2
- package/esm2022/src/change_detection/scheduling/flags.mjs +10 -0
- package/esm2022/src/change_detection/scheduling/ng_zone_scheduling.mjs +18 -33
- package/esm2022/src/change_detection/scheduling/zoneless_scheduling.mjs +1 -1
- package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +64 -7
- package/esm2022/src/core.mjs +2 -1
- package/esm2022/src/core_private_export.mjs +1 -3
- package/esm2022/src/debug/debug_node.mjs +1 -1
- package/esm2022/src/metadata/directives.mjs +1 -62
- package/esm2022/src/platform/platform_ref.mjs +3 -3
- package/esm2022/src/render3/component_ref.mjs +1 -1
- package/esm2022/src/render3/instructions/control_flow.mjs +6 -6
- package/esm2022/src/testability/testability.mjs +2 -30
- package/esm2022/src/util/callback_scheduler.mjs +3 -3
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/component_fixture.mjs +7 -12
- package/esm2022/testing/src/logger.mjs +3 -3
- package/esm2022/testing/src/test_bed_common.mjs +1 -6
- package/esm2022/testing/src/testing.mjs +1 -2
- package/event-dispatch-contract.min.js +1 -0
- package/fesm2022/core.mjs +99 -142
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +34 -44
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +127 -105
- package/package.json +4 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/block-template-entities/bundle.js +27 -72
- package/schematics/migrations/block-template-entities/bundle.js.map +3 -3
- package/schematics/migrations/invalid-two-way-bindings/bundle.js +32 -77
- package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +3 -3
- package/schematics/ng-generate/control-flow-migration/bundle.js +27 -73
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +3 -3
- package/schematics/ng-generate/standalone-migration/bundle.js +54 -87
- package/schematics/ng-generate/standalone-migration/bundle.js.map +3 -3
- package/testing/index.d.ts +1 -7
- package/esm2022/testing/src/private_export.mjs +0 -9
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v18.0.0-next.
|
|
2
|
+
* @license Angular v18.0.0-next.5
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -639,7 +639,6 @@ export declare class ApplicationModule {
|
|
|
639
639
|
* @publicApi
|
|
640
640
|
*/
|
|
641
641
|
export declare class ApplicationRef {
|
|
642
|
-
private _runningTick;
|
|
643
642
|
private _destroyed;
|
|
644
643
|
private _destroyListeners;
|
|
645
644
|
private readonly internalErrorHandler;
|
|
@@ -647,7 +646,6 @@ export declare class ApplicationRef {
|
|
|
647
646
|
private readonly zonelessEnabled;
|
|
648
647
|
private externalTestViews;
|
|
649
648
|
private beforeRender;
|
|
650
|
-
private afterTick;
|
|
651
649
|
/**
|
|
652
650
|
* Indicates whether this instance was destroyed.
|
|
653
651
|
*/
|
|
@@ -961,6 +959,19 @@ export declare interface BootstrapOptions {
|
|
|
961
959
|
*
|
|
962
960
|
*/
|
|
963
961
|
ngZoneRunCoalescing?: boolean;
|
|
962
|
+
/**
|
|
963
|
+
* When false, change detection is scheduled when Angular receives
|
|
964
|
+
* a clear indication that templates need to be refreshed. This includes:
|
|
965
|
+
*
|
|
966
|
+
* - calling `ChangeDetectorRef.markForCheck`
|
|
967
|
+
* - calling `ComponentRef.setInput`
|
|
968
|
+
* - updating a signal that is read in a template
|
|
969
|
+
* - when bound host or template listeners are triggered
|
|
970
|
+
* - attaching a view that is marked dirty
|
|
971
|
+
* - removing a view
|
|
972
|
+
* - registering a render hook (templates are only refreshed if render hooks do one of the above)
|
|
973
|
+
*/
|
|
974
|
+
ignoreChangesOutsideZone?: boolean;
|
|
964
975
|
}
|
|
965
976
|
|
|
966
977
|
|
|
@@ -4585,67 +4596,6 @@ export declare interface HostListener {
|
|
|
4585
4596
|
}
|
|
4586
4597
|
|
|
4587
4598
|
/**
|
|
4588
|
-
* Decorator that binds a DOM event to a host listener and supplies configuration metadata.
|
|
4589
|
-
* Angular invokes the supplied handler method when the host element emits the specified event,
|
|
4590
|
-
* and updates the bound element with the result.
|
|
4591
|
-
*
|
|
4592
|
-
* If the handler method returns false, applies `preventDefault` on the bound element.
|
|
4593
|
-
*
|
|
4594
|
-
* @usageNotes
|
|
4595
|
-
*
|
|
4596
|
-
* The following example declares a directive
|
|
4597
|
-
* that attaches a click listener to a button and counts clicks.
|
|
4598
|
-
*
|
|
4599
|
-
* ```ts
|
|
4600
|
-
* @Directive({selector: 'button[counting]'})
|
|
4601
|
-
* class CountClicks {
|
|
4602
|
-
* numberOfClicks = 0;
|
|
4603
|
-
*
|
|
4604
|
-
* @HostListener('click', ['$event.target'])
|
|
4605
|
-
* onClick(btn) {
|
|
4606
|
-
* console.log('button', btn, 'number of clicks:', this.numberOfClicks++);
|
|
4607
|
-
* }
|
|
4608
|
-
* }
|
|
4609
|
-
*
|
|
4610
|
-
* @Component({
|
|
4611
|
-
* selector: 'app',
|
|
4612
|
-
* template: '<button counting>Increment</button>',
|
|
4613
|
-
* })
|
|
4614
|
-
* class App {}
|
|
4615
|
-
*
|
|
4616
|
-
* ```
|
|
4617
|
-
*
|
|
4618
|
-
* The following example registers another DOM event handler that listens for `Enter` key-press
|
|
4619
|
-
* events on the global `window`.
|
|
4620
|
-
* ``` ts
|
|
4621
|
-
* import { HostListener, Component } from "@angular/core";
|
|
4622
|
-
*
|
|
4623
|
-
* @Component({
|
|
4624
|
-
* selector: 'app',
|
|
4625
|
-
* template: `<h1>Hello, you have pressed enter {{counter}} number of times!</h1> Press enter key
|
|
4626
|
-
* to increment the counter.
|
|
4627
|
-
* <button (click)="resetCounter()">Reset Counter</button>`
|
|
4628
|
-
* })
|
|
4629
|
-
* class AppComponent {
|
|
4630
|
-
* counter = 0;
|
|
4631
|
-
* @HostListener('window:keydown.enter', ['$event'])
|
|
4632
|
-
* handleKeyDown(event: KeyboardEvent) {
|
|
4633
|
-
* this.counter++;
|
|
4634
|
-
* }
|
|
4635
|
-
* resetCounter() {
|
|
4636
|
-
* this.counter = 0;
|
|
4637
|
-
* }
|
|
4638
|
-
* }
|
|
4639
|
-
* ```
|
|
4640
|
-
* The list of valid key names for `keydown` and `keyup` events
|
|
4641
|
-
* can be found here:
|
|
4642
|
-
* https://www.w3.org/TR/DOM-Level-3-Events-key/#named-key-attribute-values
|
|
4643
|
-
*
|
|
4644
|
-
* Note that keys can also be combined, e.g. `@HostListener('keydown.shift.a')`.
|
|
4645
|
-
*
|
|
4646
|
-
* The global target names that can be used to prefix an event name are
|
|
4647
|
-
* `document:`, `window:` and `body:`.
|
|
4648
|
-
*
|
|
4649
4599
|
* @Annotation
|
|
4650
4600
|
* @publicApi
|
|
4651
4601
|
*/
|
|
@@ -4665,6 +4615,60 @@ export declare interface HostListenerDecorator {
|
|
|
4665
4615
|
* and updates the bound element with the result.
|
|
4666
4616
|
*
|
|
4667
4617
|
* If the handler method returns false, applies `preventDefault` on the bound element.
|
|
4618
|
+
*
|
|
4619
|
+
* @usageNotes
|
|
4620
|
+
*
|
|
4621
|
+
* The following example declares a directive
|
|
4622
|
+
* that attaches a click listener to a button and counts clicks.
|
|
4623
|
+
*
|
|
4624
|
+
* ```ts
|
|
4625
|
+
* @Directive({selector: 'button[counting]'})
|
|
4626
|
+
* class CountClicks {
|
|
4627
|
+
* numberOfClicks = 0;
|
|
4628
|
+
*
|
|
4629
|
+
* @HostListener('click', ['$event.target'])
|
|
4630
|
+
* onClick(btn) {
|
|
4631
|
+
* console.log('button', btn, 'number of clicks:', this.numberOfClicks++);
|
|
4632
|
+
* }
|
|
4633
|
+
* }
|
|
4634
|
+
*
|
|
4635
|
+
* @Component({
|
|
4636
|
+
* selector: 'app',
|
|
4637
|
+
* template: '<button counting>Increment</button>',
|
|
4638
|
+
* })
|
|
4639
|
+
* class App {}
|
|
4640
|
+
* ```
|
|
4641
|
+
*
|
|
4642
|
+
* The following example registers another DOM event handler that listens for `Enter` key-press
|
|
4643
|
+
* events on the global `window`.
|
|
4644
|
+
* ```ts
|
|
4645
|
+
* import { HostListener, Component } from "@angular/core";
|
|
4646
|
+
*
|
|
4647
|
+
* @Component({
|
|
4648
|
+
* selector: 'app',
|
|
4649
|
+
* template: `<h1>Hello, you have pressed enter {{counter}} number of times!</h1> Press enter
|
|
4650
|
+
* key to increment the counter. <button (click)="resetCounter()">Reset Counter</button>`
|
|
4651
|
+
* })
|
|
4652
|
+
* class AppComponent {
|
|
4653
|
+
* counter = 0;
|
|
4654
|
+
* @HostListener('window:keydown.enter', ['$event'])
|
|
4655
|
+
* handleKeyDown(event: KeyboardEvent) {
|
|
4656
|
+
* this.counter++;
|
|
4657
|
+
* }
|
|
4658
|
+
* resetCounter() {
|
|
4659
|
+
* this.counter = 0;
|
|
4660
|
+
* }
|
|
4661
|
+
* }
|
|
4662
|
+
* ```
|
|
4663
|
+
* The list of valid key names for `keydown` and `keyup` events
|
|
4664
|
+
* can be found here:
|
|
4665
|
+
* https://www.w3.org/TR/DOM-Level-3-Events-key/#named-key-attribute-values
|
|
4666
|
+
*
|
|
4667
|
+
* Note that keys can also be combined, e.g. `@HostListener('keydown.shift.a')`.
|
|
4668
|
+
*
|
|
4669
|
+
* The global target names that can be used to prefix an event name are
|
|
4670
|
+
* `document:`, `window:` and `body:`.
|
|
4671
|
+
*
|
|
4668
4672
|
*/
|
|
4669
4673
|
(eventName: string, args?: string[]): any;
|
|
4670
4674
|
new (eventName: string, args?: string[]): any;
|
|
@@ -7476,6 +7480,19 @@ export declare interface NgZoneOptions {
|
|
|
7476
7480
|
*
|
|
7477
7481
|
*/
|
|
7478
7482
|
runCoalescing?: boolean;
|
|
7483
|
+
/**
|
|
7484
|
+
* When false, change detection is scheduled when Angular receives
|
|
7485
|
+
* a clear indication that templates need to be refreshed. This includes:
|
|
7486
|
+
*
|
|
7487
|
+
* - calling `ChangeDetectorRef.markForCheck`
|
|
7488
|
+
* - calling `ComponentRef.setInput`
|
|
7489
|
+
* - updating a signal that is read in a template
|
|
7490
|
+
* - when bound host or template listeners are triggered
|
|
7491
|
+
* - attaching a view that is marked dirty
|
|
7492
|
+
* - removing a view
|
|
7493
|
+
* - registering a render hook (templates are only refreshed if render hooks do one of the above)
|
|
7494
|
+
*/
|
|
7495
|
+
ignoreChangesOutsideZone?: boolean;
|
|
7479
7496
|
}
|
|
7480
7497
|
|
|
7481
7498
|
/**
|
|
@@ -8060,9 +8077,7 @@ declare interface PlatformReflectionCapabilities {
|
|
|
8060
8077
|
*
|
|
8061
8078
|
* @publicApi
|
|
8062
8079
|
*/
|
|
8063
|
-
export declare
|
|
8064
|
-
(value: T): boolean;
|
|
8065
|
-
}
|
|
8080
|
+
export declare type Predicate<T> = (value: T) => boolean;
|
|
8066
8081
|
|
|
8067
8082
|
declare const PREORDER_HOOK_FLAGS = 17;
|
|
8068
8083
|
|
|
@@ -8097,6 +8112,47 @@ declare type ProcessProvidersFunction = (providers: Provider[]) => Provider[];
|
|
|
8097
8112
|
*/
|
|
8098
8113
|
declare type ProjectionSlots = (ɵCssSelectorList | '*')[];
|
|
8099
8114
|
|
|
8115
|
+
/**
|
|
8116
|
+
* Provides change detection without ZoneJS for the application bootstrapped using
|
|
8117
|
+
* `bootstrapApplication`.
|
|
8118
|
+
*
|
|
8119
|
+
* This function allows you to configure the application to not use the state/state changes of
|
|
8120
|
+
* ZoneJS to schedule change detection in the application. This will work when ZoneJS is not present
|
|
8121
|
+
* on the page at all or if it exists because something else is using it (either another Angular
|
|
8122
|
+
* application which uses ZoneJS for scheduling or some other library that relies on ZoneJS).
|
|
8123
|
+
*
|
|
8124
|
+
* This can also be added to the `TestBed` providers to configure the test environment to more
|
|
8125
|
+
* closely match production behavior. This will help give higher confidence that components are
|
|
8126
|
+
* compatible with zoneless change detection.
|
|
8127
|
+
*
|
|
8128
|
+
* ZoneJS uses browser events to trigger change detection. When using this provider, Angular will
|
|
8129
|
+
* instead use Angular APIs to schedule change detection. These APIs include:
|
|
8130
|
+
*
|
|
8131
|
+
* - `ChangeDetectorRef.markForCheck`
|
|
8132
|
+
* - `ComponentRef.setInput`
|
|
8133
|
+
* - updating a signal that is read in a template
|
|
8134
|
+
* - when bound host or template listeners are triggered
|
|
8135
|
+
* - attaching a view that was marked dirty by one of the above
|
|
8136
|
+
* - removing a view
|
|
8137
|
+
* - registering a render hook (templates are only refreshed if render hooks do one of the above)
|
|
8138
|
+
*
|
|
8139
|
+
* @usageNotes
|
|
8140
|
+
* ```typescript
|
|
8141
|
+
* bootstrapApplication(MyApp, {providers: [
|
|
8142
|
+
* provideExperimentalZonelessChangeDetection(),
|
|
8143
|
+
* ]});
|
|
8144
|
+
* ```
|
|
8145
|
+
*
|
|
8146
|
+
* This API is experimental. Neither the shape, nor the underlying behavior is stable and can change
|
|
8147
|
+
* in patch versions. There are known feature gaps, including the lack of a public zoneless API
|
|
8148
|
+
* which prevents the application from serializing too early with SSR.
|
|
8149
|
+
*
|
|
8150
|
+
* @publicApi
|
|
8151
|
+
* @experimental
|
|
8152
|
+
* @see {@link bootstrapApplication}
|
|
8153
|
+
*/
|
|
8154
|
+
export declare function provideExperimentalZonelessChangeDetection(): EnvironmentProviders;
|
|
8155
|
+
|
|
8100
8156
|
/**
|
|
8101
8157
|
* Describes how the `Injector` should be configured.
|
|
8102
8158
|
* @see [Dependency Injection Guide](guide/di/dependency-injection.
|
|
@@ -9624,22 +9680,11 @@ declare const TEMPLATES = "t";
|
|
|
9624
9680
|
export declare class Testability implements PublicTestability {
|
|
9625
9681
|
private _ngZone;
|
|
9626
9682
|
private registry;
|
|
9627
|
-
private _pendingCount;
|
|
9628
9683
|
private _isZoneStable;
|
|
9629
9684
|
private _callbacks;
|
|
9630
9685
|
private taskTrackingZone;
|
|
9631
9686
|
constructor(_ngZone: NgZone, registry: TestabilityRegistry, testabilityGetter: GetTestability);
|
|
9632
9687
|
private _watchAngularEvents;
|
|
9633
|
-
/**
|
|
9634
|
-
* Increases the number of pending request
|
|
9635
|
-
* @deprecated pending requests are now tracked with zones.
|
|
9636
|
-
*/
|
|
9637
|
-
increasePendingRequestCount(): number;
|
|
9638
|
-
/**
|
|
9639
|
-
* Decreases the number of pending request
|
|
9640
|
-
* @deprecated pending requests are now tracked with zones
|
|
9641
|
-
*/
|
|
9642
|
-
decreasePendingRequestCount(): number;
|
|
9643
9688
|
/**
|
|
9644
9689
|
* Whether an associated application is stable
|
|
9645
9690
|
*/
|
|
@@ -9660,11 +9705,6 @@ export declare class Testability implements PublicTestability {
|
|
|
9660
9705
|
* and no further updates will be issued.
|
|
9661
9706
|
*/
|
|
9662
9707
|
whenStable(doneCb: Function, timeout?: number, updateCb?: Function): void;
|
|
9663
|
-
/**
|
|
9664
|
-
* Get the number of pending requests
|
|
9665
|
-
* @deprecated pending requests are now tracked with zones
|
|
9666
|
-
*/
|
|
9667
|
-
getPendingRequestCount(): number;
|
|
9668
9708
|
/**
|
|
9669
9709
|
* Find providers by name
|
|
9670
9710
|
* @param using The root element to search from
|
|
@@ -11942,7 +11982,7 @@ export declare const enum ɵBypassType {
|
|
|
11942
11982
|
*/
|
|
11943
11983
|
export declare abstract class ɵChangeDetectionScheduler {
|
|
11944
11984
|
abstract notify(source?: NotificationType): void;
|
|
11945
|
-
abstract
|
|
11985
|
+
abstract runningTick: boolean;
|
|
11946
11986
|
}
|
|
11947
11987
|
|
|
11948
11988
|
export declare function ɵclearResolutionOfComponentResourcesQueue(): Map<Type<any>, Component>;
|
|
@@ -13145,8 +13185,6 @@ export declare interface ɵProviderRecord {
|
|
|
13145
13185
|
importPath?: Type<unknown>[];
|
|
13146
13186
|
}
|
|
13147
13187
|
|
|
13148
|
-
export declare function ɵprovideZonelessChangeDetection(): EnvironmentProviders;
|
|
13149
|
-
|
|
13150
13188
|
/**
|
|
13151
13189
|
* Queue a state update to be performed asynchronously.
|
|
13152
13190
|
*
|
|
@@ -13487,23 +13525,6 @@ export declare interface ɵSafeUrl extends ɵSafeValue {
|
|
|
13487
13525
|
export declare interface ɵSafeValue {
|
|
13488
13526
|
}
|
|
13489
13527
|
|
|
13490
|
-
/**
|
|
13491
|
-
* Configures change detection scheduling when using ZoneJS.
|
|
13492
|
-
*/
|
|
13493
|
-
export declare enum ɵSchedulingMode {
|
|
13494
|
-
/**
|
|
13495
|
-
* Change detection will run when the `NgZone.onMicrotaskEmpty` observable emits.
|
|
13496
|
-
* Change detection will also be scheduled to run whenever Angular is notified
|
|
13497
|
-
* of a change. This includes calling `ChangeDetectorRef.markForCheck`,
|
|
13498
|
-
* setting a `signal` value, and attaching a view.
|
|
13499
|
-
*/
|
|
13500
|
-
Hybrid = 0,
|
|
13501
|
-
/**
|
|
13502
|
-
* Change detection will only run when the `NgZone.onMicrotaskEmpty` observable emits.
|
|
13503
|
-
*/
|
|
13504
|
-
NgZoneOnly = 1
|
|
13505
|
-
}
|
|
13506
|
-
|
|
13507
13528
|
/**
|
|
13508
13529
|
* Control whether the NgModule registration system enforces that each NgModule type registered has
|
|
13509
13530
|
* a unique id.
|
|
@@ -14629,11 +14650,12 @@ export declare function ɵɵcomponentInstance(): unknown;
|
|
|
14629
14650
|
* built-in "if" and "switch". On the high level this instruction is responsible for adding and
|
|
14630
14651
|
* removing views selected by a conditional expression.
|
|
14631
14652
|
*
|
|
14632
|
-
* @param matchingTemplateIndex
|
|
14653
|
+
* @param matchingTemplateIndex Index of a template TNode representing a conditional view to be
|
|
14633
14654
|
* inserted; -1 represents a special case when there is no view to insert.
|
|
14655
|
+
* @param contextValue Value that should be exposed as the context of the conditional.
|
|
14634
14656
|
* @codeGenApi
|
|
14635
14657
|
*/
|
|
14636
|
-
export declare function ɵɵconditional<T>(
|
|
14658
|
+
export declare function ɵɵconditional<T>(matchingTemplateIndex: number, contextValue?: T): void;
|
|
14637
14659
|
|
|
14638
14660
|
/**
|
|
14639
14661
|
* Registers a QueryList, associated with a content query, for later refresh (part of a view
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/core",
|
|
3
|
-
"version": "18.0.0-next.
|
|
3
|
+
"version": "18.0.0-next.5",
|
|
4
4
|
"description": "Angular - the core framework",
|
|
5
5
|
"author": "angular",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
"./schematics/*": {
|
|
12
12
|
"default": "./schematics/*.js"
|
|
13
13
|
},
|
|
14
|
+
"./event-dispatch-contract.min.js": {
|
|
15
|
+
"default": "./event-dispatch-contract.min.js"
|
|
16
|
+
},
|
|
14
17
|
"./package.json": {
|
|
15
18
|
"default": "./package.json"
|
|
16
19
|
},
|
package/rxjs-interop/index.d.ts
CHANGED
|
@@ -6280,11 +6280,10 @@ function createAdvanceOp(delta, sourceSpan) {
|
|
|
6280
6280
|
sourceSpan
|
|
6281
6281
|
}, NEW_OP);
|
|
6282
6282
|
}
|
|
6283
|
-
function createConditionalOp(target,
|
|
6283
|
+
function createConditionalOp(target, test, conditions, sourceSpan) {
|
|
6284
6284
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
6285
6285
|
kind: OpKind.Conditional,
|
|
6286
6286
|
target,
|
|
6287
|
-
targetSlot,
|
|
6288
6287
|
test,
|
|
6289
6288
|
conditions,
|
|
6290
6289
|
processed: null,
|
|
@@ -16547,19 +16546,7 @@ function pipeBindV(slot, varOffset, args) {
|
|
|
16547
16546
|
]);
|
|
16548
16547
|
}
|
|
16549
16548
|
function textInterpolate(strings, expressions, sourceSpan) {
|
|
16550
|
-
|
|
16551
|
-
throw new Error(`AssertionError: expected specific shape of args for strings/expressions in interpolation`);
|
|
16552
|
-
}
|
|
16553
|
-
const interpolationArgs = [];
|
|
16554
|
-
if (expressions.length === 1 && strings[0] === "" && strings[1] === "") {
|
|
16555
|
-
interpolationArgs.push(expressions[0]);
|
|
16556
|
-
} else {
|
|
16557
|
-
let idx;
|
|
16558
|
-
for (idx = 0; idx < expressions.length; idx++) {
|
|
16559
|
-
interpolationArgs.push(literal(strings[idx]), expressions[idx]);
|
|
16560
|
-
}
|
|
16561
|
-
interpolationArgs.push(literal(strings[idx]));
|
|
16562
|
-
}
|
|
16549
|
+
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
16563
16550
|
return callVariadicInstruction(TEXT_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
|
|
16564
16551
|
}
|
|
16565
16552
|
function i18nExp(expr, sourceSpan) {
|
|
@@ -16636,8 +16623,8 @@ function call(instruction, args, sourceSpan) {
|
|
|
16636
16623
|
const expr = importExpr(instruction).callFn(args, sourceSpan);
|
|
16637
16624
|
return createStatementOp(new ExpressionStatement(expr, sourceSpan));
|
|
16638
16625
|
}
|
|
16639
|
-
function conditional(
|
|
16640
|
-
const args = [
|
|
16626
|
+
function conditional(condition, contextValue, sourceSpan) {
|
|
16627
|
+
const args = [condition];
|
|
16641
16628
|
if (contextValue !== null) {
|
|
16642
16629
|
args.push(contextValue);
|
|
16643
16630
|
}
|
|
@@ -17063,10 +17050,7 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
17063
17050
|
if (op.processed === null) {
|
|
17064
17051
|
throw new Error(`Conditional test was not set.`);
|
|
17065
17052
|
}
|
|
17066
|
-
|
|
17067
|
-
throw new Error(`Conditional slot was not set.`);
|
|
17068
|
-
}
|
|
17069
|
-
OpList.replace(op, conditional(op.targetSlot.slot, op.processed, op.contextValue, op.sourceSpan));
|
|
17053
|
+
OpList.replace(op, conditional(op.processed, op.contextValue, op.sourceSpan));
|
|
17070
17054
|
break;
|
|
17071
17055
|
case OpKind.Repeater:
|
|
17072
17056
|
OpList.replace(op, repeater(op.collection, op.sourceSpan));
|
|
@@ -17648,49 +17632,22 @@ function transformTwoWayBindingSet(job) {
|
|
|
17648
17632
|
for (const op of unit.create) {
|
|
17649
17633
|
if (op.kind === OpKind.TwoWayListener) {
|
|
17650
17634
|
transformExpressionsInOp(op, (expr) => {
|
|
17651
|
-
if (expr instanceof TwoWayBindingSetExpr) {
|
|
17652
|
-
return
|
|
17635
|
+
if (!(expr instanceof TwoWayBindingSetExpr)) {
|
|
17636
|
+
return expr;
|
|
17653
17637
|
}
|
|
17654
|
-
|
|
17638
|
+
const { target, value } = expr;
|
|
17639
|
+
if (target instanceof ReadPropExpr || target instanceof ReadKeyExpr) {
|
|
17640
|
+
return twoWayBindingSet(target, value).or(target.set(value));
|
|
17641
|
+
}
|
|
17642
|
+
if (target instanceof ReadVariableExpr) {
|
|
17643
|
+
return twoWayBindingSet(target, value);
|
|
17644
|
+
}
|
|
17645
|
+
throw new Error(`Unsupported expression in two-way action binding.`);
|
|
17655
17646
|
}, VisitorContextFlag.InChildOperation);
|
|
17656
17647
|
}
|
|
17657
17648
|
}
|
|
17658
17649
|
}
|
|
17659
17650
|
}
|
|
17660
|
-
function wrapSetOperation(target, value) {
|
|
17661
|
-
if (target instanceof ReadVariableExpr) {
|
|
17662
|
-
return twoWayBindingSet(target, value);
|
|
17663
|
-
}
|
|
17664
|
-
return twoWayBindingSet(target, value).or(target.set(value));
|
|
17665
|
-
}
|
|
17666
|
-
function isReadExpression(value) {
|
|
17667
|
-
return value instanceof ReadPropExpr || value instanceof ReadKeyExpr || value instanceof ReadVariableExpr;
|
|
17668
|
-
}
|
|
17669
|
-
function wrapAction(target, value) {
|
|
17670
|
-
if (isReadExpression(target)) {
|
|
17671
|
-
return wrapSetOperation(target, value);
|
|
17672
|
-
}
|
|
17673
|
-
if (target instanceof BinaryOperatorExpr && isReadExpression(target.rhs)) {
|
|
17674
|
-
return new BinaryOperatorExpr(target.operator, target.lhs, wrapSetOperation(target.rhs, value));
|
|
17675
|
-
}
|
|
17676
|
-
if (target instanceof ConditionalExpr && isReadExpression(target.falseCase)) {
|
|
17677
|
-
return new ConditionalExpr(target.condition, target.trueCase, wrapSetOperation(target.falseCase, value));
|
|
17678
|
-
}
|
|
17679
|
-
if (target instanceof NotExpr) {
|
|
17680
|
-
let expr = target.condition;
|
|
17681
|
-
while (true) {
|
|
17682
|
-
if (expr instanceof NotExpr) {
|
|
17683
|
-
expr = expr.condition;
|
|
17684
|
-
} else {
|
|
17685
|
-
if (isReadExpression(expr)) {
|
|
17686
|
-
return wrapSetOperation(expr, value);
|
|
17687
|
-
}
|
|
17688
|
-
break;
|
|
17689
|
-
}
|
|
17690
|
-
}
|
|
17691
|
-
}
|
|
17692
|
-
throw new Error(`Unsupported expression in two-way action binding.`);
|
|
17693
|
-
}
|
|
17694
17651
|
|
|
17695
17652
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
|
|
17696
17653
|
function saveAndRestoreView(job) {
|
|
@@ -18701,7 +18658,6 @@ function ingestBoundText(unit, text2, icuPlaceholder) {
|
|
|
18701
18658
|
function ingestIfBlock(unit, ifBlock) {
|
|
18702
18659
|
var _a2;
|
|
18703
18660
|
let firstXref = null;
|
|
18704
|
-
let firstSlotHandle = null;
|
|
18705
18661
|
let conditions = [];
|
|
18706
18662
|
for (let i = 0; i < ifBlock.branches.length; i++) {
|
|
18707
18663
|
const ifCase = ifBlock.branches[i];
|
|
@@ -18721,15 +18677,13 @@ function ingestIfBlock(unit, ifBlock) {
|
|
|
18721
18677
|
unit.create.push(templateOp);
|
|
18722
18678
|
if (firstXref === null) {
|
|
18723
18679
|
firstXref = cView.xref;
|
|
18724
|
-
firstSlotHandle = templateOp.handle;
|
|
18725
18680
|
}
|
|
18726
18681
|
const caseExpr = ifCase.expression ? convertAst(ifCase.expression, unit.job, null) : null;
|
|
18727
18682
|
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle, ifCase.expressionAlias);
|
|
18728
18683
|
conditions.push(conditionalCaseExpr);
|
|
18729
18684
|
ingestNodes(cView, ifCase.children);
|
|
18730
18685
|
}
|
|
18731
|
-
|
|
18732
|
-
unit.update.push(conditional2);
|
|
18686
|
+
unit.update.push(createConditionalOp(firstXref, null, conditions, ifBlock.sourceSpan));
|
|
18733
18687
|
}
|
|
18734
18688
|
function ingestSwitchBlock(unit, switchBlock) {
|
|
18735
18689
|
var _a2;
|
|
@@ -18737,7 +18691,6 @@ function ingestSwitchBlock(unit, switchBlock) {
|
|
|
18737
18691
|
return;
|
|
18738
18692
|
}
|
|
18739
18693
|
let firstXref = null;
|
|
18740
|
-
let firstSlotHandle = null;
|
|
18741
18694
|
let conditions = [];
|
|
18742
18695
|
for (const switchCase of switchBlock.cases) {
|
|
18743
18696
|
const cView = unit.job.allocateView(unit.xref);
|
|
@@ -18753,15 +18706,13 @@ function ingestSwitchBlock(unit, switchBlock) {
|
|
|
18753
18706
|
unit.create.push(templateOp);
|
|
18754
18707
|
if (firstXref === null) {
|
|
18755
18708
|
firstXref = cView.xref;
|
|
18756
|
-
firstSlotHandle = templateOp.handle;
|
|
18757
18709
|
}
|
|
18758
18710
|
const caseExpr = switchCase.expression ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) : null;
|
|
18759
18711
|
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle);
|
|
18760
18712
|
conditions.push(conditionalCaseExpr);
|
|
18761
18713
|
ingestNodes(cView, switchCase.children);
|
|
18762
18714
|
}
|
|
18763
|
-
|
|
18764
|
-
unit.update.push(conditional2);
|
|
18715
|
+
unit.update.push(createConditionalOp(firstXref, convertAst(switchBlock.expression, unit.job, null), conditions, switchBlock.sourceSpan));
|
|
18765
18716
|
}
|
|
18766
18717
|
function ingestDeferView(unit, suffix, i18nMeta, children, sourceSpan) {
|
|
18767
18718
|
if (i18nMeta !== void 0 && !(i18nMeta instanceof BlockPlaceholder)) {
|
|
@@ -19456,11 +19407,12 @@ var STYLE_PREFIX = "style";
|
|
|
19456
19407
|
var TEMPLATE_ATTR_PREFIX = "*";
|
|
19457
19408
|
var ANIMATE_PROP_PREFIX = "animate-";
|
|
19458
19409
|
var BindingParser = class {
|
|
19459
|
-
constructor(_exprParser, _interpolationConfig, _schemaRegistry, errors) {
|
|
19410
|
+
constructor(_exprParser, _interpolationConfig, _schemaRegistry, errors, _allowInvalidAssignmentEvents = false) {
|
|
19460
19411
|
this._exprParser = _exprParser;
|
|
19461
19412
|
this._interpolationConfig = _interpolationConfig;
|
|
19462
19413
|
this._schemaRegistry = _schemaRegistry;
|
|
19463
19414
|
this.errors = errors;
|
|
19415
|
+
this._allowInvalidAssignmentEvents = _allowInvalidAssignmentEvents;
|
|
19464
19416
|
}
|
|
19465
19417
|
get interpolationConfig() {
|
|
19466
19418
|
return this._interpolationConfig;
|
|
@@ -19764,6 +19716,9 @@ var BindingParser = class {
|
|
|
19764
19716
|
if (ast instanceof PropertyRead || ast instanceof KeyedRead) {
|
|
19765
19717
|
return true;
|
|
19766
19718
|
}
|
|
19719
|
+
if (!this._allowInvalidAssignmentEvents) {
|
|
19720
|
+
return false;
|
|
19721
|
+
}
|
|
19767
19722
|
if (ast instanceof Binary) {
|
|
19768
19723
|
return (ast.operation === "&&" || ast.operation === "||" || ast.operation === "??") && (ast.right instanceof PropertyRead || ast.right instanceof KeyedRead);
|
|
19769
19724
|
}
|
|
@@ -21009,8 +20964,8 @@ function textContents(node) {
|
|
|
21009
20964
|
var LEADING_TRIVIA_CHARS = [" ", "\n", "\r", " "];
|
|
21010
20965
|
function parseTemplate(template2, templateUrl, options = {}) {
|
|
21011
20966
|
var _a2;
|
|
21012
|
-
const { interpolationConfig, preserveWhitespaces, enableI18nLegacyMessageIdFormat } = options;
|
|
21013
|
-
const bindingParser = makeBindingParser(interpolationConfig);
|
|
20967
|
+
const { interpolationConfig, preserveWhitespaces, enableI18nLegacyMessageIdFormat, allowInvalidAssignmentEvents } = options;
|
|
20968
|
+
const bindingParser = makeBindingParser(interpolationConfig, allowInvalidAssignmentEvents);
|
|
21014
20969
|
const htmlParser = new HtmlParser();
|
|
21015
20970
|
const parseResult = htmlParser.parse(template2, templateUrl, __spreadProps(__spreadValues({
|
|
21016
20971
|
leadingTriviaChars: LEADING_TRIVIA_CHARS
|
|
@@ -21075,8 +21030,8 @@ function parseTemplate(template2, templateUrl, options = {}) {
|
|
|
21075
21030
|
return parsedTemplate;
|
|
21076
21031
|
}
|
|
21077
21032
|
var elementRegistry = new DomElementSchemaRegistry();
|
|
21078
|
-
function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
21079
|
-
return new BindingParser(new Parser(new Lexer()), interpolationConfig, elementRegistry, []);
|
|
21033
|
+
function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG, allowInvalidAssignmentEvents = false) {
|
|
21034
|
+
return new BindingParser(new Parser(new Lexer()), interpolationConfig, elementRegistry, [], allowInvalidAssignmentEvents);
|
|
21080
21035
|
}
|
|
21081
21036
|
|
|
21082
21037
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
|
|
@@ -22640,7 +22595,7 @@ function publishFacade(global) {
|
|
|
22640
22595
|
}
|
|
22641
22596
|
|
|
22642
22597
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
|
|
22643
|
-
var VERSION2 = new Version("18.0.0-next.
|
|
22598
|
+
var VERSION2 = new Version("18.0.0-next.5");
|
|
22644
22599
|
|
|
22645
22600
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
22646
22601
|
var _VisitorMode;
|