All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.animations.AnimationQueue.js.map Maven / Gradle / Ivy

{"version":3,"file":"AnimationQueue.js","sourceRoot":"","sources":["../../src/animations/AnimationQueue.ts"],"names":[],"mappings":"AACA,MAAM,KAAK,GAAG,IAAI,OAAO,EAAgC,CAAC;AAE1D,MAAM,cAAc;IACnB,MAAM,KAAK,KAAK;QACf,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,OAAoB,EAAE,IAAc;QAClD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACxB,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;SACvB;QAED,KAAK,CAAC,GAAG,CAAC,OAAO,CAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,OAAoB,EAAE,IAAc;QAC9C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACxB,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;SACvB;QAED,OAAO,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;YACvB,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAExC,IAAI,YAAa,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC7B,OAAO,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,YAAa,CAAC,KAAK,EAAG,CAAC,CAAC;aAC3D;YACD,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,OAAoB,EAAE,IAAc;QAC/C,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAExC,IAAI,YAAY,EAAE;YACjB,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SACtC;aAAM;YACN,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SAClC;IACF,CAAC;CACD;AAED,eAAe,cAAc,CAAC","sourcesContent":["type TaskType =\t() => Promise;\nconst tasks = new WeakMap>();\n\nclass AnimationQueue {\n\tstatic get tasks() {\n\t\treturn tasks;\n\t}\n\n\tstatic enqueue(element: HTMLElement, task: TaskType) {\n\t\tif (!tasks.has(element)) {\n\t\t\ttasks.set(element, []);\n\t\t}\n\n\t\ttasks.get(element)!.push(task);\n\t}\n\n\tstatic run(element: HTMLElement, task: TaskType): Promise {\n\t\tif (!tasks.has(element)) {\n\t\t\ttasks.set(element, []);\n\t\t}\n\n\t\treturn task().then(() => {\n\t\t\tconst elementTasks = tasks.get(element);\n\n\t\t\tif (elementTasks!.length > 0) {\n\t\t\t\treturn AnimationQueue.run(element, elementTasks!.shift()!);\n\t\t\t}\n\t\t\ttasks.delete(element);\n\t\t});\n\t}\n\n\tstatic push(element: HTMLElement, task: TaskType) {\n\t\tconst elementTasks = tasks.get(element);\n\n\t\tif (elementTasks) {\n\t\t\tAnimationQueue.enqueue(element, task);\n\t\t} else {\n\t\t\tAnimationQueue.run(element, task);\n\t\t}\n\t}\n}\n\nexport default AnimationQueue;\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy