Files
doneit-web/.angular/cache/14.2.12/babel-webpack/223d4f2821f79565a72336de45bc4824.json
T

1 line
85 KiB
JSON
Raw Normal View History

2023-06-30 09:54:21 +01:00
{"ast":null,"code":"import { r as raf } from './helpers-1457892a.js';\nlet animationPrefix;\n/**\n * Web Animations requires hyphenated CSS properties\n * to be written in camelCase when animating\n */\nconst processKeyframes = keyframes => {\n keyframes.forEach(keyframe => {\n for (const key in keyframe) {\n if (keyframe.hasOwnProperty(key)) {\n const value = keyframe[key];\n if (key === 'easing') {\n const newKey = 'animation-timing-function';\n keyframe[newKey] = value;\n delete keyframe[key];\n } else {\n const newKey = convertCamelCaseToHypen(key);\n if (newKey !== key) {\n keyframe[newKey] = value;\n delete keyframe[key];\n }\n }\n }\n }\n });\n return keyframes;\n};\nconst convertCamelCaseToHypen = str => {\n return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n};\nconst getAnimationPrefix = el => {\n if (animationPrefix === undefined) {\n const supportsUnprefixed = el.style.animationName !== undefined;\n const supportsWebkitPrefix = el.style.webkitAnimationName !== undefined;\n animationPrefix = !supportsUnprefixed && supportsWebkitPrefix ? '-webkit-' : '';\n }\n return animationPrefix;\n};\nconst setStyleProperty = (element, propertyName, value) => {\n const prefix = propertyName.startsWith('animation') ? getAnimationPrefix(element) : '';\n element.style.setProperty(prefix + propertyName, value);\n};\nconst removeStyleProperty = (element, propertyName) => {\n const prefix = propertyName.startsWith('animation') ? getAnimationPrefix(element) : '';\n element.style.removeProperty(prefix + propertyName);\n};\nconst animationEnd = (el, callback) => {\n let unRegTrans;\n const opts = {\n passive: true\n };\n const unregister = () => {\n if (unRegTrans) {\n unRegTrans();\n }\n };\n const onTransitionEnd = ev => {\n if (el === ev.target) {\n unregister();\n callback(ev);\n }\n };\n if (el) {\n el.addEventListener('webkitAnimationEnd', onTransitionEnd, opts);\n el.addEventListener('animationend', onTransitionEnd, opts);\n unRegTrans = () => {\n el.removeEventListener('webkitAnimationEnd', onTransitionEnd, opts);\n el.removeEventListener('animationend', onTransitionEnd, opts);\n };\n }\n return unregister;\n};\nconst generateKeyframeRules = (keyframes = []) => {\n return keyframes.map(keyframe => {\n const offset = keyframe.offset;\n const frameString = [];\n for (const property in keyframe) {\n if (keyframe.hasOwnProperty(property) && property !== 'offset') {\n frameString.push(`${property}: ${keyframe[property]};`);\n }\n }\n return `${offset * 100}% { ${frameString.join(' ')} }`;\n }).join(' ');\n};\nconst keyframeIds = [];\nconst generateKeyframeName = keyframeRules => {\n let index = keyframeIds.indexOf(keyframeRules);\n if (index < 0) {\n index = keyframeIds.push(keyframeRules) - 1;\n }\n return `ion-animation-${index}`;\n};\nconst getStyleContainer = element => {\n const rootNode = element.getRootNode();\n return rootNode.head || rootNode;\n};\nconst createKeyframeStylesheet = (keyframeName, keyframeRules, element) => {\n const styleContainer = getStyleContainer(element);\n const keyframePrefix = getAnimationPrefix(element);\n const existingStylesheet = styleContainer.querySelector('#' + keyframeName);\n if (existingStylesheet) {\n return existingStylesheet;\n }\n const stylesheet = (element.ownerDocument || document).createElement('style');\n stylesheet.id = keyframeName;\n stylesheet.textContent = `@${keyframePrefix}keyframes ${keyframeName} { ${keyframeRules} } @${keyframePrefix}keyframes ${keyframeName}-alt { ${keyframeRules} }`;\n styleContainer.appendChild(stylesheet);\n return stylesheet;\n};\nconst addClassToArray = (classes = [], className) => {\n if (className !== undefined) {\n const classNameToAppend = Array.isArray(className) ? className : [className];\n return [...classes, ...classNameToAppend];\n }\n return classes;\n};\ncons