{"version":3,"file":"odx-angular-animations.mjs","sources":["../../../../libs/angular/animations/src/lib/config.ts","../../../../libs/angular/animations/src/lib/expand.ts","../../../../libs/angular/animations/src/lib/fade.ts","../../../../libs/angular/animations/src/lib/slide.ts","../../../../libs/angular/animations/src/lib/wait-for-child-animations.ts","../../../../libs/angular/animations/src/odx-angular-animations.ts"],"sourcesContent":["export const DEFAULT_ANIMATION_TIMING_FN = 'ease';\nexport const DEFAULT_ANIMATION_DURATION = '250ms';\nexport const DEFAULT_ANIMATION_PARAMS = {\n  timingFn: DEFAULT_ANIMATION_TIMING_FN,\n  duration: DEFAULT_ANIMATION_DURATION,\n  delay: '0ms',\n};\n","import { animate, animation, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\n/**\n * Animation for smoothly expanding an element from height 0 to its natural height.\n * It transitions the element's height, padding, margin, and opacity from a collapsed state to an expanded state,\n * making the element smoothly grow into view.\n *\n * The `expand` animation uses `DEFAULT_ANIMATION_PARAMS` for its default parameters, which can be overridden\n * when using the animation.\n *\n * @example\n * ```ts\n * // Example usage in an Angular component\n * import { expand, collapse } from '@odx/angular/animations';\n *\n * @Component({\n *   selector: 'my-expandable-component',\n *   templateUrl: './expandable-component.html',\n *   animations: [\n *     trigger('expandCollapse', [\n *       transition('collapsed => expanded', useAnimation(expand)),\n *       transition('expanded => collapsed', useAnimation(collapse)),\n *     ])\n *   ]\n * })\n * export class ExpandableComponent {\n *   state = 'collapsed';\n *\n *   toggle(): void {\n *     this.state = this.state === 'collapsed' ? 'expanded' : 'collapsed';\n *   }\n * }\n * ```\n *\n * The animation smoothly transitions various properties (height, padding, margin, and opacity) and is controlled\n * through parameters defined in `DEFAULT_ANIMATION_PARAMS` or those provided during usage.\n */\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const expand = animation(\n  [\n    style({ height: 0, minHeight: 0, paddingTop: 0, paddingBottom: 0, opacity: 0, marginTop: 0, marginBottom: 0, overflow: 'hidden' }),\n    animate(\n      '{{duration}} {{ delay }} {{ timingFn }}',\n      style({ height: '*', paddingTop: '*', paddingBottom: '*', opacity: 1, marginTop: '*', marginBottom: '*' }),\n    ),\n  ],\n  {\n    params: DEFAULT_ANIMATION_PARAMS,\n  },\n);\n\n/**\n * Animation for smoothly collapsing an element from its natural height to height 0.\n * It transitions the element's height, padding, margin, and opacity from an expanded state to a collapsed state,\n * making the element smoothly shrink out of view.\n *\n * The `collapse` animation also uses `DEFAULT_ANIMATION_PARAMS` for its default parameters, which can be overridden\n * when using the animation. It's designed to be used in conjunction with the `expand` animation for creating\n * expandable/collapsible elements.\n */\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const collapse = animation(\n  [\n    animate(\n      '{{duration}} {{ delay }} {{ timingFn }}',\n      style({ height: 0, minHeight: 0, paddingTop: 0, paddingBottom: 0, opacity: 0, marginTop: 0, marginBottom: 0, overflow: 'hidden' }),\n    ),\n  ],\n  {\n    params: DEFAULT_ANIMATION_PARAMS,\n  },\n);\n","import { animate, animation, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\n/**\n * Generates a fadeIn animation with customizable opacity target.\n * This animation gradually changes the element's opacity from 0 to a specified value, creating a \"fade in\" visual effect.\n *\n * @param {number} to - The final opacity value of the element at the end of the animation. Defaults to 1 (fully opaque).\n * @returns {AnimationReferenceMetadata} An Angular animation object that can be used with Angular's animation system.\n *\n * @example\n * ```ts\n * // Example usage in an Angular component with a fadeIn animation\n * import { fadeIn } from '@odx/angular/animations';\n * import { trigger, transition, useAnimation } from '@angular/animations';\n *\n * @Component({\n *   selector: 'app-fade-in-example',\n *   template: `\n *      @if(isVisible) {\n *       <div @fadeInAnimation>Fade In Content</div>\n *      }\n *       <button (click)=\"showContent()\">Show Content</button>`,\n *   animations: [\n *     trigger('fadeInAnimation', [\n *       transition(':enter', useAnimation(fadeIn(), { params: { duration: '500ms' } }))\n *     ])\n *   ]\n * })\n * export class FadeInExampleComponent {\n *   isVisible = false;\n *\n *   showContent(): void {\n *     this.isVisible = true;\n *   }\n * }\n * ```\n *\n * This example demonstrates how to apply the fadeIn animation to an element, making it smoothly appear on the screen.\n */\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const fadeIn = (to = 1) =>\n  animation([style({ opacity: 0 }), animate('{{duration}} {{ delay }} {{ timingFn }}', style({ opacity: to }))], {\n    params: DEFAULT_ANIMATION_PARAMS,\n  });\n\n/**\n * Generates a fadeOut animation with customizable opacity target.\n * This animation gradually changes the element's opacity from its current value to a specified value, creating a \"fade out\" visual effect.\n *\n * @param {number} to - The target opacity value of the element at the end of the animation. Defaults to 0 (fully transparent).\n * @returns {AnimationReferenceMetadata} An Angular animation object that can be used with Angular's animation system.\n *\n * @example\n * ```ts\n * // Example usage in an Angular component with a fadeOut animation\n * import { fadeOut } from '@odx/angular/animations';\n * import { trigger, transition, useAnimation } from '@angular/animations';\n *\n * @Component({\n *   selector: 'app-fade-out-example',\n *   template: `\n *      @if(isVisible) {\n *      <div @fadeOutAnimation>Fade Out Content</div>\n *      }\n *      <button (click)=\"hideContent()\">Hide Content</button>`,\n *   animations: [\n *     trigger('fadeOutAnimation', [\n *       transition(':leave', useAnimation(fadeOut(), { params: { duration: '500ms' } }))\n *     ])\n *   ]\n * })\n * export class FadeOutExampleComponent {\n *   isVisible = true;\n *\n *   hideContent(): void {\n *     this.isVisible = false;\n *   }\n * }\n * ```\n *\n * This example demonstrates how to apply the fadeOut animation to an element, making it smoothly disappear from the screen.\n */\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const fadeOut = (to = 0) =>\n  animation([animate('{{duration}} {{ delay }} {{ timingFn }}', style({ opacity: to }))], {\n    params: DEFAULT_ANIMATION_PARAMS,\n  });\n","import { animate, animation, AnimationReferenceMetadata, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\nfunction createSlideInAnimation(from: string, direction: 'X' | 'Y'): AnimationReferenceMetadata {\n  return animation(\n    [\n      style({ transform: `translate${direction}({{ from }})` }),\n      animate('{{duration}} {{ delay }} {{ timingFn }}', style({ transform: `translate${direction}(0)` })),\n    ],\n    {\n      params: {\n        ...DEFAULT_ANIMATION_PARAMS,\n        from,\n      },\n    },\n  );\n}\n\nfunction createSlideOutAnimation(to: string, direction: 'X' | 'Y'): AnimationReferenceMetadata {\n  return animation([animate('{{duration}} {{ delay }} {{ timingFn }}', style({ transform: `translate${direction}({{ to }})` }))], {\n    params: {\n      ...DEFAULT_ANIMATION_PARAMS,\n      to,\n    },\n  });\n}\n\n/**\n * Utility functions for creating slide-in and slide-out animations in specific directions.\n * These include slideInX, slideInY, slideInDown, slideInUp, slideInLeft, slideInRight,\n * slideOutX, slideOutY, slideOutDown, slideOutUp, slideOutLeft, and slideOutRight.\n * Each function is configured for a specific slide direction and distance, making it easy to apply\n * consistent slide animations across your application.\n *\n * @example\n * ```ts\n * // Using slideInLeft and slideOutRight in a component\n * animations: [\n *   trigger('slideInOut', [\n *     transition(':enter', [useAnimation(slideInLeft)]),\n *     transition(':leave', [useAnimation(slideOutRight)])\n *   ])\n * ]\n * ```\n *\n * Note: The 'from' and 'to' parameters for slideIn and slideOut functions respectively\n * can be customized for different slide distances.\n */\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const slideInX = (from: string) => createSlideInAnimation(from, 'X');\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const slideInY = (from: string) => createSlideInAnimation(from, 'Y');\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const slideInDown = slideInY('-100%');\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const slideInUp = slideInY('100%');\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const slideInLeft = slideInX('-100%');\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const slideInRight = slideInX('100%');\n\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const slideOutX = (to: string) => createSlideOutAnimation(to, 'X');\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const slideOutY = (to: string) => createSlideOutAnimation(to, 'Y');\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const slideOutDown = slideOutY('100%');\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const slideOutUp = slideOutY('-100%');\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const slideOutLeft = slideOutX('-100%');\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const slideOutRight = slideOutX('100%');\n","import { animateChild, query, transition } from '@angular/animations';\n\n/**\n * Utility animation that waits for animations on child components to complete.\n * This animation should be used within parent components that have child components with their\n * own animations. It ensures that the parent's enter and leave animations are only triggered\n * after all child animations have completed, creating a seamless animation sequence.\n *\n * This utility uses Angular's animation functions `query` and `animateChild` to find and animate\n * child elements marked with Angular's animation triggers. The `{ optional: true }` parameter\n * ensures that the animation gracefully handles cases where no child animations are defined.\n *\n * @example\n * ```ts\n * // Using waitForChildAnimations in a parent component with children that have animations\n * import { trigger, transition, style, animate, query, animateChild } from '@angular/animations';\n * import { waitForChildAnimations } from '@odx/angular/animations';\n *\n * @Component({\n *   selector: 'app-parent',\n *   templateUrl: './parent.component.html',\n *   animations: [\n *     trigger('parentAnimation', [\n *       // Define parent animations here\n *       transition(':enter', [style({ opacity: 0 }), animate('0.5s ease-in', style({ opacity: 1 }))]),\n *       transition(':leave', [animate('0.5s ease-out', style({ opacity: 0 }))]),\n *       // Use waitForChildAnimations for coordinating with child animations\n *       waitForChildAnimations\n *     ])\n *   ]\n * })\n * export class ParentComponent {\n *   // Component logic here\n * }\n * ```\n *\n * Note: The `waitForChildAnimations` utility is added to the parent component's animation triggers,\n * ensuring that any child component animations are completed before continuing with the parent's\n * own animations.\n */\n/**\n * @deprecated For new animations, use [**New Angular Documentation**](https://angular.dev/guide/animations/css).\n */\nexport const waitForChildAnimations = transition(':enter, :leave', [query('@*', animateChild(), { optional: true })]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAO,MAAM,2BAA2B,GAAG;AACpC,MAAM,0BAA0B,GAAG;AACnC,MAAM,wBAAwB,GAAG;AACtC,IAAA,QAAQ,EAAE,2BAA2B;AACrC,IAAA,QAAQ,EAAE,0BAA0B;AACpC,IAAA,KAAK,EAAE,KAAK;;;ACFd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH;;AAEG;AACI,MAAM,MAAM,GAAG,SAAS,CAC7B;AACE,IAAA,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAClI,IAAA,OAAO,CACL,yCAAyC,EACzC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,CAC3G;CACF,EACD;AACE,IAAA,MAAM,EAAE,wBAAwB;AACjC,CAAA;AAGH;;;;;;;;AAQG;AACH;;AAEG;AACI,MAAM,QAAQ,GAAG,SAAS,CAC/B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