@angular/animations 13.2.0-next.2 → 14.0.0-next.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.2.0-next.2
2
+ * @license Angular v14.0.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.2.0-next.2
2
+ * @license Angular v14.0.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.2.0-next.2
2
+ * @license Angular v14.0.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -148,27 +148,11 @@ if (_isNode || typeof Element !== 'undefined') {
148
148
  };
149
149
  }
150
150
  _query = (element, selector, multi) => {
151
- let results = [];
152
151
  if (multi) {
153
- // DO NOT REFACTOR TO USE SPREAD SYNTAX.
154
- // For element queries that return sufficiently large NodeList objects,
155
- // using spread syntax to populate the results array causes a RangeError
156
- // due to the call stack limit being reached. `Array.from` can not be used
157
- // as well, since NodeList is not iterable in IE 11, see
158
- // https://developer.mozilla.org/en-US/docs/Web/API/NodeList
159
- // More info is available in #38551.
160
- const elems = element.querySelectorAll(selector);
161
- for (let i = 0; i < elems.length; i++) {
162
- results.push(elems[i]);
163
- }
164
- }
165
- else {
166
- const elm = element.querySelector(selector);
167
- if (elm) {
168
- results.push(elm);
169
- }
152
+ return Array.from(element.querySelectorAll(selector));
170
153
  }
171
- return results;
154
+ const elem = element.querySelector(selector);
155
+ return elem ? [elem] : [];
172
156
  };
173
157
  }
174
158
  function containsVendorPrefix(prop) {
@@ -241,9 +225,9 @@ class NoopAnimationDriver {
241
225
  return new NoopAnimationPlayer(duration, delay);
242
226
  }
243
227
  }
244
- NoopAnimationDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-next.2", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
245
- NoopAnimationDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-next.2", ngImport: i0, type: NoopAnimationDriver });
246
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-next.2", ngImport: i0, type: NoopAnimationDriver, decorators: [{
228
+ NoopAnimationDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
229
+ NoopAnimationDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: NoopAnimationDriver });
230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: NoopAnimationDriver, decorators: [{
247
231
  type: Injectable
248
232
  }] });
249
233
  /**
@@ -1263,10 +1247,21 @@ class AnimationTimelineBuilderVisitor {
1263
1247
  visitDslNode(this, ast, context);
1264
1248
  // this checks to see if an actual animation happened
1265
1249
  const timelines = context.timelines.filter(timeline => timeline.containsAnimation());
1266
- if (timelines.length && Object.keys(finalStyles).length) {
1267
- const tl = timelines[timelines.length - 1];
1268
- if (!tl.allowOnlyTimelineStyles()) {
1269
- tl.setStyles([finalStyles], null, context.errors, options);
1250
+ if (Object.keys(finalStyles).length) {
1251
+ // note: we just want to apply the final styles for the rootElement, so we do not
1252
+ // just apply the styles to the last timeline but the last timeline which
1253
+ // element is the root one (basically `*`-styles are replaced with the actual
1254
+ // state style values only for the root element)
1255
+ let lastRootTimeline;
1256
+ for (let i = timelines.length - 1; i >= 0; i--) {
1257
+ const timeline = timelines[i];
1258
+ if (timeline.element === rootElement) {
1259
+ lastRootTimeline = timeline;
1260
+ break;
1261
+ }
1262
+ }
1263
+ if (lastRootTimeline && !lastRootTimeline.allowOnlyTimelineStyles()) {
1264
+ lastRootTimeline.setStyles([finalStyles], null, context.errors, options);
1270
1265
  }
1271
1266
  }
1272
1267
  return timelines.length ? timelines.map(timeline => timeline.buildKeyframes()) :