cy-element-ui 1.0.52 → 1.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/lib/alert.js +108 -108
  2. package/lib/aside.js +77 -77
  3. package/lib/autocomplete.js +5199 -360
  4. package/lib/avatar.js +4 -4
  5. package/lib/backtop.js +192 -101
  6. package/lib/badge.js +108 -108
  7. package/lib/breadcrumb-item.js +108 -108
  8. package/lib/breadcrumb.js +94 -94
  9. package/lib/button-group.js +4 -4
  10. package/lib/button.js +4 -4
  11. package/lib/calendar.js +1734 -137
  12. package/lib/card.js +96 -96
  13. package/lib/carousel-item.js +452 -108
  14. package/lib/carousel.js +1256 -105
  15. package/lib/cascader-panel.js +3524 -191
  16. package/lib/cascader.js +8077 -717
  17. package/lib/checkbox-button.js +151 -119
  18. package/lib/checkbox-group.js +47 -15
  19. package/lib/checkbox.js +47 -15
  20. package/lib/col.js +2 -2
  21. package/lib/collapse-item.js +815 -110
  22. package/lib/collapse.js +108 -108
  23. package/lib/color-picker.js +4705 -828
  24. package/lib/container.js +88 -88
  25. package/lib/date-picker.js +10735 -4709
  26. package/lib/descriptions-item.js +2 -2
  27. package/lib/descriptions.js +63 -8
  28. package/lib/dialog.js +1200 -22
  29. package/lib/directives/repeat-click.js +2 -2
  30. package/lib/divider.js +104 -104
  31. package/lib/drawer.js +875 -105
  32. package/lib/dropdown-item.js +128 -96
  33. package/lib/dropdown-menu.js +2301 -99
  34. package/lib/dropdown.js +990 -54
  35. package/lib/element-ui.common.js +31129 -13451
  36. package/lib/empty.js +793 -99
  37. package/lib/fileUpload.js +2542 -26
  38. package/lib/footer.js +77 -77
  39. package/lib/form-item.js +3305 -202
  40. package/lib/form.js +129 -115
  41. package/lib/header.js +77 -77
  42. package/lib/icon.js +67 -67
  43. package/lib/image.js +1662 -146
  44. package/lib/index.js +1 -1
  45. package/lib/infinite-scroll.js +435 -26
  46. package/lib/input-number.js +1458 -24
  47. package/lib/input.js +509 -37
  48. package/lib/link.js +4 -4
  49. package/lib/loading.js +886 -149
  50. package/lib/locale/format.js +1 -1
  51. package/lib/main.js +64 -64
  52. package/lib/menu-item-group.js +103 -103
  53. package/lib/menu-item.js +3140 -137
  54. package/lib/menu.js +1058 -123
  55. package/lib/message-box.js +2743 -188
  56. package/lib/message.js +1196 -118
  57. package/lib/mixins/migrating.js +1 -1
  58. package/lib/notification.js +1196 -119
  59. package/lib/option-group.js +151 -119
  60. package/lib/option.js +392 -16
  61. package/lib/page-header.js +781 -87
  62. package/lib/pagination.js +7747 -646
  63. package/lib/popconfirm.js +3606 -219
  64. package/lib/popover.js +2604 -79
  65. package/lib/progress.js +4 -4
  66. package/lib/radio-button.js +151 -119
  67. package/lib/radio-group.js +151 -119
  68. package/lib/radio.js +47 -15
  69. package/lib/rate.js +756 -113
  70. package/lib/result.js +108 -108
  71. package/lib/row.js +2 -2
  72. package/lib/scrollbar.js +1813 -41
  73. package/lib/select.js +5547 -209
  74. package/lib/selectDisplayInput.js +4 -4
  75. package/lib/skeleton-item.js +108 -108
  76. package/lib/skeleton.js +108 -108
  77. package/lib/slider.js +4768 -530
  78. package/lib/spinner.js +100 -100
  79. package/lib/statistic.js +9600 -112
  80. package/lib/step.js +108 -108
  81. package/lib/steps.js +514 -99
  82. package/lib/subTitle.js +91 -91
  83. package/lib/submenu.js +2397 -76
  84. package/lib/switch.js +582 -127
  85. package/lib/tab-pane.js +108 -108
  86. package/lib/tabDialog.js +1630 -104
  87. package/lib/table-column.js +1115 -267
  88. package/lib/table.js +7085 -1253
  89. package/lib/tabs.js +1615 -113
  90. package/lib/tag.js +4 -4
  91. package/lib/time-picker.js +6487 -550
  92. package/lib/time-select.js +6334 -407
  93. package/lib/timeline-item.js +108 -108
  94. package/lib/timeline.js +4 -4
  95. package/lib/tooltip.js +2688 -44
  96. package/lib/transfer.js +2238 -146
  97. package/lib/transitions/collapse-transition.js +1 -1
  98. package/lib/tree.js +1563 -148
  99. package/lib/treeSelect.js +3421 -106
  100. package/lib/upload.js +1198 -31
  101. package/lib/utils/clickoutside.js +1 -1
  102. package/lib/utils/date-util.js +2 -2
  103. package/lib/utils/popup/index.js +2 -2
  104. package/lib/utils/popup/popup-manager.js +1 -1
  105. package/lib/utils/util.js +1 -1
  106. package/lib/utils/vdom.js +1 -1
  107. package/lib/utils/vue-popper.js +1 -1
  108. package/package.json +1 -1
  109. package/src/directives/repeat-click.js +2 -2
  110. package/src/index.js +1 -1
  111. package/src/locale/format.js +1 -1
  112. package/src/mixins/migrating.js +1 -1
  113. package/src/transitions/collapse-transition.js +1 -1
  114. package/src/utils/clickoutside.js +1 -1
  115. package/src/utils/date-util.js +2 -2
  116. package/src/utils/popup/index.js +2 -2
  117. package/src/utils/popup/popup-manager.js +1 -1
  118. package/src/utils/util.js +1 -1
  119. package/src/utils/vdom.js +1 -1
  120. package/src/utils/vue-popper.js +1 -1
package/lib/carousel.js CHANGED
@@ -82,117 +82,199 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 115);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 180);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
- /***/ 0:
90
+ /***/ 14:
91
91
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
92
 
93
93
  "use strict";
94
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
95
- /* globals __VUE_SSR_CONTEXT__ */
94
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addResizeListener; });
95
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeResizeListener; });
96
+ /* harmony import */ var resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
97
+ /* harmony import */ var throttle_debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
98
+ /* harmony import */ var throttle_debounce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(throttle_debounce__WEBPACK_IMPORTED_MODULE_1__);
96
99
 
97
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
98
- // This module is a runtime utility for cleaner component module output and will
99
- // be included in the final webpack user bundle.
100
100
 
101
- function normalizeComponent(
102
- scriptExports,
103
- render,
104
- staticRenderFns,
105
- functionalTemplate,
106
- injectStyles,
107
- scopeId,
108
- moduleIdentifier /* server only */,
109
- shadowMode /* vue-cli only */
110
- ) {
111
- // Vue.extend constructor export interop
112
- var options =
113
- typeof scriptExports === 'function' ? scriptExports.options : scriptExports
114
101
 
115
- // render functions
116
- if (render) {
117
- options.render = render
118
- options.staticRenderFns = staticRenderFns
119
- options._compiled = true
120
- }
102
+ var isServer = typeof window === 'undefined';
121
103
 
122
- // functional template
123
- if (functionalTemplate) {
124
- options.functional = true
125
- }
104
+ /* istanbul ignore next */
105
+ var resizeHandler = function resizeHandler(entries) {
106
+ for (var _iterator = entries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
107
+ var _ref;
126
108
 
127
- // scopedId
128
- if (scopeId) {
129
- options._scopeId = 'data-v-' + scopeId
130
- }
109
+ if (_isArray) {
110
+ if (_i >= _iterator.length) break;
111
+ _ref = _iterator[_i++];
112
+ } else {
113
+ _i = _iterator.next();
114
+ if (_i.done) break;
115
+ _ref = _i.value;
116
+ }
131
117
 
132
- var hook
133
- if (moduleIdentifier) {
134
- // server build
135
- hook = function (context) {
136
- // 2.3 injection
137
- context =
138
- context || // cached call
139
- (this.$vnode && this.$vnode.ssrContext) || // stateful
140
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
141
- // 2.2 with runInNewContext: true
142
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
143
- context = __VUE_SSR_CONTEXT__
144
- }
145
- // inject component styles
146
- if (injectStyles) {
147
- injectStyles.call(this, context)
148
- }
149
- // register component module identifier for async chunk inferrence
150
- if (context && context._registeredComponents) {
151
- context._registeredComponents.add(moduleIdentifier)
152
- }
153
- }
154
- // used by ssr in case component is cached and beforeCreate
155
- // never gets called
156
- options._ssrRegister = hook
157
- } else if (injectStyles) {
158
- hook = shadowMode
159
- ? function () {
160
- injectStyles.call(
161
- this,
162
- (options.functional ? this.parent : this).$root.$options.shadowRoot
163
- )
164
- }
165
- : injectStyles
166
- }
118
+ var entry = _ref;
167
119
 
168
- if (hook) {
169
- if (options.functional) {
170
- // for template-only hot-reload because in that case the render fn doesn't
171
- // go through the normalizer
172
- options._injectStyles = hook
173
- // register for functional component in vue file
174
- var originalRender = options.render
175
- options.render = function renderWithStyleInjection(h, context) {
176
- hook.call(context)
177
- return originalRender(h, context)
178
- }
179
- } else {
180
- // inject component registration as beforeCreate hook
181
- var existing = options.beforeCreate
182
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
183
- }
184
- }
120
+ var listeners = entry.target.__resizeListeners__ || [];
121
+ if (listeners.length) {
122
+ listeners.forEach(function (fn) {
123
+ fn();
124
+ });
125
+ }
126
+ }
127
+ };
185
128
 
186
- return {
187
- exports: scriptExports,
188
- options: options
189
- }
190
- }
129
+ /* istanbul ignore next */
130
+ var addResizeListener = function addResizeListener(element, fn) {
131
+ if (isServer) return;
132
+ if (!element.__resizeListeners__) {
133
+ element.__resizeListeners__ = [];
134
+ element.__ro__ = new resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"](Object(throttle_debounce__WEBPACK_IMPORTED_MODULE_1__["debounce"])(16, resizeHandler));
135
+ element.__ro__.observe(element);
136
+ }
137
+ element.__resizeListeners__.push(fn);
138
+ };
139
+
140
+ /* istanbul ignore next */
141
+ var removeResizeListener = function removeResizeListener(element, fn) {
142
+ if (!element || !element.__resizeListeners__) return;
143
+ element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
144
+ if (!element.__resizeListeners__.length) {
145
+ element.__ro__.disconnect();
146
+ }
147
+ };
148
+
149
+ /***/ }),
150
+
151
+ /***/ 16:
152
+ /***/ (function(module, exports, __webpack_require__) {
153
+
154
+ /* eslint-disable no-undefined */
155
+
156
+ var throttle = __webpack_require__(17);
157
+
158
+ /**
159
+ * Debounce execution of a function. Debouncing, unlike throttling,
160
+ * guarantees that a function is only executed a single time, either at the
161
+ * very beginning of a series of calls, or at the very end.
162
+ *
163
+ * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
164
+ * @param {Boolean} [atBegin] Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
165
+ * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
166
+ * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
167
+ * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
168
+ * to `callback` when the debounced-function is executed.
169
+ *
170
+ * @return {Function} A new, debounced function.
171
+ */
172
+ module.exports = function ( delay, atBegin, callback ) {
173
+ return callback === undefined ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false);
174
+ };
191
175
 
192
176
 
193
177
  /***/ }),
194
178
 
195
- /***/ 115:
179
+ /***/ 17:
180
+ /***/ (function(module, exports) {
181
+
182
+ /* eslint-disable no-undefined,no-param-reassign,no-shadow */
183
+
184
+ /**
185
+ * Throttle execution of a function. Especially useful for rate limiting
186
+ * execution of handlers on events like resize and scroll.
187
+ *
188
+ * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
189
+ * @param {Boolean} [noTrailing] Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the
190
+ * throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time
191
+ * after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,
192
+ * the internal counter is reset)
193
+ * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
194
+ * to `callback` when the throttled-function is executed.
195
+ * @param {Boolean} [debounceMode] If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),
196
+ * schedule `callback` to execute after `delay` ms.
197
+ *
198
+ * @return {Function} A new, throttled, function.
199
+ */
200
+ module.exports = function ( delay, noTrailing, callback, debounceMode ) {
201
+
202
+ // After wrapper has stopped being called, this timeout ensures that
203
+ // `callback` is executed at the proper times in `throttle` and `end`
204
+ // debounce modes.
205
+ var timeoutID;
206
+
207
+ // Keep track of the last time `callback` was executed.
208
+ var lastExec = 0;
209
+
210
+ // `noTrailing` defaults to falsy.
211
+ if ( typeof noTrailing !== 'boolean' ) {
212
+ debounceMode = callback;
213
+ callback = noTrailing;
214
+ noTrailing = undefined;
215
+ }
216
+
217
+ // The `wrapper` function encapsulates all of the throttling / debouncing
218
+ // functionality and when executed will limit the rate at which `callback`
219
+ // is executed.
220
+ function wrapper () {
221
+
222
+ var self = this;
223
+ var elapsed = Number(new Date()) - lastExec;
224
+ var args = arguments;
225
+
226
+ // Execute `callback` and update the `lastExec` timestamp.
227
+ function exec () {
228
+ lastExec = Number(new Date());
229
+ callback.apply(self, args);
230
+ }
231
+
232
+ // If `debounceMode` is true (at begin) this is used to clear the flag
233
+ // to allow future `callback` executions.
234
+ function clear () {
235
+ timeoutID = undefined;
236
+ }
237
+
238
+ if ( debounceMode && !timeoutID ) {
239
+ // Since `wrapper` is being called for the first time and
240
+ // `debounceMode` is true (at begin), execute `callback`.
241
+ exec();
242
+ }
243
+
244
+ // Clear any existing timeout.
245
+ if ( timeoutID ) {
246
+ clearTimeout(timeoutID);
247
+ }
248
+
249
+ if ( debounceMode === undefined && elapsed > delay ) {
250
+ // In throttle mode, if `delay` time has been exceeded, execute
251
+ // `callback`.
252
+ exec();
253
+
254
+ } else if ( noTrailing !== true ) {
255
+ // In trailing throttle mode, since `delay` time has not been
256
+ // exceeded, schedule `callback` to execute `delay` ms after most
257
+ // recent execution.
258
+ //
259
+ // If `debounceMode` is true (at begin), schedule `clear` to execute
260
+ // after `delay` ms.
261
+ //
262
+ // If `debounceMode` is false (at end), schedule `callback` to
263
+ // execute after `delay` ms.
264
+ timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
265
+ }
266
+
267
+ }
268
+
269
+ // Return the wrapper function.
270
+ return wrapper;
271
+
272
+ };
273
+
274
+
275
+ /***/ }),
276
+
277
+ /***/ 180:
196
278
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
279
 
198
280
  "use strict";
@@ -341,12 +423,12 @@ render._withStripped = true
341
423
 
342
424
  // CONCATENATED MODULE: ./packages/carousel/src/main.vue?vue&type=template&id=3171eb48
343
425
 
344
- // EXTERNAL MODULE: external "throttle-debounce/throttle"
345
- var throttle_ = __webpack_require__(25);
346
- var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle_);
426
+ // EXTERNAL MODULE: ./node_modules/throttle-debounce/throttle.js
427
+ var throttle = __webpack_require__(17);
428
+ var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle);
347
429
 
348
- // EXTERNAL MODULE: external "element-ui/src/utils/resize-event"
349
- var resize_event_ = __webpack_require__(17);
430
+ // EXTERNAL MODULE: ./src/utils/resize-event.js
431
+ var resize_event = __webpack_require__(14);
350
432
 
351
433
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/carousel/src/main.vue?vue&type=script&lang=js
352
434
 
@@ -584,7 +666,7 @@ var resize_event_ = __webpack_require__(17);
584
666
 
585
667
  this.updateItems();
586
668
  this.$nextTick(function () {
587
- Object(resize_event_["addResizeListener"])(_this4.$el, _this4.resetItemPosition);
669
+ Object(resize_event["a" /* addResizeListener */])(_this4.$el, _this4.resetItemPosition);
588
670
  if (_this4.initialIndex < _this4.items.length && _this4.initialIndex >= 0) {
589
671
  _this4.activeIndex = _this4.initialIndex;
590
672
  }
@@ -592,14 +674,14 @@ var resize_event_ = __webpack_require__(17);
592
674
  });
593
675
  },
594
676
  beforeDestroy: function beforeDestroy() {
595
- if (this.$el) Object(resize_event_["removeResizeListener"])(this.$el, this.resetItemPosition);
677
+ if (this.$el) Object(resize_event["b" /* removeResizeListener */])(this.$el, this.resetItemPosition);
596
678
  this.pauseTimer();
597
679
  }
598
680
  });
599
681
  // CONCATENATED MODULE: ./packages/carousel/src/main.vue?vue&type=script&lang=js
600
682
  /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
601
683
  // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
602
- var componentNormalizer = __webpack_require__(0);
684
+ var componentNormalizer = __webpack_require__(2);
603
685
 
604
686
  // CONCATENATED MODULE: ./packages/carousel/src/main.vue
605
687
 
@@ -633,17 +715,1086 @@ main.install = function (Vue) {
633
715
 
634
716
  /***/ }),
635
717
 
636
- /***/ 17:
637
- /***/ (function(module, exports) {
718
+ /***/ 2:
719
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
720
+
721
+ "use strict";
722
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
723
+ /* globals __VUE_SSR_CONTEXT__ */
724
+
725
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
726
+ // This module is a runtime utility for cleaner component module output and will
727
+ // be included in the final webpack user bundle.
728
+
729
+ function normalizeComponent(
730
+ scriptExports,
731
+ render,
732
+ staticRenderFns,
733
+ functionalTemplate,
734
+ injectStyles,
735
+ scopeId,
736
+ moduleIdentifier /* server only */,
737
+ shadowMode /* vue-cli only */
738
+ ) {
739
+ // Vue.extend constructor export interop
740
+ var options =
741
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
742
+
743
+ // render functions
744
+ if (render) {
745
+ options.render = render
746
+ options.staticRenderFns = staticRenderFns
747
+ options._compiled = true
748
+ }
749
+
750
+ // functional template
751
+ if (functionalTemplate) {
752
+ options.functional = true
753
+ }
754
+
755
+ // scopedId
756
+ if (scopeId) {
757
+ options._scopeId = 'data-v-' + scopeId
758
+ }
759
+
760
+ var hook
761
+ if (moduleIdentifier) {
762
+ // server build
763
+ hook = function (context) {
764
+ // 2.3 injection
765
+ context =
766
+ context || // cached call
767
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
768
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
769
+ // 2.2 with runInNewContext: true
770
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
771
+ context = __VUE_SSR_CONTEXT__
772
+ }
773
+ // inject component styles
774
+ if (injectStyles) {
775
+ injectStyles.call(this, context)
776
+ }
777
+ // register component module identifier for async chunk inferrence
778
+ if (context && context._registeredComponents) {
779
+ context._registeredComponents.add(moduleIdentifier)
780
+ }
781
+ }
782
+ // used by ssr in case component is cached and beforeCreate
783
+ // never gets called
784
+ options._ssrRegister = hook
785
+ } else if (injectStyles) {
786
+ hook = shadowMode
787
+ ? function () {
788
+ injectStyles.call(
789
+ this,
790
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
791
+ )
792
+ }
793
+ : injectStyles
794
+ }
795
+
796
+ if (hook) {
797
+ if (options.functional) {
798
+ // for template-only hot-reload because in that case the render fn doesn't
799
+ // go through the normalizer
800
+ options._injectStyles = hook
801
+ // register for functional component in vue file
802
+ var originalRender = options.render
803
+ options.render = function renderWithStyleInjection(h, context) {
804
+ hook.call(context)
805
+ return originalRender(h, context)
806
+ }
807
+ } else {
808
+ // inject component registration as beforeCreate hook
809
+ var existing = options.beforeCreate
810
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
811
+ }
812
+ }
813
+
814
+ return {
815
+ exports: scriptExports,
816
+ options: options
817
+ }
818
+ }
819
+
820
+
821
+ /***/ }),
822
+
823
+ /***/ 21:
824
+ /***/ (function(module, exports, __webpack_require__) {
825
+
826
+ var throttle = __webpack_require__(17);
827
+ var debounce = __webpack_require__(16);
828
+
829
+ module.exports = {
830
+ throttle: throttle,
831
+ debounce: debounce
832
+ };
638
833
 
639
- module.exports = require("element-ui/src/utils/resize-event");
640
834
 
641
835
  /***/ }),
642
836
 
643
- /***/ 25:
837
+ /***/ 22:
838
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
839
+
840
+ "use strict";
841
+ /* WEBPACK VAR INJECTION */(function(global) {/**
842
+ * A collection of shims that provide minimal functionality of the ES6 collections.
843
+ *
844
+ * These implementations are not meant to be used outside of the ResizeObserver
845
+ * modules as they cover only a limited range of use cases.
846
+ */
847
+ /* eslint-disable require-jsdoc, valid-jsdoc */
848
+ var MapShim = (function () {
849
+ if (typeof Map !== 'undefined') {
850
+ return Map;
851
+ }
852
+ /**
853
+ * Returns index in provided array that matches the specified key.
854
+ *
855
+ * @param {Array<Array>} arr
856
+ * @param {*} key
857
+ * @returns {number}
858
+ */
859
+ function getIndex(arr, key) {
860
+ var result = -1;
861
+ arr.some(function (entry, index) {
862
+ if (entry[0] === key) {
863
+ result = index;
864
+ return true;
865
+ }
866
+ return false;
867
+ });
868
+ return result;
869
+ }
870
+ return /** @class */ (function () {
871
+ function class_1() {
872
+ this.__entries__ = [];
873
+ }
874
+ Object.defineProperty(class_1.prototype, "size", {
875
+ /**
876
+ * @returns {boolean}
877
+ */
878
+ get: function () {
879
+ return this.__entries__.length;
880
+ },
881
+ enumerable: true,
882
+ configurable: true
883
+ });
884
+ /**
885
+ * @param {*} key
886
+ * @returns {*}
887
+ */
888
+ class_1.prototype.get = function (key) {
889
+ var index = getIndex(this.__entries__, key);
890
+ var entry = this.__entries__[index];
891
+ return entry && entry[1];
892
+ };
893
+ /**
894
+ * @param {*} key
895
+ * @param {*} value
896
+ * @returns {void}
897
+ */
898
+ class_1.prototype.set = function (key, value) {
899
+ var index = getIndex(this.__entries__, key);
900
+ if (~index) {
901
+ this.__entries__[index][1] = value;
902
+ }
903
+ else {
904
+ this.__entries__.push([key, value]);
905
+ }
906
+ };
907
+ /**
908
+ * @param {*} key
909
+ * @returns {void}
910
+ */
911
+ class_1.prototype.delete = function (key) {
912
+ var entries = this.__entries__;
913
+ var index = getIndex(entries, key);
914
+ if (~index) {
915
+ entries.splice(index, 1);
916
+ }
917
+ };
918
+ /**
919
+ * @param {*} key
920
+ * @returns {void}
921
+ */
922
+ class_1.prototype.has = function (key) {
923
+ return !!~getIndex(this.__entries__, key);
924
+ };
925
+ /**
926
+ * @returns {void}
927
+ */
928
+ class_1.prototype.clear = function () {
929
+ this.__entries__.splice(0);
930
+ };
931
+ /**
932
+ * @param {Function} callback
933
+ * @param {*} [ctx=null]
934
+ * @returns {void}
935
+ */
936
+ class_1.prototype.forEach = function (callback, ctx) {
937
+ if (ctx === void 0) { ctx = null; }
938
+ for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
939
+ var entry = _a[_i];
940
+ callback.call(ctx, entry[1], entry[0]);
941
+ }
942
+ };
943
+ return class_1;
944
+ }());
945
+ })();
946
+
947
+ /**
948
+ * Detects whether window and document objects are available in current environment.
949
+ */
950
+ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
951
+
952
+ // Returns global object of a current environment.
953
+ var global$1 = (function () {
954
+ if (typeof global !== 'undefined' && global.Math === Math) {
955
+ return global;
956
+ }
957
+ if (typeof self !== 'undefined' && self.Math === Math) {
958
+ return self;
959
+ }
960
+ if (typeof window !== 'undefined' && window.Math === Math) {
961
+ return window;
962
+ }
963
+ // eslint-disable-next-line no-new-func
964
+ return Function('return this')();
965
+ })();
966
+
967
+ /**
968
+ * A shim for the requestAnimationFrame which falls back to the setTimeout if
969
+ * first one is not supported.
970
+ *
971
+ * @returns {number} Requests' identifier.
972
+ */
973
+ var requestAnimationFrame$1 = (function () {
974
+ if (typeof requestAnimationFrame === 'function') {
975
+ // It's required to use a bounded function because IE sometimes throws
976
+ // an "Invalid calling object" error if rAF is invoked without the global
977
+ // object on the left hand side.
978
+ return requestAnimationFrame.bind(global$1);
979
+ }
980
+ return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
981
+ })();
982
+
983
+ // Defines minimum timeout before adding a trailing call.
984
+ var trailingTimeout = 2;
985
+ /**
986
+ * Creates a wrapper function which ensures that provided callback will be
987
+ * invoked only once during the specified delay period.
988
+ *
989
+ * @param {Function} callback - Function to be invoked after the delay period.
990
+ * @param {number} delay - Delay after which to invoke callback.
991
+ * @returns {Function}
992
+ */
993
+ function throttle (callback, delay) {
994
+ var leadingCall = false, trailingCall = false, lastCallTime = 0;
995
+ /**
996
+ * Invokes the original callback function and schedules new invocation if
997
+ * the "proxy" was called during current request.
998
+ *
999
+ * @returns {void}
1000
+ */
1001
+ function resolvePending() {
1002
+ if (leadingCall) {
1003
+ leadingCall = false;
1004
+ callback();
1005
+ }
1006
+ if (trailingCall) {
1007
+ proxy();
1008
+ }
1009
+ }
1010
+ /**
1011
+ * Callback invoked after the specified delay. It will further postpone
1012
+ * invocation of the original function delegating it to the
1013
+ * requestAnimationFrame.
1014
+ *
1015
+ * @returns {void}
1016
+ */
1017
+ function timeoutCallback() {
1018
+ requestAnimationFrame$1(resolvePending);
1019
+ }
1020
+ /**
1021
+ * Schedules invocation of the original function.
1022
+ *
1023
+ * @returns {void}
1024
+ */
1025
+ function proxy() {
1026
+ var timeStamp = Date.now();
1027
+ if (leadingCall) {
1028
+ // Reject immediately following calls.
1029
+ if (timeStamp - lastCallTime < trailingTimeout) {
1030
+ return;
1031
+ }
1032
+ // Schedule new call to be in invoked when the pending one is resolved.
1033
+ // This is important for "transitions" which never actually start
1034
+ // immediately so there is a chance that we might miss one if change
1035
+ // happens amids the pending invocation.
1036
+ trailingCall = true;
1037
+ }
1038
+ else {
1039
+ leadingCall = true;
1040
+ trailingCall = false;
1041
+ setTimeout(timeoutCallback, delay);
1042
+ }
1043
+ lastCallTime = timeStamp;
1044
+ }
1045
+ return proxy;
1046
+ }
1047
+
1048
+ // Minimum delay before invoking the update of observers.
1049
+ var REFRESH_DELAY = 20;
1050
+ // A list of substrings of CSS properties used to find transition events that
1051
+ // might affect dimensions of observed elements.
1052
+ var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
1053
+ // Check if MutationObserver is available.
1054
+ var mutationObserverSupported = typeof MutationObserver !== 'undefined';
1055
+ /**
1056
+ * Singleton controller class which handles updates of ResizeObserver instances.
1057
+ */
1058
+ var ResizeObserverController = /** @class */ (function () {
1059
+ /**
1060
+ * Creates a new instance of ResizeObserverController.
1061
+ *
1062
+ * @private
1063
+ */
1064
+ function ResizeObserverController() {
1065
+ /**
1066
+ * Indicates whether DOM listeners have been added.
1067
+ *
1068
+ * @private {boolean}
1069
+ */
1070
+ this.connected_ = false;
1071
+ /**
1072
+ * Tells that controller has subscribed for Mutation Events.
1073
+ *
1074
+ * @private {boolean}
1075
+ */
1076
+ this.mutationEventsAdded_ = false;
1077
+ /**
1078
+ * Keeps reference to the instance of MutationObserver.
1079
+ *
1080
+ * @private {MutationObserver}
1081
+ */
1082
+ this.mutationsObserver_ = null;
1083
+ /**
1084
+ * A list of connected observers.
1085
+ *
1086
+ * @private {Array<ResizeObserverSPI>}
1087
+ */
1088
+ this.observers_ = [];
1089
+ this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
1090
+ this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
1091
+ }
1092
+ /**
1093
+ * Adds observer to observers list.
1094
+ *
1095
+ * @param {ResizeObserverSPI} observer - Observer to be added.
1096
+ * @returns {void}
1097
+ */
1098
+ ResizeObserverController.prototype.addObserver = function (observer) {
1099
+ if (!~this.observers_.indexOf(observer)) {
1100
+ this.observers_.push(observer);
1101
+ }
1102
+ // Add listeners if they haven't been added yet.
1103
+ if (!this.connected_) {
1104
+ this.connect_();
1105
+ }
1106
+ };
1107
+ /**
1108
+ * Removes observer from observers list.
1109
+ *
1110
+ * @param {ResizeObserverSPI} observer - Observer to be removed.
1111
+ * @returns {void}
1112
+ */
1113
+ ResizeObserverController.prototype.removeObserver = function (observer) {
1114
+ var observers = this.observers_;
1115
+ var index = observers.indexOf(observer);
1116
+ // Remove observer if it's present in registry.
1117
+ if (~index) {
1118
+ observers.splice(index, 1);
1119
+ }
1120
+ // Remove listeners if controller has no connected observers.
1121
+ if (!observers.length && this.connected_) {
1122
+ this.disconnect_();
1123
+ }
1124
+ };
1125
+ /**
1126
+ * Invokes the update of observers. It will continue running updates insofar
1127
+ * it detects changes.
1128
+ *
1129
+ * @returns {void}
1130
+ */
1131
+ ResizeObserverController.prototype.refresh = function () {
1132
+ var changesDetected = this.updateObservers_();
1133
+ // Continue running updates if changes have been detected as there might
1134
+ // be future ones caused by CSS transitions.
1135
+ if (changesDetected) {
1136
+ this.refresh();
1137
+ }
1138
+ };
1139
+ /**
1140
+ * Updates every observer from observers list and notifies them of queued
1141
+ * entries.
1142
+ *
1143
+ * @private
1144
+ * @returns {boolean} Returns "true" if any observer has detected changes in
1145
+ * dimensions of it's elements.
1146
+ */
1147
+ ResizeObserverController.prototype.updateObservers_ = function () {
1148
+ // Collect observers that have active observations.
1149
+ var activeObservers = this.observers_.filter(function (observer) {
1150
+ return observer.gatherActive(), observer.hasActive();
1151
+ });
1152
+ // Deliver notifications in a separate cycle in order to avoid any
1153
+ // collisions between observers, e.g. when multiple instances of
1154
+ // ResizeObserver are tracking the same element and the callback of one
1155
+ // of them changes content dimensions of the observed target. Sometimes
1156
+ // this may result in notifications being blocked for the rest of observers.
1157
+ activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
1158
+ return activeObservers.length > 0;
1159
+ };
1160
+ /**
1161
+ * Initializes DOM listeners.
1162
+ *
1163
+ * @private
1164
+ * @returns {void}
1165
+ */
1166
+ ResizeObserverController.prototype.connect_ = function () {
1167
+ // Do nothing if running in a non-browser environment or if listeners
1168
+ // have been already added.
1169
+ if (!isBrowser || this.connected_) {
1170
+ return;
1171
+ }
1172
+ // Subscription to the "Transitionend" event is used as a workaround for
1173
+ // delayed transitions. This way it's possible to capture at least the
1174
+ // final state of an element.
1175
+ document.addEventListener('transitionend', this.onTransitionEnd_);
1176
+ window.addEventListener('resize', this.refresh);
1177
+ if (mutationObserverSupported) {
1178
+ this.mutationsObserver_ = new MutationObserver(this.refresh);
1179
+ this.mutationsObserver_.observe(document, {
1180
+ attributes: true,
1181
+ childList: true,
1182
+ characterData: true,
1183
+ subtree: true
1184
+ });
1185
+ }
1186
+ else {
1187
+ document.addEventListener('DOMSubtreeModified', this.refresh);
1188
+ this.mutationEventsAdded_ = true;
1189
+ }
1190
+ this.connected_ = true;
1191
+ };
1192
+ /**
1193
+ * Removes DOM listeners.
1194
+ *
1195
+ * @private
1196
+ * @returns {void}
1197
+ */
1198
+ ResizeObserverController.prototype.disconnect_ = function () {
1199
+ // Do nothing if running in a non-browser environment or if listeners
1200
+ // have been already removed.
1201
+ if (!isBrowser || !this.connected_) {
1202
+ return;
1203
+ }
1204
+ document.removeEventListener('transitionend', this.onTransitionEnd_);
1205
+ window.removeEventListener('resize', this.refresh);
1206
+ if (this.mutationsObserver_) {
1207
+ this.mutationsObserver_.disconnect();
1208
+ }
1209
+ if (this.mutationEventsAdded_) {
1210
+ document.removeEventListener('DOMSubtreeModified', this.refresh);
1211
+ }
1212
+ this.mutationsObserver_ = null;
1213
+ this.mutationEventsAdded_ = false;
1214
+ this.connected_ = false;
1215
+ };
1216
+ /**
1217
+ * "Transitionend" event handler.
1218
+ *
1219
+ * @private
1220
+ * @param {TransitionEvent} event
1221
+ * @returns {void}
1222
+ */
1223
+ ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
1224
+ var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
1225
+ // Detect whether transition may affect dimensions of an element.
1226
+ var isReflowProperty = transitionKeys.some(function (key) {
1227
+ return !!~propertyName.indexOf(key);
1228
+ });
1229
+ if (isReflowProperty) {
1230
+ this.refresh();
1231
+ }
1232
+ };
1233
+ /**
1234
+ * Returns instance of the ResizeObserverController.
1235
+ *
1236
+ * @returns {ResizeObserverController}
1237
+ */
1238
+ ResizeObserverController.getInstance = function () {
1239
+ if (!this.instance_) {
1240
+ this.instance_ = new ResizeObserverController();
1241
+ }
1242
+ return this.instance_;
1243
+ };
1244
+ /**
1245
+ * Holds reference to the controller's instance.
1246
+ *
1247
+ * @private {ResizeObserverController}
1248
+ */
1249
+ ResizeObserverController.instance_ = null;
1250
+ return ResizeObserverController;
1251
+ }());
1252
+
1253
+ /**
1254
+ * Defines non-writable/enumerable properties of the provided target object.
1255
+ *
1256
+ * @param {Object} target - Object for which to define properties.
1257
+ * @param {Object} props - Properties to be defined.
1258
+ * @returns {Object} Target object.
1259
+ */
1260
+ var defineConfigurable = (function (target, props) {
1261
+ for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
1262
+ var key = _a[_i];
1263
+ Object.defineProperty(target, key, {
1264
+ value: props[key],
1265
+ enumerable: false,
1266
+ writable: false,
1267
+ configurable: true
1268
+ });
1269
+ }
1270
+ return target;
1271
+ });
1272
+
1273
+ /**
1274
+ * Returns the global object associated with provided element.
1275
+ *
1276
+ * @param {Object} target
1277
+ * @returns {Object}
1278
+ */
1279
+ var getWindowOf = (function (target) {
1280
+ // Assume that the element is an instance of Node, which means that it
1281
+ // has the "ownerDocument" property from which we can retrieve a
1282
+ // corresponding global object.
1283
+ var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
1284
+ // Return the local global object if it's not possible extract one from
1285
+ // provided element.
1286
+ return ownerGlobal || global$1;
1287
+ });
1288
+
1289
+ // Placeholder of an empty content rectangle.
1290
+ var emptyRect = createRectInit(0, 0, 0, 0);
1291
+ /**
1292
+ * Converts provided string to a number.
1293
+ *
1294
+ * @param {number|string} value
1295
+ * @returns {number}
1296
+ */
1297
+ function toFloat(value) {
1298
+ return parseFloat(value) || 0;
1299
+ }
1300
+ /**
1301
+ * Extracts borders size from provided styles.
1302
+ *
1303
+ * @param {CSSStyleDeclaration} styles
1304
+ * @param {...string} positions - Borders positions (top, right, ...)
1305
+ * @returns {number}
1306
+ */
1307
+ function getBordersSize(styles) {
1308
+ var positions = [];
1309
+ for (var _i = 1; _i < arguments.length; _i++) {
1310
+ positions[_i - 1] = arguments[_i];
1311
+ }
1312
+ return positions.reduce(function (size, position) {
1313
+ var value = styles['border-' + position + '-width'];
1314
+ return size + toFloat(value);
1315
+ }, 0);
1316
+ }
1317
+ /**
1318
+ * Extracts paddings sizes from provided styles.
1319
+ *
1320
+ * @param {CSSStyleDeclaration} styles
1321
+ * @returns {Object} Paddings box.
1322
+ */
1323
+ function getPaddings(styles) {
1324
+ var positions = ['top', 'right', 'bottom', 'left'];
1325
+ var paddings = {};
1326
+ for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
1327
+ var position = positions_1[_i];
1328
+ var value = styles['padding-' + position];
1329
+ paddings[position] = toFloat(value);
1330
+ }
1331
+ return paddings;
1332
+ }
1333
+ /**
1334
+ * Calculates content rectangle of provided SVG element.
1335
+ *
1336
+ * @param {SVGGraphicsElement} target - Element content rectangle of which needs
1337
+ * to be calculated.
1338
+ * @returns {DOMRectInit}
1339
+ */
1340
+ function getSVGContentRect(target) {
1341
+ var bbox = target.getBBox();
1342
+ return createRectInit(0, 0, bbox.width, bbox.height);
1343
+ }
1344
+ /**
1345
+ * Calculates content rectangle of provided HTMLElement.
1346
+ *
1347
+ * @param {HTMLElement} target - Element for which to calculate the content rectangle.
1348
+ * @returns {DOMRectInit}
1349
+ */
1350
+ function getHTMLElementContentRect(target) {
1351
+ // Client width & height properties can't be
1352
+ // used exclusively as they provide rounded values.
1353
+ var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
1354
+ // By this condition we can catch all non-replaced inline, hidden and
1355
+ // detached elements. Though elements with width & height properties less
1356
+ // than 0.5 will be discarded as well.
1357
+ //
1358
+ // Without it we would need to implement separate methods for each of
1359
+ // those cases and it's not possible to perform a precise and performance
1360
+ // effective test for hidden elements. E.g. even jQuery's ':visible' filter
1361
+ // gives wrong results for elements with width & height less than 0.5.
1362
+ if (!clientWidth && !clientHeight) {
1363
+ return emptyRect;
1364
+ }
1365
+ var styles = getWindowOf(target).getComputedStyle(target);
1366
+ var paddings = getPaddings(styles);
1367
+ var horizPad = paddings.left + paddings.right;
1368
+ var vertPad = paddings.top + paddings.bottom;
1369
+ // Computed styles of width & height are being used because they are the
1370
+ // only dimensions available to JS that contain non-rounded values. It could
1371
+ // be possible to utilize the getBoundingClientRect if only it's data wasn't
1372
+ // affected by CSS transformations let alone paddings, borders and scroll bars.
1373
+ var width = toFloat(styles.width), height = toFloat(styles.height);
1374
+ // Width & height include paddings and borders when the 'border-box' box
1375
+ // model is applied (except for IE).
1376
+ if (styles.boxSizing === 'border-box') {
1377
+ // Following conditions are required to handle Internet Explorer which
1378
+ // doesn't include paddings and borders to computed CSS dimensions.
1379
+ //
1380
+ // We can say that if CSS dimensions + paddings are equal to the "client"
1381
+ // properties then it's either IE, and thus we don't need to subtract
1382
+ // anything, or an element merely doesn't have paddings/borders styles.
1383
+ if (Math.round(width + horizPad) !== clientWidth) {
1384
+ width -= getBordersSize(styles, 'left', 'right') + horizPad;
1385
+ }
1386
+ if (Math.round(height + vertPad) !== clientHeight) {
1387
+ height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
1388
+ }
1389
+ }
1390
+ // Following steps can't be applied to the document's root element as its
1391
+ // client[Width/Height] properties represent viewport area of the window.
1392
+ // Besides, it's as well not necessary as the <html> itself neither has
1393
+ // rendered scroll bars nor it can be clipped.
1394
+ if (!isDocumentElement(target)) {
1395
+ // In some browsers (only in Firefox, actually) CSS width & height
1396
+ // include scroll bars size which can be removed at this step as scroll
1397
+ // bars are the only difference between rounded dimensions + paddings
1398
+ // and "client" properties, though that is not always true in Chrome.
1399
+ var vertScrollbar = Math.round(width + horizPad) - clientWidth;
1400
+ var horizScrollbar = Math.round(height + vertPad) - clientHeight;
1401
+ // Chrome has a rather weird rounding of "client" properties.
1402
+ // E.g. for an element with content width of 314.2px it sometimes gives
1403
+ // the client width of 315px and for the width of 314.7px it may give
1404
+ // 314px. And it doesn't happen all the time. So just ignore this delta
1405
+ // as a non-relevant.
1406
+ if (Math.abs(vertScrollbar) !== 1) {
1407
+ width -= vertScrollbar;
1408
+ }
1409
+ if (Math.abs(horizScrollbar) !== 1) {
1410
+ height -= horizScrollbar;
1411
+ }
1412
+ }
1413
+ return createRectInit(paddings.left, paddings.top, width, height);
1414
+ }
1415
+ /**
1416
+ * Checks whether provided element is an instance of the SVGGraphicsElement.
1417
+ *
1418
+ * @param {Element} target - Element to be checked.
1419
+ * @returns {boolean}
1420
+ */
1421
+ var isSVGGraphicsElement = (function () {
1422
+ // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
1423
+ // interface.
1424
+ if (typeof SVGGraphicsElement !== 'undefined') {
1425
+ return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
1426
+ }
1427
+ // If it's so, then check that element is at least an instance of the
1428
+ // SVGElement and that it has the "getBBox" method.
1429
+ // eslint-disable-next-line no-extra-parens
1430
+ return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
1431
+ typeof target.getBBox === 'function'); };
1432
+ })();
1433
+ /**
1434
+ * Checks whether provided element is a document element (<html>).
1435
+ *
1436
+ * @param {Element} target - Element to be checked.
1437
+ * @returns {boolean}
1438
+ */
1439
+ function isDocumentElement(target) {
1440
+ return target === getWindowOf(target).document.documentElement;
1441
+ }
1442
+ /**
1443
+ * Calculates an appropriate content rectangle for provided html or svg element.
1444
+ *
1445
+ * @param {Element} target - Element content rectangle of which needs to be calculated.
1446
+ * @returns {DOMRectInit}
1447
+ */
1448
+ function getContentRect(target) {
1449
+ if (!isBrowser) {
1450
+ return emptyRect;
1451
+ }
1452
+ if (isSVGGraphicsElement(target)) {
1453
+ return getSVGContentRect(target);
1454
+ }
1455
+ return getHTMLElementContentRect(target);
1456
+ }
1457
+ /**
1458
+ * Creates rectangle with an interface of the DOMRectReadOnly.
1459
+ * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
1460
+ *
1461
+ * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
1462
+ * @returns {DOMRectReadOnly}
1463
+ */
1464
+ function createReadOnlyRect(_a) {
1465
+ var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
1466
+ // If DOMRectReadOnly is available use it as a prototype for the rectangle.
1467
+ var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
1468
+ var rect = Object.create(Constr.prototype);
1469
+ // Rectangle's properties are not writable and non-enumerable.
1470
+ defineConfigurable(rect, {
1471
+ x: x, y: y, width: width, height: height,
1472
+ top: y,
1473
+ right: x + width,
1474
+ bottom: height + y,
1475
+ left: x
1476
+ });
1477
+ return rect;
1478
+ }
1479
+ /**
1480
+ * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
1481
+ * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
1482
+ *
1483
+ * @param {number} x - X coordinate.
1484
+ * @param {number} y - Y coordinate.
1485
+ * @param {number} width - Rectangle's width.
1486
+ * @param {number} height - Rectangle's height.
1487
+ * @returns {DOMRectInit}
1488
+ */
1489
+ function createRectInit(x, y, width, height) {
1490
+ return { x: x, y: y, width: width, height: height };
1491
+ }
1492
+
1493
+ /**
1494
+ * Class that is responsible for computations of the content rectangle of
1495
+ * provided DOM element and for keeping track of it's changes.
1496
+ */
1497
+ var ResizeObservation = /** @class */ (function () {
1498
+ /**
1499
+ * Creates an instance of ResizeObservation.
1500
+ *
1501
+ * @param {Element} target - Element to be observed.
1502
+ */
1503
+ function ResizeObservation(target) {
1504
+ /**
1505
+ * Broadcasted width of content rectangle.
1506
+ *
1507
+ * @type {number}
1508
+ */
1509
+ this.broadcastWidth = 0;
1510
+ /**
1511
+ * Broadcasted height of content rectangle.
1512
+ *
1513
+ * @type {number}
1514
+ */
1515
+ this.broadcastHeight = 0;
1516
+ /**
1517
+ * Reference to the last observed content rectangle.
1518
+ *
1519
+ * @private {DOMRectInit}
1520
+ */
1521
+ this.contentRect_ = createRectInit(0, 0, 0, 0);
1522
+ this.target = target;
1523
+ }
1524
+ /**
1525
+ * Updates content rectangle and tells whether it's width or height properties
1526
+ * have changed since the last broadcast.
1527
+ *
1528
+ * @returns {boolean}
1529
+ */
1530
+ ResizeObservation.prototype.isActive = function () {
1531
+ var rect = getContentRect(this.target);
1532
+ this.contentRect_ = rect;
1533
+ return (rect.width !== this.broadcastWidth ||
1534
+ rect.height !== this.broadcastHeight);
1535
+ };
1536
+ /**
1537
+ * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
1538
+ * from the corresponding properties of the last observed content rectangle.
1539
+ *
1540
+ * @returns {DOMRectInit} Last observed content rectangle.
1541
+ */
1542
+ ResizeObservation.prototype.broadcastRect = function () {
1543
+ var rect = this.contentRect_;
1544
+ this.broadcastWidth = rect.width;
1545
+ this.broadcastHeight = rect.height;
1546
+ return rect;
1547
+ };
1548
+ return ResizeObservation;
1549
+ }());
1550
+
1551
+ var ResizeObserverEntry = /** @class */ (function () {
1552
+ /**
1553
+ * Creates an instance of ResizeObserverEntry.
1554
+ *
1555
+ * @param {Element} target - Element that is being observed.
1556
+ * @param {DOMRectInit} rectInit - Data of the element's content rectangle.
1557
+ */
1558
+ function ResizeObserverEntry(target, rectInit) {
1559
+ var contentRect = createReadOnlyRect(rectInit);
1560
+ // According to the specification following properties are not writable
1561
+ // and are also not enumerable in the native implementation.
1562
+ //
1563
+ // Property accessors are not being used as they'd require to define a
1564
+ // private WeakMap storage which may cause memory leaks in browsers that
1565
+ // don't support this type of collections.
1566
+ defineConfigurable(this, { target: target, contentRect: contentRect });
1567
+ }
1568
+ return ResizeObserverEntry;
1569
+ }());
1570
+
1571
+ var ResizeObserverSPI = /** @class */ (function () {
1572
+ /**
1573
+ * Creates a new instance of ResizeObserver.
1574
+ *
1575
+ * @param {ResizeObserverCallback} callback - Callback function that is invoked
1576
+ * when one of the observed elements changes it's content dimensions.
1577
+ * @param {ResizeObserverController} controller - Controller instance which
1578
+ * is responsible for the updates of observer.
1579
+ * @param {ResizeObserver} callbackCtx - Reference to the public
1580
+ * ResizeObserver instance which will be passed to callback function.
1581
+ */
1582
+ function ResizeObserverSPI(callback, controller, callbackCtx) {
1583
+ /**
1584
+ * Collection of resize observations that have detected changes in dimensions
1585
+ * of elements.
1586
+ *
1587
+ * @private {Array<ResizeObservation>}
1588
+ */
1589
+ this.activeObservations_ = [];
1590
+ /**
1591
+ * Registry of the ResizeObservation instances.
1592
+ *
1593
+ * @private {Map<Element, ResizeObservation>}
1594
+ */
1595
+ this.observations_ = new MapShim();
1596
+ if (typeof callback !== 'function') {
1597
+ throw new TypeError('The callback provided as parameter 1 is not a function.');
1598
+ }
1599
+ this.callback_ = callback;
1600
+ this.controller_ = controller;
1601
+ this.callbackCtx_ = callbackCtx;
1602
+ }
1603
+ /**
1604
+ * Starts observing provided element.
1605
+ *
1606
+ * @param {Element} target - Element to be observed.
1607
+ * @returns {void}
1608
+ */
1609
+ ResizeObserverSPI.prototype.observe = function (target) {
1610
+ if (!arguments.length) {
1611
+ throw new TypeError('1 argument required, but only 0 present.');
1612
+ }
1613
+ // Do nothing if current environment doesn't have the Element interface.
1614
+ if (typeof Element === 'undefined' || !(Element instanceof Object)) {
1615
+ return;
1616
+ }
1617
+ if (!(target instanceof getWindowOf(target).Element)) {
1618
+ throw new TypeError('parameter 1 is not of type "Element".');
1619
+ }
1620
+ var observations = this.observations_;
1621
+ // Do nothing if element is already being observed.
1622
+ if (observations.has(target)) {
1623
+ return;
1624
+ }
1625
+ observations.set(target, new ResizeObservation(target));
1626
+ this.controller_.addObserver(this);
1627
+ // Force the update of observations.
1628
+ this.controller_.refresh();
1629
+ };
1630
+ /**
1631
+ * Stops observing provided element.
1632
+ *
1633
+ * @param {Element} target - Element to stop observing.
1634
+ * @returns {void}
1635
+ */
1636
+ ResizeObserverSPI.prototype.unobserve = function (target) {
1637
+ if (!arguments.length) {
1638
+ throw new TypeError('1 argument required, but only 0 present.');
1639
+ }
1640
+ // Do nothing if current environment doesn't have the Element interface.
1641
+ if (typeof Element === 'undefined' || !(Element instanceof Object)) {
1642
+ return;
1643
+ }
1644
+ if (!(target instanceof getWindowOf(target).Element)) {
1645
+ throw new TypeError('parameter 1 is not of type "Element".');
1646
+ }
1647
+ var observations = this.observations_;
1648
+ // Do nothing if element is not being observed.
1649
+ if (!observations.has(target)) {
1650
+ return;
1651
+ }
1652
+ observations.delete(target);
1653
+ if (!observations.size) {
1654
+ this.controller_.removeObserver(this);
1655
+ }
1656
+ };
1657
+ /**
1658
+ * Stops observing all elements.
1659
+ *
1660
+ * @returns {void}
1661
+ */
1662
+ ResizeObserverSPI.prototype.disconnect = function () {
1663
+ this.clearActive();
1664
+ this.observations_.clear();
1665
+ this.controller_.removeObserver(this);
1666
+ };
1667
+ /**
1668
+ * Collects observation instances the associated element of which has changed
1669
+ * it's content rectangle.
1670
+ *
1671
+ * @returns {void}
1672
+ */
1673
+ ResizeObserverSPI.prototype.gatherActive = function () {
1674
+ var _this = this;
1675
+ this.clearActive();
1676
+ this.observations_.forEach(function (observation) {
1677
+ if (observation.isActive()) {
1678
+ _this.activeObservations_.push(observation);
1679
+ }
1680
+ });
1681
+ };
1682
+ /**
1683
+ * Invokes initial callback function with a list of ResizeObserverEntry
1684
+ * instances collected from active resize observations.
1685
+ *
1686
+ * @returns {void}
1687
+ */
1688
+ ResizeObserverSPI.prototype.broadcastActive = function () {
1689
+ // Do nothing if observer doesn't have active observations.
1690
+ if (!this.hasActive()) {
1691
+ return;
1692
+ }
1693
+ var ctx = this.callbackCtx_;
1694
+ // Create ResizeObserverEntry instance for every active observation.
1695
+ var entries = this.activeObservations_.map(function (observation) {
1696
+ return new ResizeObserverEntry(observation.target, observation.broadcastRect());
1697
+ });
1698
+ this.callback_.call(ctx, entries, ctx);
1699
+ this.clearActive();
1700
+ };
1701
+ /**
1702
+ * Clears the collection of active observations.
1703
+ *
1704
+ * @returns {void}
1705
+ */
1706
+ ResizeObserverSPI.prototype.clearActive = function () {
1707
+ this.activeObservations_.splice(0);
1708
+ };
1709
+ /**
1710
+ * Tells whether observer has active observations.
1711
+ *
1712
+ * @returns {boolean}
1713
+ */
1714
+ ResizeObserverSPI.prototype.hasActive = function () {
1715
+ return this.activeObservations_.length > 0;
1716
+ };
1717
+ return ResizeObserverSPI;
1718
+ }());
1719
+
1720
+ // Registry of internal observers. If WeakMap is not available use current shim
1721
+ // for the Map collection as it has all required methods and because WeakMap
1722
+ // can't be fully polyfilled anyway.
1723
+ var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
1724
+ /**
1725
+ * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
1726
+ * exposing only those methods and properties that are defined in the spec.
1727
+ */
1728
+ var ResizeObserver = /** @class */ (function () {
1729
+ /**
1730
+ * Creates a new instance of ResizeObserver.
1731
+ *
1732
+ * @param {ResizeObserverCallback} callback - Callback that is invoked when
1733
+ * dimensions of the observed elements change.
1734
+ */
1735
+ function ResizeObserver(callback) {
1736
+ if (!(this instanceof ResizeObserver)) {
1737
+ throw new TypeError('Cannot call a class as a function.');
1738
+ }
1739
+ if (!arguments.length) {
1740
+ throw new TypeError('1 argument required, but only 0 present.');
1741
+ }
1742
+ var controller = ResizeObserverController.getInstance();
1743
+ var observer = new ResizeObserverSPI(callback, controller, this);
1744
+ observers.set(this, observer);
1745
+ }
1746
+ return ResizeObserver;
1747
+ }());
1748
+ // Expose public methods of ResizeObserver.
1749
+ [
1750
+ 'observe',
1751
+ 'unobserve',
1752
+ 'disconnect'
1753
+ ].forEach(function (method) {
1754
+ ResizeObserver.prototype[method] = function () {
1755
+ var _a;
1756
+ return (_a = observers.get(this))[method].apply(_a, arguments);
1757
+ };
1758
+ });
1759
+
1760
+ var index = (function () {
1761
+ // Export existing implementation if available.
1762
+ if (typeof global$1.ResizeObserver !== 'undefined') {
1763
+ return global$1.ResizeObserver;
1764
+ }
1765
+ return ResizeObserver;
1766
+ })();
1767
+
1768
+ /* harmony default export */ __webpack_exports__["a"] = (index);
1769
+
1770
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(29)))
1771
+
1772
+ /***/ }),
1773
+
1774
+ /***/ 29:
644
1775
  /***/ (function(module, exports) {
645
1776
 
646
- module.exports = require("throttle-debounce/throttle");
1777
+ var g;
1778
+
1779
+ // This works in non-strict mode
1780
+ g = (function() {
1781
+ return this;
1782
+ })();
1783
+
1784
+ try {
1785
+ // This works if eval is allowed (see CSP)
1786
+ g = g || new Function("return this")();
1787
+ } catch (e) {
1788
+ // This works if the window reference is available
1789
+ if (typeof window === "object") g = window;
1790
+ }
1791
+
1792
+ // g can still be undefined, but nothing to do about it...
1793
+ // We return undefined, instead of nothing here, so it's
1794
+ // easier to handle this case. if(!global) { ...}
1795
+
1796
+ module.exports = g;
1797
+
647
1798
 
648
1799
  /***/ })
649
1800