You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

polyfill.js 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * required polyfills
  3. */
  4. /** IE9, IE10 and IE11 requires all of the following polyfills. **/
  5. // import "core-js";
  6. // import 'core-js/features/symbol'
  7. // import 'core-js/features/object'
  8. // import 'core-js/features/function'
  9. // import 'core-js/features/parse-int'
  10. // import 'core-js/features/parse-float'
  11. // import 'core-js/features/number'
  12. // import 'core-js/features/math'
  13. // import 'core-js/features/string'
  14. // import 'core-js/features/date'
  15. // import 'core-js/features/array'
  16. // import 'core-js/features/regexp'
  17. // import 'core-js/features/map'
  18. // import 'core-js/features/weak-map'
  19. // import 'core-js/features/set'
  20. // import 'core-js/features/set/map';
  21. /** IE10 and IE11 requires the following for the Reflect API. */
  22. // import 'core-js/features/reflect';
  23. /** Evergreen browsers require these. **/
  24. // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
  25. // import 'core-js/features/reflect'
  26. // CustomEvent() constructor functionality in IE9, IE10, IE11
  27. (function () {
  28. if ( typeof window.CustomEvent === "function" ) return false
  29. function CustomEvent ( event, params ) {
  30. params = params || { bubbles: false, cancelable: false, detail: undefined }
  31. var evt = document.createEvent( 'CustomEvent' )
  32. evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail )
  33. return evt
  34. }
  35. CustomEvent.prototype = window.Event.prototype
  36. window.CustomEvent = CustomEvent
  37. })()
  38. if (!Element.prototype.matches) {
  39. Element.prototype.matches =
  40. Element.prototype.msMatchesSelector ||
  41. Element.prototype.webkitMatchesSelector;
  42. }
  43. if (!Element.prototype.closest) {
  44. Element.prototype.closest = function(s) {
  45. var el = this;
  46. do {
  47. if (Element.prototype.matches.call(el, s)) return el;
  48. el = el.parentElement || el.parentNode;
  49. } while (el !== null && el.nodeType === 1);
  50. return null;
  51. };
  52. }