ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
1 lines • 4.03 kB
Source Map (JSON)
{"version":3,"file":"ng-zorro-antd-core-polyfill.mjs","sources":["../../components/core/polyfill/request-animation.ts","../../components/core/polyfill/public-api.ts","../../components/core/polyfill/ng-zorro-antd-core-polyfill.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nconst availablePrefixes = ['moz', 'ms', 'webkit'];\n\nfunction requestAnimationFramePolyfill(): typeof requestAnimationFrame {\n let lastTime = 0;\n return function (callback: FrameRequestCallback): number {\n const currTime = new Date().getTime();\n const timeToCall = Math.max(0, 16 - (currTime - lastTime));\n const id = window.setTimeout(() => {\n callback(currTime + timeToCall);\n }, timeToCall);\n lastTime = currTime + timeToCall;\n return id;\n };\n}\n\nfunction getRequestAnimationFrame(): typeof requestAnimationFrame {\n if (typeof window === 'undefined') {\n return () => 0;\n }\n if (window.requestAnimationFrame) {\n // https://github.com/vuejs/vue/issues/4465\n return window.requestAnimationFrame.bind(window);\n }\n\n const prefix = availablePrefixes.filter(key => `${key}RequestAnimationFrame` in window)[0];\n\n return prefix ? (window as NzSafeAny)[`${prefix}RequestAnimationFrame`] : requestAnimationFramePolyfill();\n}\n\nexport function cancelRequestAnimationFrame(id: number): NzSafeAny {\n if (typeof window === 'undefined') {\n return null;\n }\n if (window.cancelAnimationFrame) {\n return window.cancelAnimationFrame(id);\n }\n const prefix = availablePrefixes.filter(\n key => `${key}CancelAnimationFrame` in window || `${key}CancelRequestAnimationFrame` in window\n )[0];\n\n return prefix\n ? (\n ((window as NzSafeAny)[`${prefix}CancelAnimationFrame`] as typeof cancelAnimationFrame) ||\n ((window as NzSafeAny)[`${prefix}CancelRequestAnimationFrame`] as typeof cancelRequestAnimationFrame)\n )\n // @ts-ignore\n .call(this, id)\n : clearTimeout(id);\n}\n\nexport const reqAnimFrame = getRequestAnimationFrame();\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nexport * from './request-animation';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;;AAGG;AAIH,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC;AAEjD,SAAS,6BAA6B,GAAA;IACpC,IAAI,QAAQ,GAAG,CAAC;AAChB,IAAA,OAAO,UAAU,QAA8B,EAAA;QAC7C,MAAM,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;AACrC,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,IAAI,QAAQ,GAAG,QAAQ,CAAC,CAAC;AAC1D,QAAA,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,MAAK;AAChC,YAAA,QAAQ,CAAC,QAAQ,GAAG,UAAU,CAAC;SAChC,EAAE,UAAU,CAAC;AACd,QAAA,QAAQ,GAAG,QAAQ,GAAG,UAAU;AAChC,QAAA,OAAO,EAAE;AACX,KAAC;AACH;AAEA,SAAS,wBAAwB,GAAA;AAC/B,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACjC,QAAA,OAAO,MAAM,CAAC;;AAEhB,IAAA,IAAI,MAAM,CAAC,qBAAqB,EAAE;;QAEhC,OAAO,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC;;AAGlD,IAAA,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAG,EAAA,GAAG,uBAAuB,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AAE1F,IAAA,OAAO,MAAM,GAAI,MAAoB,CAAC,CAAA,EAAG,MAAM,CAAA,qBAAA,CAAuB,CAAC,GA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