@@ -27,6 +27,8 @@ export declare type AnimateTimings = {
27
27
easing : string | null
28
28
} ;
29
29
30
+ exampleFolders . forEach ( folder => exampleMap [ folder ] = exampleMap [ folder ] || [ ] ) ;
31
+
30
32
/**
31
33
* @description Options that control animation styling and timing.
32
34
*
@@ -324,23 +326,25 @@ export interface AnimationStaggerMetadata extends AnimationMetadata {
324
326
*
325
327
* @return An {@link AnimationTriggerMetadata AnimationTriggerMetadata} object that encapsulates the trigger data.
326
328
*
327
- * @notes Define an animation trigger in the
328
- * {@link Component#animations ` @Component.animations` section}.
329
+ * @usageNotes Define an animation trigger in the
330
+ * {@link Component#animations @Component.animations section}.
329
331
* In the template, reference the trigger by name and bind it to a trigger expression that
330
332
* evaluates to a defined animation state, using the following format:
333
+ *
331
334
* `[@triggerName]="expression"`
332
335
*
333
336
* Animation trigger bindings convert all values to strings, and then match the previous and current values against
334
337
* any linked transitions. Booleans can be specified as `1` or `true` and `0` or `false`.
335
338
*
336
- * ### Usage Example
339
+ * ### Usage Example
340
+ *
337
341
* The following example creates an animation trigger reference based on the provided name value.
338
342
* The provided animation value is expected to be an array consisting of state and transition declarations.
339
343
*
340
- * ```typescript
344
+ * ```ts
341
345
* @Component ({
342
- * selector: ' my-component' ,
343
- * templateUrl: ' my-component-tpl.html' ,
346
+ * selector: " my-component" ,
347
+ * templateUrl: " my-component-tpl.html" ,
344
348
* animations: [
345
349
* trigger("myAnimationTrigger", [
346
350
* state(...),
@@ -522,6 +526,7 @@ return {type: AnimationMetadataType.Group, steps, options};
522
526
* - Steps defined by {@link style style()} calls apply the styling data immediately.
523
527
* - Steps defined by {@link animate animate()} calls apply the styling data over time
524
528
* as specified by the timing data.
529
+ *
525
530
* ``` typescript
526
531
* sequence([
527
532
* style({ opacity: 0 })),
@@ -567,16 +572,14 @@ return {type: AnimationMetadataType.Sequence, steps, options};
567
572
*
568
573
* @return An {@link AnimationStyleMetadata AnimationStyleMetadata} object that encapsulates the style data.
569
574
*
570
- * * @usageNotes
571
- * ### Usage
572
- * The following examples create animation styles that collect a set of CSS property values:
575
+ * @usageNotes The following examples create animation styles that collect a set of CSS property values:
573
576
*
574
- * ```
577
+ * ```ts
575
578
* // string values for CSS properties
576
579
* style({ background: "red", color: "blue" })
577
580
*
578
581
* // numerical pixel values
579
- * style({ width: 100, height: 0 })</pre>
582
+ * style({ width: 100, height: 0 })
580
583
* ```
581
584
*
582
585
* The following example uses auto-styling to allow a component to animate from
@@ -642,11 +645,13 @@ return {type: AnimationMetadataType.State, name, styles, options};
642
645
*
643
646
* ### Usage
644
647
*
645
- * For each `style()` entry an `offset` value can be set. Doing so allows to specifiy at what
646
- * percentage of the animate time the styles will be applied.
648
+ * The optional `offset` value for a style specifies a percentage of the total animation
649
+ * time in which that style is applied. In the following example, the offset values describe
650
+ * when each `backgroundColor` value is applied. The color is red at the start, and changes to
651
+ * blue when 20% of the total time has elapsed.
647
652
*
648
- * ```typescript
649
- * // the provided offset values describe when each backgroundColor value is applied.
653
+ * ```ts
654
+ * // the provided offset values
650
655
* animate("5s", keyframes([
651
656
* style({ backgroundColor: "red", offset: 0 }),
652
657
* style({ backgroundColor: "blue", offset: 0.2 }),
@@ -656,7 +661,7 @@ return {type: AnimationMetadataType.State, name, styles, options};
656
661
* ```
657
662
*
658
663
* Alternatively, if there are no `offset` values used within the style entries then the offsets
659
- * will be calculated automatically.
664
+ * are be calculated automatically.
660
665
*
661
666
* ```typescript
662
667
* animate("5s", keyframes([
@@ -678,7 +683,9 @@ return {type: AnimationMetadataType.Keyframes, steps};
678
683
679
684
/**
680
685
* @description Declares an animation transition as a sequence of animation steps to run when a given
681
- * condition is satisfied.
686
+ * condition is satisfied. The condition is a Boolean expression or function that compares the previous and current animation states,
687
+ * and returns true if this transition should occur. When a transition is defined that matches the state criteria,
688
+ * the associated animation is triggered.
682
689
*
683
690
* @param stateChangeExpr A Boolean expression or function that compares the previous and current
684
691
* animation states, and returns true if this transition should occur. Note that "true" and "false"
@@ -705,39 +712,42 @@ return {type: AnimationMetadataType.Keyframes, steps};
705
712
* @returns An {@link AnimationTransitionMetadata AnimationTransitionMetadata} object that encapsulates the
706
713
* transition data.
707
714
*
708
- * @usageNotes The condition is a Boolean expression or function that compares the previous and current animation states,
709
- * and returns true if this transition should occur. When a transition is defined that matches the state criteria,
710
- * the associated animation is triggered.
715
+ * @usageNotes
711
716
*
712
- * Note that when you call the {@link sequence sequence()} function within a {@link group group()}
713
- * or a {@link transition transition()} call, execution does not continue to the next instruction
714
- * until each of the inner animation steps have completed.
715
- *
716
- * ### Syntax examples
717
- * The template associated with a component binds an animation trigger to an element.
717
+ * The template associated with a component binds an animation trigger to an element.
718
718
*
719
719
* ```
720
720
* <!-- somewhere inside of my-component-tpl.html -->
721
721
* <div [@myAnimationTrigger]="myStatusExp">...</div>
722
722
* ```
723
- * All transitions are defined within an animation trigger, along with named states that the transitions
724
- * change to and from.
725
723
*
726
- * ```
724
+ * All transitions are defined within an animation trigger,
725
+ * along with named states that the transitions change to and from.
726
+ *
727
+ * ```ts
727
728
* trigger("myAnimationTrigger", [
728
- * // define states
729
- * state("on", style({ background: "green" })),
730
- * state("off", style({ background: "grey" })),
731
- * ...
729
+ * // define states
730
+ * state("on", style({ background: "green" })),
731
+ * state("off", style({ background: "grey" })),
732
+ * ...]
733
+ * ```
734
+ *
735
+ * Note that when you call the {@link sequence sequence()} function within a {@link group group()}
736
+ * or a {@link transition transition()} call, execution does not continue to the next instruction
737
+ * until each of the inner animation steps have completed.
738
+ *
739
+ * ### Syntax examples
740
+ *
732
741
* The following examples define transitions between the two defined states (and default states),
733
742
* using various options:
743
+ *
734
744
* ```
735
745
* // Transition occurs when the state value
736
746
* // bound to "myAnimationTrigger" changes from "on" to "off"
737
747
* transition("on => off", animate(500)),
738
- * // Run the same animation for both directions
748
+ * // Run the same animation for both directions
739
749
* transition("on <=> off", animate(500)),
740
- * // Define multiple state-change pairs separated by commas
750
+ * // Define multiple state-change pairs separated by commas
741
751
* transition("on => off, off => void", animate(500))
742
752
* ]
743
753
* ```
@@ -755,11 +765,12 @@ return {type: AnimationMetadataType.Keyframes, steps};
755
765
* ```
756
766
* - Capture a state change between any states:
757
767
*
758
- * ``` transition("* => *", animate("1s 0s"))`` `
768
+ * `transition("* => *", animate("1s 0s"))`
759
769
*
760
770
* - Entry and exit transitions:
761
771
*
762
- * ```transition(":enter", [
772
+ * ```typescript
773
+ * transition(":enter", [
763
774
* style({ opacity: 0 }),
764
775
* animate(500, style({ opacity: 1 }))
765
776
* ]),
@@ -768,14 +779,14 @@ return {type: AnimationMetadataType.Keyframes, steps};
768
779
* ])
769
780
* ```
770
781
*
771
- * Using `:increment` and `:decrement` to initiate transitions:
782
+ * - Use `:increment` and `:decrement` to initiate transitions: (example TBD)
772
783
*
773
- * {@example core/animation/ts/dsl/animation_example.ts region='Component'}
774
784
*
775
- * ### State change functions
776
- * A function that invokes an animation when true:
785
+ * ### State-change functions
786
+ *
787
+ * Here is an example of a `fromState` specified as a state-change function that invokes an animation when true:
777
788
*
778
- * ```
789
+ * ```js
779
790
* transition((fromState, toState) =>
780
791
* {
781
792
* return fromState == "off" && toState == "on";
@@ -804,7 +815,7 @@ return {type: AnimationMetadataType.Transition, expr: stateChangeExpr, animation
804
815
*
805
816
* @example
806
817
*
807
- * ```
818
+ * ```js
808
819
* var fadeAnimation = animation([
809
820
* style({ opacity: '{{ start }}' }),
810
821
* animate('{{ time }}',
@@ -817,7 +828,7 @@ return {type: AnimationMetadataType.Transition, expr: stateChangeExpr, animation
817
828
* directly. If any of the passed in parameter values are missing then the default values will be
818
829
* used. If one or more parameter values are missing before animated, an error is thrown.
819
830
*
820
- * ```
831
+ * ```js
821
832
* useAnimation(fadeAnimation, {
822
833
* params: {
823
834
* time: '2s',
@@ -876,17 +887,15 @@ return {type: AnimationMetadataType.AnimateRef, animation, options};
876
887
*
877
888
* @param selector The element to query, or a set of elements that contain Angular-specific
878
889
* characteristics, specified with one or more of the following tokens.
879
- * - `query(":enter")`/ `query(":leave")` : Query for newly inserted/removed elements.
890
+ * - `query(":enter")` or `query(":leave")` : Query for newly inserted/removed elements.
880
891
* - `query(":animating")` : Query all currently animating elements.
881
892
* - `query("@triggerName")` : Query elements that contain an animation trigger.
882
893
* - `query("@*")` : Query all elements that contain an animation triggers.
883
894
* - `query(":self")` : Include the current element into the animation sequence.
884
895
*
885
896
* Tokens can be merged into a combined query selector string. For example:
886
897
*
887
- * ```
888
- * query(':self, .record:enter, .record:leave, @subTrigger', [...])
889
- * ```
898
+ * `query(':self, .record:enter, .record:leave, @subTrigger', [...])`
890
899
*
891
900
* @param animation One or more animation steps to apply to the queried element or elements.
892
901
* An array is treated as an animation sequence.
@@ -999,7 +1008,7 @@ return {type: AnimationMetadataType.Query, selector, animation, options};
999
1008
* templateUrl: 'list.component.html',
1000
1009
* animations: [
1001
1010
* trigger('listAnimation', [
1002
- * // ...
1011
+ * ...
1003
1012
* ])
1004
1013
* ]
1005
1014
* })
0 commit comments