Node-Red configuration
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

gridstack-poly.js 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /** gridstack.js 0.6.4 - IE and older browsers Polyfills for this library @preserve*/
  2. /**
  3. * https://gridstackjs.com/
  4. * (c) 2019-2020 Alain Dumesny
  5. * gridstack.js may be freely distributed under the MIT license.
  6. */
  7. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
  8. Number.isNaN = Number.isNaN || function isNaN(input) {
  9. return typeof input === 'number' && input !== input;
  10. }
  11. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
  12. if (!Array.prototype.find) {
  13. Object.defineProperty(Array.prototype, 'find', {
  14. value: function (predicate) {
  15. // 1. Let O be ? ToObject(this value).
  16. if (this == null) {
  17. throw TypeError('"this" is null or not defined');
  18. }
  19. var o = Object(this);
  20. // 2. Let len be ? ToLength(? Get(O, "length")).
  21. var len = o.length >>> 0;
  22. // 3. If IsCallable(predicate) is false, throw a TypeError exception.
  23. if (typeof predicate !== 'function') {
  24. throw TypeError('predicate must be a function');
  25. }
  26. // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
  27. var thisArg = arguments[1];
  28. // 5. Let k be 0.
  29. var k = 0;
  30. // 6. Repeat, while k < len
  31. while (k < len) {
  32. // a. Let Pk be ! ToString(k).
  33. // b. Let kValue be ? Get(O, Pk).
  34. // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
  35. // d. If testResult is true, return kValue.
  36. var kValue = o[k];
  37. if (predicate.call(thisArg, kValue, k, o)) {
  38. return kValue;
  39. }
  40. // e. Increase k by 1.
  41. k++;
  42. }
  43. // 7. Return undefined.
  44. return undefined;
  45. },
  46. configurable: true,
  47. writable: true
  48. });
  49. }
  50. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex
  51. if (!Array.prototype.findIndex) {
  52. Object.defineProperty(Array.prototype, 'findIndex', {
  53. value: function(predicate) {
  54. // 1. Let O be ? ToObject(this value).
  55. if (this == null) {
  56. throw new TypeError('"this" is null or not defined');
  57. }
  58. var o = Object(this);
  59. // 2. Let len be ? ToLength(? Get(O, "length")).
  60. var len = o.length >>> 0;
  61. // 3. If IsCallable(predicate) is false, throw a TypeError exception.
  62. if (typeof predicate !== 'function') {
  63. throw new TypeError('predicate must be a function');
  64. }
  65. // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
  66. var thisArg = arguments[1];
  67. // 5. Let k be 0.
  68. var k = 0;
  69. // 6. Repeat, while k < len
  70. while (k < len) {
  71. // a. Let Pk be ! ToString(k).
  72. // b. Let kValue be ? Get(O, Pk).
  73. // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
  74. // d. If testResult is true, return k.
  75. var kValue = o[k];
  76. if (predicate.call(thisArg, kValue, k, o)) {
  77. return k;
  78. }
  79. // e. Increase k by 1.
  80. k++;
  81. }
  82. // 7. Return -1.
  83. return -1;
  84. },
  85. configurable: true,
  86. writable: true
  87. });
  88. }