eoss 0.1.0-alpha.34 → 0.1.0-alpha.35

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 (208) hide show
  1. package/lib/0.js +1 -1
  2. package/lib/1.js +1 -1
  3. package/lib/10.js +1 -1
  4. package/lib/11.js +1 -1
  5. package/lib/12.js +1 -1
  6. package/lib/13.js +1 -1
  7. package/lib/14.js +1 -1
  8. package/lib/15.js +1 -1
  9. package/lib/16.js +1 -1
  10. package/lib/17.js +1 -1
  11. package/lib/18.js +1 -1
  12. package/lib/19.js +1 -1
  13. package/lib/20.js +1 -1
  14. package/lib/21.js +1 -1
  15. package/lib/22.js +1 -1
  16. package/lib/23.js +1 -1
  17. package/lib/24.js +1 -1
  18. package/lib/25.js +1 -1
  19. package/lib/26.js +1 -1
  20. package/lib/27.js +1 -1
  21. package/lib/28.js +1 -1
  22. package/lib/29.js +1 -1
  23. package/lib/3.js +1 -1
  24. package/lib/30.js +1 -1
  25. package/lib/31.js +1 -1
  26. package/lib/32.js +1 -1
  27. package/lib/33.js +1 -1
  28. package/lib/34.js +1 -1
  29. package/lib/35.js +1 -1
  30. package/lib/36.js +1 -1
  31. package/lib/37.js +1 -1
  32. package/lib/38.js +1 -1
  33. package/lib/39.js +1 -1
  34. package/lib/4.js +1 -1
  35. package/lib/40.js +1 -1
  36. package/lib/41.js +1 -1
  37. package/lib/42.js +1 -1
  38. package/lib/43.js +1 -1
  39. package/lib/44.js +1 -1
  40. package/lib/45.js +1 -1
  41. package/lib/46.js +1 -1
  42. package/lib/47.js +1 -1
  43. package/lib/48.js +1 -1
  44. package/lib/49.js +1 -1
  45. package/lib/5.js +1 -1
  46. package/lib/50.js +1 -1
  47. package/lib/51.js +1 -1
  48. package/lib/52.js +1 -1
  49. package/lib/53.js +1 -1
  50. package/lib/54.js +1 -1
  51. package/lib/55.js +1 -1
  52. package/lib/56.js +1 -1
  53. package/lib/57.js +1 -1
  54. package/lib/58.js +1 -1
  55. package/lib/59.js +1 -1
  56. package/lib/6.js +1 -1
  57. package/lib/60.js +1 -1
  58. package/lib/61.js +1 -1
  59. package/lib/62.js +1 -1
  60. package/lib/63.js +1 -1
  61. package/lib/64.js +1 -1
  62. package/lib/65.js +1 -1
  63. package/lib/66.js +1 -1
  64. package/lib/67.js +1 -1
  65. package/lib/68.js +1 -1
  66. package/lib/69.js +1 -1
  67. package/lib/7.js +1 -1
  68. package/lib/70.js +1 -1
  69. package/lib/71.js +1 -1
  70. package/lib/72.js +1 -1
  71. package/lib/73.js +1 -1
  72. package/lib/74.js +1 -1
  73. package/lib/75.js +1 -1
  74. package/lib/76.js +1 -1
  75. package/lib/77.js +1 -1
  76. package/lib/78.js +1 -1
  77. package/lib/79.js +1 -1
  78. package/lib/8.js +1 -1
  79. package/lib/80.js +1 -1
  80. package/lib/81.js +1 -1
  81. package/lib/9.js +1 -1
  82. package/lib/account-login.js +985 -1010
  83. package/lib/alert.js +2 -2
  84. package/lib/aside.js +2 -2
  85. package/lib/audit-trajectory.js +145 -145
  86. package/lib/autocomplete.js +1778 -2002
  87. package/lib/avatar.js +2 -2
  88. package/lib/backtop.js +2 -2
  89. package/lib/badge.js +2 -2
  90. package/lib/breadcrumb-item.js +4 -4
  91. package/lib/breadcrumb.js +4 -4
  92. package/lib/button-group.js +2 -2
  93. package/lib/button.js +2 -2
  94. package/lib/ca-login.js +837 -862
  95. package/lib/calendar.js +837 -862
  96. package/lib/card.js +2 -2
  97. package/lib/carousel-item.js +839 -864
  98. package/lib/carousel.js +839 -864
  99. package/lib/cascader-panel.js +839 -864
  100. package/lib/cascader.js +1780 -2004
  101. package/lib/checkbox-button.js +2 -2
  102. package/lib/checkbox-group.js +987 -1012
  103. package/lib/checkbox.js +2 -2
  104. package/lib/col.js +2 -2
  105. package/lib/collapse-item.js +839 -864
  106. package/lib/collapse.js +839 -864
  107. package/lib/color-picker.js +942 -1141
  108. package/lib/container.js +2 -2
  109. package/lib/cron.js +2 -2
  110. package/lib/data-table.js +987 -1012
  111. package/lib/date-picker.js +1785 -2009
  112. package/lib/dialog.js +837 -862
  113. package/lib/divider.js +2 -2
  114. package/lib/drawer.js +2 -2
  115. package/lib/dropdown-item.js +4 -4
  116. package/lib/dropdown-menu.js +942 -1141
  117. package/lib/dropdown.js +837 -862
  118. package/lib/email-login.js +986 -1011
  119. package/lib/empty.js +2 -2
  120. package/lib/eoss.common.js +2935 -2523
  121. package/lib/flip.js +2 -2
  122. package/lib/flow-group.js +841 -866
  123. package/lib/flow.js +1073 -1098
  124. package/lib/flows.js +993 -1018
  125. package/lib/footer.js +2 -2
  126. package/lib/form-item.js +2275 -2300
  127. package/lib/form.js +1034 -1046
  128. package/lib/guide.js +2 -2
  129. package/lib/header.js +2 -2
  130. package/lib/icon.js +981 -1006
  131. package/lib/icons.js +2 -2
  132. package/lib/image-viewer.js +837 -862
  133. package/lib/image.js +4 -4
  134. package/lib/index.js +1 -1
  135. package/lib/infinite-scroll.js +2 -2
  136. package/lib/input-number.js +4 -4
  137. package/lib/input.js +837 -862
  138. package/lib/link.js +2 -2
  139. package/lib/loading.js +2 -2
  140. package/lib/login.js +1737 -1059
  141. package/lib/lowcode-view.js +991 -1016
  142. package/lib/lowcode.js +1088 -1113
  143. package/lib/main.js +1066 -1091
  144. package/lib/marquee.js +837 -862
  145. package/lib/menu-item-group.js +2 -2
  146. package/lib/menu-item.js +2 -2
  147. package/lib/menu.js +1779 -2003
  148. package/lib/message-box.js +837 -862
  149. package/lib/message.js +837 -862
  150. package/lib/notification.js +859 -884
  151. package/lib/option-group.js +4 -4
  152. package/lib/option.js +839 -864
  153. package/lib/page-header.js +2 -2
  154. package/lib/pagination.js +837 -862
  155. package/lib/phone-login.js +986 -1011
  156. package/lib/popconfirm.js +4 -4
  157. package/lib/popover.js +1779 -2003
  158. package/lib/process-config.js +995 -1020
  159. package/lib/process-module.js +1056 -1081
  160. package/lib/process-rule.js +999 -1024
  161. package/lib/progress.js +2 -2
  162. package/lib/qr-code.js +4 -4
  163. package/lib/qrcode-login.js +987 -1012
  164. package/lib/radio-button.js +2 -2
  165. package/lib/radio-group.js +987 -1012
  166. package/lib/radio.js +2 -2
  167. package/lib/rate.js +837 -862
  168. package/lib/row.js +2 -2
  169. package/lib/scrollbar.js +837 -862
  170. package/lib/select.js +1938 -2162
  171. package/lib/selector-panel.js +1014 -1039
  172. package/lib/selector.js +991 -1016
  173. package/lib/slider.js +2 -2
  174. package/lib/step.js +4 -4
  175. package/lib/steps.js +839 -864
  176. package/lib/submenu.js +944 -1143
  177. package/lib/switch.js +837 -862
  178. package/lib/tab-pane.js +4 -4
  179. package/lib/table-column.js +837 -862
  180. package/lib/table.js +1927 -2151
  181. package/lib/tabs.js +839 -864
  182. package/lib/tag.js +2 -2
  183. package/lib/theme-chalk/base.css +1 -1
  184. package/lib/theme-chalk/index.css +1 -1
  185. package/lib/theme-chalk/main.css +1 -1
  186. package/lib/time-picker.js +1786 -2010
  187. package/lib/time-select.js +1782 -2006
  188. package/lib/timeline-item.js +2 -2
  189. package/lib/timeline.js +2 -2
  190. package/lib/tips.js +986 -1011
  191. package/lib/toolbar.js +2 -2
  192. package/lib/tooltip.js +1778 -2002
  193. package/lib/transfer.js +837 -862
  194. package/lib/tree-group.js +982 -1007
  195. package/lib/tree.js +985 -1010
  196. package/lib/update-history.js +146 -146
  197. package/lib/upload.js +999 -1024
  198. package/lib/utils/helpers.js +52 -0
  199. package/lib/utils/popper.js +48 -97
  200. package/lib/wujie.js +841 -866
  201. package/package.json +1 -1
  202. package/packages/login/src/login.vue +24 -3
  203. package/packages/login/src/resetPassword.vue +19 -13
  204. package/packages/main/src/minxs.js +0 -1
  205. package/packages/theme-chalk/src/base.scss +1 -2
  206. package/src/index.js +327 -327
  207. package/src/utils/helpers.js +49 -0
  208. package/src/utils/popper.js +70 -109
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 233);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 234);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -481,7 +481,7 @@ function scrollMove(wrap) {
481
481
 
482
482
  /***/ }),
483
483
 
484
- /***/ 233:
484
+ /***/ 234:
485
485
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
486
486
 
487
487
  "use strict";
@@ -1765,7 +1765,9 @@ function insertAfter(newEl, targetEl) {
1765
1765
  /***/ 51:
1766
1766
  /***/ (function(module, exports, __webpack_require__) {
1767
1767
 
1768
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
1768
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1769
+
1770
+ /**
1769
1771
  * @fileOverview Kickass library to create and place poppers near their reference elements.
1770
1772
  * @version {{version}}
1771
1773
  * @license
@@ -1788,68 +1790,60 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
1788
1790
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1789
1791
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1790
1792
  * SOFTWARE.
1791
- */
1792
-
1793
- //
1794
- // Cross module loader
1795
- // Supported: Node, AMD, Browser globals
1796
- //
1797
- (function (root, factory) {
1798
- if (true) {
1799
- // AMD. Register as an anonymous module.
1793
+ */
1794
+
1795
+ //
1796
+ // Cross module loader
1797
+ // Supported: Node, AMD, Browser globals
1798
+ //
1799
+ (function (root, factory) {
1800
+ if (true) {
1801
+ // AMD. Register as an anonymous module.
1800
1802
  !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
1801
1803
  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
1802
1804
  (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
1803
1805
  __WEBPACK_AMD_DEFINE_FACTORY__),
1804
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
1805
- } else {}
1806
- })(this, function () {
1807
- 'use strict';
1808
-
1809
- var root = window;
1810
- // default options
1811
- var DEFAULTS = {
1812
- // placement of the popper
1813
- placement: 'bottom',
1814
-
1815
- gpuAcceleration: true,
1816
-
1817
- // shift popper from its origin by the given amount of pixels (can be negative)
1818
- offset: 0,
1819
-
1820
- // the element which will act as boundary of the popper
1821
- boundariesElement: 'viewport',
1822
-
1823
- // amount of pixel used to define a minimum distance between the boundaries and the popper
1824
- boundariesPadding: 5,
1825
-
1826
- // popper will try to prevent overflow following this order,
1827
- // by default, then, it could overflow on the left and on top of the boundariesElement
1828
- preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
1829
-
1830
- // the behavior used by flip to change the placement of the popper
1831
- flipBehavior: 'flip',
1832
-
1833
- arrowElement: '[x-arrow]',
1834
-
1835
- arrowOffset: 0,
1836
-
1837
- // list of functions used to modify the offsets before they are applied to the popper
1838
- modifiers: [
1839
- 'shift',
1840
- 'offset',
1841
- 'preventOverflow',
1842
- 'keepTogether',
1843
- 'arrow',
1844
- 'flip',
1845
- 'applyStyle'
1846
- ],
1847
-
1848
- modifiersIgnored: [],
1849
-
1850
- forceAbsolute: false
1851
- };
1852
-
1806
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
1807
+ } else {}
1808
+ })(this, function () {
1809
+ 'use strict';
1810
+
1811
+ var root = window;
1812
+ // default options
1813
+ var DEFAULTS = {
1814
+ // placement of the popper
1815
+ placement: 'bottom',
1816
+
1817
+ gpuAcceleration: true,
1818
+
1819
+ // shift popper from its origin by the given amount of pixels (can be negative)
1820
+ offset: 0,
1821
+
1822
+ // the element which will act as boundary of the popper
1823
+ boundariesElement: 'viewport',
1824
+
1825
+ // amount of pixel used to define a minimum distance between the boundaries and the popper
1826
+ boundariesPadding: 5,
1827
+
1828
+ // popper will try to prevent overflow following this order,
1829
+ // by default, then, it could overflow on the left and on top of the boundariesElement
1830
+ preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
1831
+
1832
+ // the behavior used by flip to change the placement of the popper
1833
+ flipBehavior: 'flip',
1834
+
1835
+ arrowElement: '[x-arrow]',
1836
+
1837
+ arrowOffset: 0,
1838
+
1839
+ // list of functions used to modify the offsets before they are applied to the popper
1840
+ modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],
1841
+
1842
+ modifiersIgnored: [],
1843
+
1844
+ forceAbsolute: false
1845
+ };
1846
+
1853
1847
  /**
1854
1848
  * Create a new Popper.js instance
1855
1849
  * @constructor Popper
@@ -1914,125 +1908,114 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
1914
1908
  *
1915
1909
  * @param {Boolean} [options.removeOnDestroy=false]
1916
1910
  * Set to true if you want to automatically remove the popper when you call the `destroy` method.
1917
- */
1918
- function Popper(reference, popper, options) {
1919
- this._reference = reference.jquery ? reference[0] : reference;
1920
- this.state = {};
1921
-
1922
- // if the popper variable is a configuration object, parse it to generate an HTMLElement
1923
- // generate a default popper if is not defined
1924
- var isNotDefined = typeof popper === 'undefined' || popper === null;
1925
- var isConfig =
1926
- popper && Object.prototype.toString.call(popper) === '[object Object]';
1927
- if (isNotDefined || isConfig) {
1928
- this._popper = this.parse(isConfig ? popper : {});
1929
- }
1930
- // otherwise, use the given HTMLElement as popper
1931
- else {
1932
- this._popper = popper.jquery ? popper[0] : popper;
1933
- }
1934
-
1935
- // with {} we create a new object with the options inside it
1936
- this._options = Object.assign({}, DEFAULTS, options);
1937
-
1938
- // refactoring modifiers' list
1939
- this._options.modifiers = this._options.modifiers.map(
1940
- function (modifier) {
1941
- // remove ignored modifiers
1942
- if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
1943
-
1944
- // set the x-placement attribute before everything else because it could be used to add margins to the popper
1945
- // margins needs to be calculated to get the correct popper offsets
1946
- if (modifier === 'applyStyle') {
1947
- this._popper.setAttribute('x-placement', this._options.placement);
1948
- }
1949
-
1950
- // return predefined modifier identified by string or keep the custom one
1951
- return this.modifiers[modifier] || modifier;
1952
- }.bind(this)
1953
- );
1954
-
1955
- // make sure to apply the popper position before any computation
1956
- this.state.position = this._getPosition(this._popper, this._reference);
1957
- setStyle(this._popper, { position: this.state.position, top: 0 });
1958
-
1959
- // fire the first update to position the popper in the right place
1960
- this.update();
1961
-
1962
- // setup event listeners, they will take care of update the position in specific situations
1963
- this._setupEventListeners();
1964
- return this;
1965
- }
1966
-
1967
- //
1968
- // Methods
1969
- //
1911
+ */
1912
+ function Popper(reference, popper, options) {
1913
+ this._reference = reference.jquery ? reference[0] : reference;
1914
+ this.state = {};
1915
+
1916
+ // if the popper variable is a configuration object, parse it to generate an HTMLElement
1917
+ // generate a default popper if is not defined
1918
+ var isNotDefined = typeof popper === 'undefined' || popper === null;
1919
+ var isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';
1920
+ if (isNotDefined || isConfig) {
1921
+ this._popper = this.parse(isConfig ? popper : {});
1922
+ }
1923
+ // otherwise, use the given HTMLElement as popper
1924
+ else {
1925
+ this._popper = popper.jquery ? popper[0] : popper;
1926
+ }
1927
+
1928
+ // with {} we create a new object with the options inside it
1929
+ this._options = Object.assign({}, DEFAULTS, options);
1930
+
1931
+ // refactoring modifiers' list
1932
+ this._options.modifiers = this._options.modifiers.map(function (modifier) {
1933
+ // remove ignored modifiers
1934
+ if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
1935
+
1936
+ // set the x-placement attribute before everything else because it could be used to add margins to the popper
1937
+ // margins needs to be calculated to get the correct popper offsets
1938
+ if (modifier === 'applyStyle') {
1939
+ this._popper.setAttribute('x-placement', this._options.placement);
1940
+ }
1941
+
1942
+ // return predefined modifier identified by string or keep the custom one
1943
+ return this.modifiers[modifier] || modifier;
1944
+ }.bind(this));
1945
+
1946
+ // make sure to apply the popper position before any computation
1947
+ this.state.position = this._getPosition(this._popper, this._reference);
1948
+ setStyle(this._popper, { position: this.state.position, top: 0 });
1949
+
1950
+ // fire the first update to position the popper in the right place
1951
+ this.update();
1952
+
1953
+ // setup event listeners, they will take care of update the position in specific situations
1954
+ this._setupEventListeners();
1955
+ return this;
1956
+ }
1957
+
1958
+ //
1959
+ // Methods
1960
+ //
1970
1961
  /**
1971
1962
  * Destroy the popper
1972
1963
  * @method
1973
1964
  * @memberof Popper
1974
- */
1975
- Popper.prototype.destroy = function () {
1976
- this._popper.removeAttribute('x-placement');
1977
- this._popper.style.left = '';
1978
- this._popper.style.position = '';
1979
- this._popper.style.top = '';
1980
- this._popper.style[getSupportedPropertyName('transform')] = '';
1981
- this._removeEventListeners();
1982
-
1983
- // remove the popper if user explicity asked for the deletion on destroy
1984
- if (this._options.removeOnDestroy) {
1985
- this._popper.remove();
1986
- }
1987
- return this;
1988
- };
1989
-
1965
+ */
1966
+ Popper.prototype.destroy = function () {
1967
+ this._popper.removeAttribute('x-placement');
1968
+ this._popper.style.left = '';
1969
+ this._popper.style.position = '';
1970
+ this._popper.style.top = '';
1971
+ this._popper.style[getSupportedPropertyName('transform')] = '';
1972
+ this._removeEventListeners();
1973
+
1974
+ // remove the popper if user explicity asked for the deletion on destroy
1975
+ if (this._options.removeOnDestroy) {
1976
+ this._popper.remove();
1977
+ }
1978
+ return this;
1979
+ };
1980
+
1990
1981
  /**
1991
1982
  * Updates the position of the popper, computing the new offsets and applying the new style
1992
1983
  * @method
1993
1984
  * @memberof Popper
1994
- */
1995
- Popper.prototype.update = function () {
1996
- var data = { instance: this, styles: {} };
1997
-
1998
- // store placement inside the data object, modifiers will be able to edit `placement` if needed
1999
- // and refer to _originalPlacement to know the original value
2000
- data.placement = this._options.placement;
2001
- data._originalPlacement = this._options.placement;
2002
-
2003
- // compute the popper and reference offsets and put them inside data.offsets
2004
- data.offsets = this._getOffsets(
2005
- this._popper,
2006
- this._reference,
2007
- data.placement
2008
- );
2009
-
2010
- // get boundaries
2011
- data.boundaries = this._getBoundaries(
2012
- data,
2013
- this._options.boundariesPadding,
2014
- this._options.boundariesElement
2015
- );
2016
-
2017
- data = this.runModifiers(data, this._options.modifiers);
2018
-
2019
- if (typeof this.state.updateCallback === 'function') {
2020
- this.state.updateCallback(data);
2021
- }
2022
- };
2023
-
1985
+ */
1986
+ Popper.prototype.update = function () {
1987
+ var data = { instance: this, styles: {} };
1988
+
1989
+ // store placement inside the data object, modifiers will be able to edit `placement` if needed
1990
+ // and refer to _originalPlacement to know the original value
1991
+ data.placement = this._options.placement;
1992
+ data._originalPlacement = this._options.placement;
1993
+
1994
+ // compute the popper and reference offsets and put them inside data.offsets
1995
+ data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
1996
+
1997
+ // get boundaries
1998
+ data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);
1999
+
2000
+ data = this.runModifiers(data, this._options.modifiers);
2001
+
2002
+ if (typeof this.state.updateCallback === 'function') {
2003
+ this.state.updateCallback(data);
2004
+ }
2005
+ };
2006
+
2024
2007
  /**
2025
2008
  * If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.
2026
2009
  * @method
2027
2010
  * @memberof Popper
2028
2011
  * @param {Function} callback
2029
- */
2030
- Popper.prototype.onCreate = function (callback) {
2031
- // the createCallbacks return as first argument the popper instance
2032
- callback(this);
2033
- return this;
2034
- };
2035
-
2012
+ */
2013
+ Popper.prototype.onCreate = function (callback) {
2014
+ // the createCallbacks return as first argument the popper instance
2015
+ callback(this);
2016
+ return this;
2017
+ };
2018
+
2036
2019
  /**
2037
2020
  * If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations
2038
2021
  * used to style popper and its arrow.
@@ -2040,101 +2023,93 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
2040
2023
  * @method
2041
2024
  * @memberof Popper
2042
2025
  * @param {Function} callback
2043
- */
2044
- Popper.prototype.onUpdate = function (callback) {
2045
- this.state.updateCallback = callback;
2046
- return this;
2047
- };
2048
-
2026
+ */
2027
+ Popper.prototype.onUpdate = function (callback) {
2028
+ this.state.updateCallback = callback;
2029
+ return this;
2030
+ };
2031
+
2049
2032
  /**
2050
2033
  * Helper used to generate poppers from a configuration file
2051
2034
  * @method
2052
2035
  * @memberof Popper
2053
2036
  * @param config {Object} configuration
2054
2037
  * @returns {HTMLElement} popper
2055
- */
2056
- Popper.prototype.parse = function (config) {
2057
- var defaultConfig = {
2058
- tagName: 'div',
2059
- classNames: ['popper'],
2060
- attributes: [],
2061
- parent: root.document.body,
2062
- content: '',
2063
- contentType: 'text',
2064
- arrowTagName: 'div',
2065
- arrowClassNames: ['popper__arrow'],
2066
- arrowAttributes: ['x-arrow']
2067
- };
2068
- config = Object.assign({}, defaultConfig, config);
2069
-
2070
- var d = root.document;
2071
-
2072
- var popper = d.createElement(config.tagName);
2073
- addClassNames(popper, config.classNames);
2074
- addAttributes(popper, config.attributes);
2075
- if (config.contentType === 'node') {
2076
- popper.appendChild(
2077
- config.content.jquery ? config.content[0] : config.content
2078
- );
2079
- } else if (config.contentType === 'html') {
2080
- popper.innerHTML = config.content;
2081
- } else {
2082
- popper.textContent = config.content;
2083
- }
2084
-
2085
- if (config.arrowTagName) {
2086
- var arrow = d.createElement(config.arrowTagName);
2087
- addClassNames(arrow, config.arrowClassNames);
2088
- addAttributes(arrow, config.arrowAttributes);
2089
- popper.appendChild(arrow);
2090
- }
2091
-
2092
- var parent = config.parent.jquery ? config.parent[0] : config.parent;
2093
-
2094
- // if the given parent is a string, use it to match an element
2095
- // if more than one element is matched, the first one will be used as parent
2096
- // if no elements are matched, the script will throw an error
2097
- if (typeof parent === 'string') {
2098
- parent = d.querySelectorAll(config.parent);
2099
- if (parent.length > 1) {
2100
- console.warn(
2101
- 'WARNING: the given `parent` query(' +
2102
- config.parent +
2103
- ') matched more than one element, the first one will be used'
2104
- );
2105
- }
2106
- if (parent.length === 0) {
2107
- throw "ERROR: the given `parent` doesn't exists!";
2108
- }
2109
- parent = parent[0];
2110
- }
2111
- // if the given parent is a DOM nodes list or an array of nodes with more than one element,
2112
- // the first one will be used as parent
2113
- if (parent.length > 1 && parent instanceof Element === false) {
2114
- console.warn(
2115
- 'WARNING: you have passed as parent a list of elements, the first one will be used'
2116
- );
2117
- parent = parent[0];
2118
- }
2119
-
2120
- // append the generated popper to its parent
2121
- parent.appendChild(popper);
2122
-
2123
- return popper;
2124
-
2038
+ */
2039
+ Popper.prototype.parse = function (config) {
2040
+ var defaultConfig = {
2041
+ tagName: 'div',
2042
+ classNames: ['popper'],
2043
+ attributes: [],
2044
+ parent: root.document.body,
2045
+ content: '',
2046
+ contentType: 'text',
2047
+ arrowTagName: 'div',
2048
+ arrowClassNames: ['popper__arrow'],
2049
+ arrowAttributes: ['x-arrow']
2050
+ };
2051
+ config = Object.assign({}, defaultConfig, config);
2052
+
2053
+ var d = root.document;
2054
+
2055
+ var popper = d.createElement(config.tagName);
2056
+ addClassNames(popper, config.classNames);
2057
+ addAttributes(popper, config.attributes);
2058
+ if (config.contentType === 'node') {
2059
+ popper.appendChild(config.content.jquery ? config.content[0] : config.content);
2060
+ } else if (config.contentType === 'html') {
2061
+ popper.innerHTML = config.content;
2062
+ } else {
2063
+ popper.textContent = config.content;
2064
+ }
2065
+
2066
+ if (config.arrowTagName) {
2067
+ var arrow = d.createElement(config.arrowTagName);
2068
+ addClassNames(arrow, config.arrowClassNames);
2069
+ addAttributes(arrow, config.arrowAttributes);
2070
+ popper.appendChild(arrow);
2071
+ }
2072
+
2073
+ var parent = config.parent.jquery ? config.parent[0] : config.parent;
2074
+
2075
+ // if the given parent is a string, use it to match an element
2076
+ // if more than one element is matched, the first one will be used as parent
2077
+ // if no elements are matched, the script will throw an error
2078
+ if (typeof parent === 'string') {
2079
+ parent = d.querySelectorAll(config.parent);
2080
+ if (parent.length > 1) {
2081
+ console.warn('WARNING: the given `parent` query(' + config.parent + ') matched more than one element, the first one will be used');
2082
+ }
2083
+ if (parent.length === 0) {
2084
+ throw "ERROR: the given `parent` doesn't exists!";
2085
+ }
2086
+ parent = parent[0];
2087
+ }
2088
+ // if the given parent is a DOM nodes list or an array of nodes with more than one element,
2089
+ // the first one will be used as parent
2090
+ if (parent.length > 1 && parent instanceof Element === false) {
2091
+ console.warn('WARNING: you have passed as parent a list of elements, the first one will be used');
2092
+ parent = parent[0];
2093
+ }
2094
+
2095
+ // append the generated popper to its parent
2096
+ parent.appendChild(popper);
2097
+
2098
+ return popper;
2099
+
2125
2100
  /**
2126
2101
  * Adds class names to the given element
2127
2102
  * @function
2128
2103
  * @ignore
2129
2104
  * @param {HTMLElement} target
2130
2105
  * @param {Array} classes
2131
- */
2132
- function addClassNames(element, classNames) {
2133
- classNames.forEach(function (className) {
2134
- element.classList.add(className);
2135
- });
2136
- }
2137
-
2106
+ */
2107
+ function addClassNames(element, classNames) {
2108
+ classNames.forEach(function (className) {
2109
+ element.classList.add(className);
2110
+ });
2111
+ }
2112
+
2138
2113
  /**
2139
2114
  * Adds attributes to the given element
2140
2115
  * @function
@@ -2143,17 +2118,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
2143
2118
  * @param {Array} attributes
2144
2119
  * @example
2145
2120
  * addAttributes(element, [ 'data-info:foobar' ]);
2146
- */
2147
- function addAttributes(element, attributes) {
2148
- attributes.forEach(function (attribute) {
2149
- element.setAttribute(
2150
- attribute.split(':')[0],
2151
- attribute.split(':')[1] || ''
2152
- );
2153
- });
2154
- }
2155
- };
2156
-
2121
+ */
2122
+ function addAttributes(element, attributes) {
2123
+ attributes.forEach(function (attribute) {
2124
+ element.setAttribute(attribute.split(':')[0], attribute.split(':')[1] || '');
2125
+ });
2126
+ }
2127
+ };
2128
+
2157
2129
  /**
2158
2130
  * Helper used to get the position which will be applied to the popper
2159
2131
  * @method
@@ -2161,20 +2133,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
2161
2133
  * @param config {HTMLElement} popper element
2162
2134
  * @param reference {HTMLElement} reference element
2163
2135
  * @returns {String} position
2164
- */
2165
- Popper.prototype._getPosition = function (popper, reference) {
2166
- var container = getOffsetParent(reference);
2167
-
2168
- if (this._options.forceAbsolute) {
2169
- return 'absolute';
2170
- }
2171
-
2172
- // Decide if the popper will be fixed
2173
- // If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
2174
- var isParentFixed = isFixed(reference, container);
2175
- return isParentFixed ? 'fixed' : 'absolute';
2176
- };
2177
-
2136
+ */
2137
+ Popper.prototype._getPosition = function (popper, reference) {
2138
+ var container = getOffsetParent(reference);
2139
+
2140
+ if (this._options.forceAbsolute) {
2141
+ return 'absolute';
2142
+ }
2143
+
2144
+ // Decide if the popper will be fixed
2145
+ // If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
2146
+ var isParentFixed = isFixed(reference, container);
2147
+ return isParentFixed ? 'fixed' : 'absolute';
2148
+ };
2149
+
2178
2150
  /**
2179
2151
  * Get offsets to the popper
2180
2152
  * @method
@@ -2183,110 +2155,93 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
2183
2155
  * @param {Element} popper - the popper element
2184
2156
  * @param {Element} reference - the reference element (the popper will be relative to this)
2185
2157
  * @returns {Object} An object containing the offsets which will be applied to the popper
2186
- */
2187
- Popper.prototype._getOffsets = function (popper, reference, placement) {
2188
- placement = placement.split('-')[0];
2189
- var popperOffsets = {};
2190
-
2191
- popperOffsets.position = this.state.position;
2192
- var isParentFixed = popperOffsets.position === 'fixed';
2193
-
2194
- //
2195
- // Get reference element position
2196
- //
2197
- var referenceOffsets = getOffsetRectRelativeToCustomParent(
2198
- reference,
2199
- popper,
2200
- isParentFixed
2201
- );
2202
-
2203
- //
2204
- // Get popper sizes
2205
- //
2206
- var popperRect = getOuterSizes(popper);
2207
-
2208
- //
2209
- // Compute offsets of popper
2210
- //
2211
-
2212
- // depending by the popper placement we have to compute its offsets slightly differently
2213
- if (['right', 'left'].indexOf(placement) !== -1) {
2214
- popperOffsets.top =
2215
- referenceOffsets.top +
2216
- referenceOffsets.height / 2 -
2217
- popperRect.height / 2;
2218
- if (placement === 'left') {
2219
- popperOffsets.left = referenceOffsets.left - popperRect.width;
2220
- } else {
2221
- popperOffsets.left = referenceOffsets.right;
2222
- }
2223
- } else {
2224
- popperOffsets.left =
2225
- referenceOffsets.left +
2226
- referenceOffsets.width / 2 -
2227
- popperRect.width / 2;
2228
- if (placement === 'top') {
2229
- popperOffsets.top = referenceOffsets.top - popperRect.height;
2230
- } else {
2231
- popperOffsets.top = referenceOffsets.bottom;
2232
- }
2233
- }
2234
-
2235
- // Add width and height to our offsets object
2236
- popperOffsets.width = popperRect.width;
2237
- popperOffsets.height = popperRect.height;
2238
-
2239
- return {
2240
- popper: popperOffsets,
2241
- reference: referenceOffsets
2242
- };
2243
- };
2244
-
2158
+ */
2159
+ Popper.prototype._getOffsets = function (popper, reference, placement) {
2160
+ placement = placement.split('-')[0];
2161
+ var popperOffsets = {};
2162
+
2163
+ popperOffsets.position = this.state.position;
2164
+ var isParentFixed = popperOffsets.position === 'fixed';
2165
+
2166
+ //
2167
+ // Get reference element position
2168
+ //
2169
+ var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
2170
+
2171
+ //
2172
+ // Get popper sizes
2173
+ //
2174
+ var popperRect = getOuterSizes(popper);
2175
+
2176
+ //
2177
+ // Compute offsets of popper
2178
+ //
2179
+
2180
+ // depending by the popper placement we have to compute its offsets slightly differently
2181
+ if (['right', 'left'].indexOf(placement) !== -1) {
2182
+ popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;
2183
+ if (placement === 'left') {
2184
+ popperOffsets.left = referenceOffsets.left - popperRect.width;
2185
+ } else {
2186
+ popperOffsets.left = referenceOffsets.right;
2187
+ }
2188
+ } else {
2189
+ popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;
2190
+ if (placement === 'top') {
2191
+ popperOffsets.top = referenceOffsets.top - popperRect.height;
2192
+ } else {
2193
+ popperOffsets.top = referenceOffsets.bottom;
2194
+ }
2195
+ }
2196
+
2197
+ // Add width and height to our offsets object
2198
+ popperOffsets.width = popperRect.width;
2199
+ popperOffsets.height = popperRect.height;
2200
+
2201
+ return {
2202
+ popper: popperOffsets,
2203
+ reference: referenceOffsets
2204
+ };
2205
+ };
2206
+
2245
2207
  /**
2246
2208
  * Setup needed event listeners used to update the popper position
2247
2209
  * @method
2248
2210
  * @memberof Popper
2249
2211
  * @access private
2250
- */
2251
- Popper.prototype._setupEventListeners = function () {
2252
- // NOTE: 1 DOM access here
2253
- this.state.updateBound = this.update.bind(this);
2254
- // 无界等微前端场景下沙箱 window 不会触发 resize,需监听真实 window
2255
- this.state.realWindow = getRealWindow(this._popper);
2256
- this.state.realWindow.addEventListener('resize', this.state.updateBound);
2257
- // if the boundariesElement is window we don't need to listen for the scroll event
2258
- if (this._options.boundariesElement !== 'window') {
2259
- var target = getScrollParent(this._reference);
2260
- target.addEventListener('scroll', this.state.updateBound);
2261
- this.state.scrollTarget = target;
2262
- }
2263
- };
2264
-
2212
+ */
2213
+ Popper.prototype._setupEventListeners = function () {
2214
+ // NOTE: 1 DOM access here
2215
+ this.state.updateBound = this.update.bind(this);
2216
+ root.addEventListener('resize', this.state.updateBound);
2217
+ // if the boundariesElement is window we don't need to listen for the scroll event
2218
+ if (this._options.boundariesElement !== 'window') {
2219
+ var target = getScrollParent(this._reference);
2220
+ // here it could be both `body` or `documentElement` thanks to Firefox, we then check both
2221
+ if (target === root.document.body || target === root.document.documentElement) {
2222
+ target = root;
2223
+ }
2224
+ target.addEventListener('scroll', this.state.updateBound);
2225
+ this.state.scrollTarget = target;
2226
+ }
2227
+ };
2228
+
2265
2229
  /**
2266
2230
  * Remove event listeners used to update the popper position
2267
2231
  * @method
2268
2232
  * @memberof Popper
2269
2233
  * @access private
2270
- */
2271
- Popper.prototype._removeEventListeners = function () {
2272
- // NOTE: 1 DOM access here
2273
- (this.state.realWindow || root).removeEventListener(
2274
- 'resize',
2275
- this.state.updateBound
2276
- );
2277
- if (
2278
- this._options.boundariesElement !== 'window' &&
2279
- this.state.scrollTarget
2280
- ) {
2281
- this.state.scrollTarget.removeEventListener(
2282
- 'scroll',
2283
- this.state.updateBound
2284
- );
2285
- this.state.scrollTarget = null;
2286
- }
2287
- this.state.updateBound = null;
2288
- };
2289
-
2234
+ */
2235
+ Popper.prototype._removeEventListeners = function () {
2236
+ // NOTE: 1 DOM access here
2237
+ root.removeEventListener('resize', this.state.updateBound);
2238
+ if (this._options.boundariesElement !== 'window' && this.state.scrollTarget) {
2239
+ this.state.scrollTarget.removeEventListener('scroll', this.state.updateBound);
2240
+ this.state.scrollTarget = null;
2241
+ }
2242
+ this.state.updateBound = null;
2243
+ };
2244
+
2290
2245
  /**
2291
2246
  * Computed the boundaries limits and return them
2292
2247
  * @method
@@ -2296,75 +2251,66 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
2296
2251
  * @param {Number} padding - Boundaries padding
2297
2252
  * @param {Element} boundariesElement - Element used to define the boundaries
2298
2253
  * @returns {Object} Coordinates of the boundaries
2299
- */
2300
- Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
2301
- // NOTE: 1 DOM access here
2302
- var boundaries = {};
2303
- var width, height;
2304
- if (boundariesElement === 'window') {
2305
- var body = root.document.body,
2306
- html = root.document.documentElement;
2307
-
2308
- height = Math.max(
2309
- body.scrollHeight,
2310
- body.offsetHeight,
2311
- html.clientHeight,
2312
- html.scrollHeight,
2313
- html.offsetHeight
2314
- );
2315
- width = Math.max(
2316
- body.scrollWidth,
2317
- body.offsetWidth,
2318
- html.clientWidth,
2319
- html.scrollWidth,
2320
- html.offsetWidth
2321
- );
2322
-
2323
- boundaries = {
2324
- top: 0,
2325
- right: width,
2326
- bottom: height,
2327
- left: 0
2328
- };
2329
- } else if (boundariesElement === 'viewport') {
2330
- // 将真实 window 的视口换算到 popper 所在包含块的坐标系。
2331
- // 无界等场景下沙箱 window 的尺寸、shadowRoot 内元素的 scrollTop 均不可靠,
2332
- // 统一从元素自身的 view 与真实包含块获取
2333
- var realWindow = getRealWindow(this._popper);
2334
- var containingBlockRect = getContainingBlockRect(
2335
- this._popper,
2336
- data.offsets.popper.position === 'fixed'
2337
- );
2338
-
2339
- boundaries = {
2340
- top: 0 - containingBlockRect.top,
2341
- right:
2342
- realWindow.document.documentElement.clientWidth -
2343
- containingBlockRect.left,
2344
- bottom:
2345
- realWindow.document.documentElement.clientHeight -
2346
- containingBlockRect.top,
2347
- left: 0 - containingBlockRect.left
2348
- };
2349
- } else {
2350
- if (getOffsetParent(this._popper) === boundariesElement) {
2351
- boundaries = {
2352
- top: 0,
2353
- left: 0,
2354
- right: boundariesElement.clientWidth,
2355
- bottom: boundariesElement.clientHeight
2356
- };
2357
- } else {
2358
- boundaries = getOffsetRect(boundariesElement);
2359
- }
2360
- }
2361
- boundaries.left += padding;
2362
- boundaries.right -= padding;
2363
- boundaries.top = boundaries.top + padding;
2364
- boundaries.bottom = boundaries.bottom - padding;
2365
- return boundaries;
2366
- };
2367
-
2254
+ */
2255
+ Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
2256
+ // NOTE: 1 DOM access here
2257
+ var boundaries = {};
2258
+ var width, height;
2259
+ if (boundariesElement === 'window') {
2260
+ var body = root.document.body,
2261
+ html = root.document.documentElement;
2262
+
2263
+ height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
2264
+ width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
2265
+
2266
+ boundaries = {
2267
+ top: 0,
2268
+ right: width,
2269
+ bottom: height,
2270
+ left: 0
2271
+ };
2272
+ } else if (boundariesElement === 'viewport') {
2273
+ var offsetParent = getOffsetParent(this._popper);
2274
+ var scrollParent = getScrollParent(this._popper);
2275
+ var offsetParentRect = getOffsetRect(offsetParent);
2276
+
2277
+ // Thanks the fucking native API, `document.body.scrollTop` & `document.documentElement.scrollTop`
2278
+ var getScrollTopValue = function getScrollTopValue(element) {
2279
+ return element == document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : element.scrollTop;
2280
+ };
2281
+ var getScrollLeftValue = function getScrollLeftValue(element) {
2282
+ return element == document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : element.scrollLeft;
2283
+ };
2284
+
2285
+ // if the popper is fixed we don't have to substract scrolling from the boundaries
2286
+ var scrollTop = data.offsets.popper.position === 'fixed' ? 0 : getScrollTopValue(scrollParent);
2287
+ var scrollLeft = data.offsets.popper.position === 'fixed' ? 0 : getScrollLeftValue(scrollParent);
2288
+
2289
+ boundaries = {
2290
+ top: 0 - (offsetParentRect.top - scrollTop),
2291
+ right: root.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),
2292
+ bottom: root.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),
2293
+ left: 0 - (offsetParentRect.left - scrollLeft)
2294
+ };
2295
+ } else {
2296
+ if (getOffsetParent(this._popper) === boundariesElement) {
2297
+ boundaries = {
2298
+ top: 0,
2299
+ left: 0,
2300
+ right: boundariesElement.clientWidth,
2301
+ bottom: boundariesElement.clientHeight
2302
+ };
2303
+ } else {
2304
+ boundaries = getOffsetRect(boundariesElement);
2305
+ }
2306
+ }
2307
+ boundaries.left += padding;
2308
+ boundaries.right -= padding;
2309
+ boundaries.top = boundaries.top + padding;
2310
+ boundaries.bottom = boundaries.bottom - padding;
2311
+ return boundaries;
2312
+ };
2313
+
2368
2314
  /**
2369
2315
  * Loop trough the list of modifiers and run them in order, each of them will then edit the data object
2370
2316
  * @method
@@ -2373,27 +2319,22 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
2373
2319
  * @param {Object} data
2374
2320
  * @param {Array} modifiers
2375
2321
  * @param {Function} ends
2376
- */
2377
- Popper.prototype.runModifiers = function (data, modifiers, ends) {
2378
- var modifiersToRun = modifiers.slice();
2379
- if (ends !== undefined) {
2380
- modifiersToRun = this._options.modifiers.slice(
2381
- 0,
2382
- getArrayKeyIndex(this._options.modifiers, ends)
2383
- );
2384
- }
2385
-
2386
- modifiersToRun.forEach(
2387
- function (modifier) {
2388
- if (isFunction(modifier)) {
2389
- data = modifier.call(this, data);
2390
- }
2391
- }.bind(this)
2392
- );
2393
-
2394
- return data;
2395
- };
2396
-
2322
+ */
2323
+ Popper.prototype.runModifiers = function (data, modifiers, ends) {
2324
+ var modifiersToRun = modifiers.slice();
2325
+ if (ends !== undefined) {
2326
+ modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));
2327
+ }
2328
+
2329
+ modifiersToRun.forEach(function (modifier) {
2330
+ if (isFunction(modifier)) {
2331
+ data = modifier.call(this, data);
2332
+ }
2333
+ }.bind(this));
2334
+
2335
+ return data;
2336
+ };
2337
+
2397
2338
  /**
2398
2339
  * Helper used to know if the given modifier depends from another one.
2399
2340
  * @method
@@ -2401,204 +2342,191 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
2401
2342
  * @param {String} requesting - name of requesting modifier
2402
2343
  * @param {String} requested - name of requested modifier
2403
2344
  * @returns {Boolean}
2404
- */
2405
- Popper.prototype.isModifierRequired = function (requesting, requested) {
2406
- var index = getArrayKeyIndex(this._options.modifiers, requesting);
2407
- return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
2408
- return modifier === requested;
2409
- }).length;
2410
- };
2411
-
2412
- //
2413
- // Modifiers
2414
- //
2415
-
2345
+ */
2346
+ Popper.prototype.isModifierRequired = function (requesting, requested) {
2347
+ var index = getArrayKeyIndex(this._options.modifiers, requesting);
2348
+ return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
2349
+ return modifier === requested;
2350
+ }).length;
2351
+ };
2352
+
2353
+ //
2354
+ // Modifiers
2355
+ //
2356
+
2416
2357
  /**
2417
2358
  * Modifiers list
2418
2359
  * @namespace Popper.modifiers
2419
2360
  * @memberof Popper
2420
2361
  * @type {Object}
2421
- */
2422
- Popper.prototype.modifiers = {};
2423
-
2362
+ */
2363
+ Popper.prototype.modifiers = {};
2364
+
2424
2365
  /**
2425
2366
  * Apply the computed styles to the popper element
2426
2367
  * @method
2427
2368
  * @memberof Popper.modifiers
2428
2369
  * @argument {Object} data - The data object generated by `update` method
2429
2370
  * @returns {Object} The same data object
2430
- */
2431
- Popper.prototype.modifiers.applyStyle = function (data) {
2432
- // apply the final offsets to the popper
2433
- // NOTE: 1 DOM access here
2434
- var styles = {
2435
- position: data.offsets.popper.position
2436
- };
2437
-
2438
- // round top and left to avoid blurry text
2439
- var left = Math.round(data.offsets.popper.left);
2440
- var top = Math.round(data.offsets.popper.top);
2441
-
2442
- // if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
2443
- // we automatically use the supported prefixed version if needed
2444
- var prefixedProperty;
2445
- if (
2446
- this._options.gpuAcceleration &&
2447
- (prefixedProperty = getSupportedPropertyName('transform'))
2448
- ) {
2449
- styles[prefixedProperty] =
2450
- 'translate3d(' + left + 'px, ' + top + 'px, 0)';
2451
- styles.top = 0;
2452
- styles.left = 0;
2453
- }
2454
- // othwerise, we use the standard `left` and `top` properties
2455
- else {
2456
- styles.left = left;
2457
- styles.top = top;
2458
- }
2459
-
2460
- // any property present in `data.styles` will be applied to the popper,
2461
- // in this way we can make the 3rd party modifiers add custom styles to it
2462
- // Be aware, modifiers could override the properties defined in the previous
2463
- // lines of this modifier!
2464
- Object.assign(styles, data.styles);
2465
-
2466
- setStyle(this._popper, styles);
2467
-
2468
- // set an attribute which will be useful to style the tooltip (use it to properly position its arrow)
2469
- // NOTE: 1 DOM access here
2470
- this._popper.setAttribute('x-placement', data.placement);
2471
-
2472
- // if the arrow modifier is required and the arrow style has been computed, apply the arrow style
2473
- if (
2474
- this.isModifierRequired(
2475
- this.modifiers.applyStyle,
2476
- this.modifiers.arrow
2477
- ) &&
2478
- data.offsets.arrow
2479
- ) {
2480
- setStyle(data.arrowElement, data.offsets.arrow);
2481
- }
2482
-
2483
- return data;
2484
- };
2485
-
2371
+ */
2372
+ Popper.prototype.modifiers.applyStyle = function (data) {
2373
+ // apply the final offsets to the popper
2374
+ // NOTE: 1 DOM access here
2375
+ var styles = {
2376
+ position: data.offsets.popper.position
2377
+ };
2378
+
2379
+ // round top and left to avoid blurry text
2380
+ var left = Math.round(data.offsets.popper.left);
2381
+ var top = Math.round(data.offsets.popper.top);
2382
+
2383
+ // if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
2384
+ // we automatically use the supported prefixed version if needed
2385
+ var prefixedProperty;
2386
+ if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName('transform'))) {
2387
+ styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
2388
+ styles.top = 0;
2389
+ styles.left = 0;
2390
+ }
2391
+ // othwerise, we use the standard `left` and `top` properties
2392
+ else {
2393
+ styles.left = left;
2394
+ styles.top = top;
2395
+ }
2396
+
2397
+ // any property present in `data.styles` will be applied to the popper,
2398
+ // in this way we can make the 3rd party modifiers add custom styles to it
2399
+ // Be aware, modifiers could override the properties defined in the previous
2400
+ // lines of this modifier!
2401
+ Object.assign(styles, data.styles);
2402
+
2403
+ setStyle(this._popper, styles);
2404
+
2405
+ // set an attribute which will be useful to style the tooltip (use it to properly position its arrow)
2406
+ // NOTE: 1 DOM access here
2407
+ this._popper.setAttribute('x-placement', data.placement);
2408
+
2409
+ // if the arrow modifier is required and the arrow style has been computed, apply the arrow style
2410
+ if (this.isModifierRequired(this.modifiers.applyStyle, this.modifiers.arrow) && data.offsets.arrow) {
2411
+ setStyle(data.arrowElement, data.offsets.arrow);
2412
+ }
2413
+
2414
+ return data;
2415
+ };
2416
+
2486
2417
  /**
2487
2418
  * Modifier used to shift the popper on the start or end of its reference element side
2488
2419
  * @method
2489
2420
  * @memberof Popper.modifiers
2490
2421
  * @argument {Object} data - The data object generated by `update` method
2491
2422
  * @returns {Object} The data object, properly modified
2492
- */
2493
- Popper.prototype.modifiers.shift = function (data) {
2494
- var placement = data.placement;
2495
- var basePlacement = placement.split('-')[0];
2496
- var shiftVariation = placement.split('-')[1];
2497
-
2498
- // if shift shiftVariation is specified, run the modifier
2499
- if (shiftVariation) {
2500
- var reference = data.offsets.reference;
2501
- var popper = getPopperClientRect(data.offsets.popper);
2502
-
2503
- var shiftOffsets = {
2504
- y: {
2505
- start: { top: reference.top },
2506
- end: { top: reference.top + reference.height - popper.height }
2507
- },
2508
- x: {
2509
- start: { left: reference.left },
2510
- end: { left: reference.left + reference.width - popper.width }
2511
- }
2512
- };
2513
-
2514
- var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
2515
-
2516
- data.offsets.popper = Object.assign(
2517
- popper,
2518
- shiftOffsets[axis][shiftVariation]
2519
- );
2520
- }
2521
-
2522
- return data;
2523
- };
2524
-
2423
+ */
2424
+ Popper.prototype.modifiers.shift = function (data) {
2425
+ var placement = data.placement;
2426
+ var basePlacement = placement.split('-')[0];
2427
+ var shiftVariation = placement.split('-')[1];
2428
+
2429
+ // if shift shiftVariation is specified, run the modifier
2430
+ if (shiftVariation) {
2431
+ var reference = data.offsets.reference;
2432
+ var popper = getPopperClientRect(data.offsets.popper);
2433
+
2434
+ var shiftOffsets = {
2435
+ y: {
2436
+ start: { top: reference.top },
2437
+ end: { top: reference.top + reference.height - popper.height }
2438
+ },
2439
+ x: {
2440
+ start: { left: reference.left },
2441
+ end: { left: reference.left + reference.width - popper.width }
2442
+ }
2443
+ };
2444
+
2445
+ var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
2446
+
2447
+ data.offsets.popper = Object.assign(popper, shiftOffsets[axis][shiftVariation]);
2448
+ }
2449
+
2450
+ return data;
2451
+ };
2452
+
2525
2453
  /**
2526
2454
  * Modifier used to make sure the popper does not overflows from it's boundaries
2527
2455
  * @method
2528
2456
  * @memberof Popper.modifiers
2529
2457
  * @argument {Object} data - The data object generated by `update` method
2530
2458
  * @returns {Object} The data object, properly modified
2531
- */
2532
- Popper.prototype.modifiers.preventOverflow = function (data) {
2533
- var order = this._options.preventOverflowOrder;
2534
- var popper = getPopperClientRect(data.offsets.popper);
2535
-
2536
- var check = {
2537
- left: function () {
2538
- var left = popper.left;
2539
- if (popper.left < data.boundaries.left) {
2540
- left = Math.max(popper.left, data.boundaries.left);
2541
- }
2542
- return { left: left };
2543
- },
2544
- right: function () {
2545
- var left = popper.left;
2546
- if (popper.right > data.boundaries.right) {
2547
- left = Math.min(popper.left, data.boundaries.right - popper.width);
2548
- }
2549
- return { left: left };
2550
- },
2551
- top: function () {
2552
- var top = popper.top;
2553
- if (popper.top < data.boundaries.top) {
2554
- top = Math.max(popper.top, data.boundaries.top);
2555
- }
2556
- return { top: top };
2557
- },
2558
- bottom: function () {
2559
- var top = popper.top;
2560
- if (popper.bottom > data.boundaries.bottom) {
2561
- top = Math.min(popper.top, data.boundaries.bottom - popper.height);
2562
- }
2563
- return { top: top };
2564
- }
2565
- };
2566
-
2567
- order.forEach(function (direction) {
2568
- data.offsets.popper = Object.assign(popper, check[direction]());
2569
- });
2570
-
2571
- return data;
2572
- };
2573
-
2459
+ */
2460
+ Popper.prototype.modifiers.preventOverflow = function (data) {
2461
+ var order = this._options.preventOverflowOrder;
2462
+ var popper = getPopperClientRect(data.offsets.popper);
2463
+
2464
+ var check = {
2465
+ left: function left() {
2466
+ var left = popper.left;
2467
+ if (popper.left < data.boundaries.left) {
2468
+ left = Math.max(popper.left, data.boundaries.left);
2469
+ }
2470
+ return { left: left };
2471
+ },
2472
+ right: function right() {
2473
+ var left = popper.left;
2474
+ if (popper.right > data.boundaries.right) {
2475
+ left = Math.min(popper.left, data.boundaries.right - popper.width);
2476
+ }
2477
+ return { left: left };
2478
+ },
2479
+ top: function top() {
2480
+ var top = popper.top;
2481
+ if (popper.top < data.boundaries.top) {
2482
+ top = Math.max(popper.top, data.boundaries.top);
2483
+ }
2484
+ return { top: top };
2485
+ },
2486
+ bottom: function bottom() {
2487
+ var top = popper.top;
2488
+ if (popper.bottom > data.boundaries.bottom) {
2489
+ top = Math.min(popper.top, data.boundaries.bottom - popper.height);
2490
+ }
2491
+ return { top: top };
2492
+ }
2493
+ };
2494
+
2495
+ order.forEach(function (direction) {
2496
+ data.offsets.popper = Object.assign(popper, check[direction]());
2497
+ });
2498
+
2499
+ return data;
2500
+ };
2501
+
2574
2502
  /**
2575
2503
  * Modifier used to make sure the popper is always near its reference
2576
2504
  * @method
2577
2505
  * @memberof Popper.modifiers
2578
2506
  * @argument {Object} data - The data object generated by _update method
2579
2507
  * @returns {Object} The data object, properly modified
2580
- */
2581
- Popper.prototype.modifiers.keepTogether = function (data) {
2582
- var popper = getPopperClientRect(data.offsets.popper);
2583
- var reference = data.offsets.reference;
2584
- var f = Math.floor;
2585
-
2586
- if (popper.right < f(reference.left)) {
2587
- data.offsets.popper.left = f(reference.left) - popper.width;
2588
- }
2589
- if (popper.left > f(reference.right)) {
2590
- data.offsets.popper.left = f(reference.right);
2591
- }
2592
- if (popper.bottom < f(reference.top)) {
2593
- data.offsets.popper.top = f(reference.top) - popper.height;
2594
- }
2595
- if (popper.top > f(reference.bottom)) {
2596
- data.offsets.popper.top = f(reference.bottom);
2597
- }
2598
-
2599
- return data;
2600
- };
2601
-
2508
+ */
2509
+ Popper.prototype.modifiers.keepTogether = function (data) {
2510
+ var popper = getPopperClientRect(data.offsets.popper);
2511
+ var reference = data.offsets.reference;
2512
+ var f = Math.floor;
2513
+
2514
+ if (popper.right < f(reference.left)) {
2515
+ data.offsets.popper.left = f(reference.left) - popper.width;
2516
+ }
2517
+ if (popper.left > f(reference.right)) {
2518
+ data.offsets.popper.left = f(reference.right);
2519
+ }
2520
+ if (popper.bottom < f(reference.top)) {
2521
+ data.offsets.popper.top = f(reference.top) - popper.height;
2522
+ }
2523
+ if (popper.top > f(reference.bottom)) {
2524
+ data.offsets.popper.top = f(reference.bottom);
2525
+ }
2526
+
2527
+ return data;
2528
+ };
2529
+
2602
2530
  /**
2603
2531
  * Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.
2604
2532
  * Requires the `preventOverflow` modifier before it in order to work.
@@ -2607,81 +2535,61 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
2607
2535
  * @memberof Popper.modifiers
2608
2536
  * @argument {Object} data - The data object generated by _update method
2609
2537
  * @returns {Object} The data object, properly modified
2610
- */
2611
- Popper.prototype.modifiers.flip = function (data) {
2612
- // check if preventOverflow is in the list of modifiers before the flip modifier.
2613
- // otherwise flip would not work as expected.
2614
- if (
2615
- !this.isModifierRequired(
2616
- this.modifiers.flip,
2617
- this.modifiers.preventOverflow
2618
- )
2619
- ) {
2620
- console.warn(
2621
- 'WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!'
2622
- );
2623
- return data;
2624
- }
2625
-
2626
- if (data.flipped && data.placement === data._originalPlacement) {
2627
- // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
2628
- return data;
2629
- }
2630
-
2631
- var placement = data.placement.split('-')[0];
2632
- var placementOpposite = getOppositePlacement(placement);
2633
- var variation = data.placement.split('-')[1] || '';
2634
-
2635
- var flipOrder = [];
2636
- if (this._options.flipBehavior === 'flip') {
2637
- flipOrder = [placement, placementOpposite];
2638
- } else {
2639
- flipOrder = this._options.flipBehavior;
2640
- }
2641
-
2642
- flipOrder.forEach(
2643
- function (step, index) {
2644
- if (placement !== step || flipOrder.length === index + 1) {
2645
- return;
2646
- }
2647
-
2648
- placement = data.placement.split('-')[0];
2649
- placementOpposite = getOppositePlacement(placement);
2650
-
2651
- var popperOffsets = getPopperClientRect(data.offsets.popper);
2652
-
2653
- // this boolean is used to distinguish right and bottom from top and left
2654
- // they need different computations to get flipped
2655
- var a = ['right', 'bottom'].indexOf(placement) !== -1;
2656
-
2657
- // using Math.floor because the reference offsets may contain decimals we are not going to consider here
2658
- if (
2659
- (a &&
2660
- Math.floor(data.offsets.reference[placement]) >
2661
- Math.floor(popperOffsets[placementOpposite])) ||
2662
- (!a &&
2663
- Math.floor(data.offsets.reference[placement]) <
2664
- Math.floor(popperOffsets[placementOpposite]))
2665
- ) {
2666
- // we'll use this boolean to detect any flip loop
2667
- data.flipped = true;
2668
- data.placement = flipOrder[index + 1];
2669
- if (variation) {
2670
- data.placement += '-' + variation;
2671
- }
2672
- data.offsets.popper = this._getOffsets(
2673
- this._popper,
2674
- this._reference,
2675
- data.placement
2676
- ).popper;
2677
-
2678
- data = this.runModifiers(data, this._options.modifiers, this._flip);
2679
- }
2680
- }.bind(this)
2681
- );
2682
- return data;
2683
- };
2684
-
2538
+ */
2539
+ Popper.prototype.modifiers.flip = function (data) {
2540
+ // check if preventOverflow is in the list of modifiers before the flip modifier.
2541
+ // otherwise flip would not work as expected.
2542
+ if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {
2543
+ console.warn('WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!');
2544
+ return data;
2545
+ }
2546
+
2547
+ if (data.flipped && data.placement === data._originalPlacement) {
2548
+ // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
2549
+ return data;
2550
+ }
2551
+
2552
+ var placement = data.placement.split('-')[0];
2553
+ var placementOpposite = getOppositePlacement(placement);
2554
+ var variation = data.placement.split('-')[1] || '';
2555
+
2556
+ var flipOrder = [];
2557
+ if (this._options.flipBehavior === 'flip') {
2558
+ flipOrder = [placement, placementOpposite];
2559
+ } else {
2560
+ flipOrder = this._options.flipBehavior;
2561
+ }
2562
+
2563
+ flipOrder.forEach(function (step, index) {
2564
+ if (placement !== step || flipOrder.length === index + 1) {
2565
+ return;
2566
+ }
2567
+
2568
+ placement = data.placement.split('-')[0];
2569
+ placementOpposite = getOppositePlacement(placement);
2570
+
2571
+ var popperOffsets = getPopperClientRect(data.offsets.popper);
2572
+
2573
+ // this boolean is used to distinguish right and bottom from top and left
2574
+ // they need different computations to get flipped
2575
+ var a = ['right', 'bottom'].indexOf(placement) !== -1;
2576
+
2577
+ // using Math.floor because the reference offsets may contain decimals we are not going to consider here
2578
+ if (a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite]) || !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])) {
2579
+ // we'll use this boolean to detect any flip loop
2580
+ data.flipped = true;
2581
+ data.placement = flipOrder[index + 1];
2582
+ if (variation) {
2583
+ data.placement += '-' + variation;
2584
+ }
2585
+ data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;
2586
+
2587
+ data = this.runModifiers(data, this._options.modifiers, this._flip);
2588
+ }
2589
+ }.bind(this));
2590
+ return data;
2591
+ };
2592
+
2685
2593
  /**
2686
2594
  * Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.
2687
2595
  * The offsets will shift the popper on the side of its reference element.
@@ -2689,23 +2597,23 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
2689
2597
  * @memberof Popper.modifiers
2690
2598
  * @argument {Object} data - The data object generated by _update method
2691
2599
  * @returns {Object} The data object, properly modified
2692
- */
2693
- Popper.prototype.modifiers.offset = function (data) {
2694
- var offset = this._options.offset;
2695
- var popper = data.offsets.popper;
2696
-
2697
- if (data.placement.indexOf('left') !== -1) {
2698
- popper.top -= offset;
2699
- } else if (data.placement.indexOf('right') !== -1) {
2700
- popper.top += offset;
2701
- } else if (data.placement.indexOf('top') !== -1) {
2702
- popper.left -= offset;
2703
- } else if (data.placement.indexOf('bottom') !== -1) {
2704
- popper.left += offset;
2705
- }
2706
- return data;
2707
- };
2708
-
2600
+ */
2601
+ Popper.prototype.modifiers.offset = function (data) {
2602
+ var offset = this._options.offset;
2603
+ var popper = data.offsets.popper;
2604
+
2605
+ if (data.placement.indexOf('left') !== -1) {
2606
+ popper.top -= offset;
2607
+ } else if (data.placement.indexOf('right') !== -1) {
2608
+ popper.top += offset;
2609
+ } else if (data.placement.indexOf('top') !== -1) {
2610
+ popper.left -= offset;
2611
+ } else if (data.placement.indexOf('bottom') !== -1) {
2612
+ popper.left += offset;
2613
+ }
2614
+ return data;
2615
+ };
2616
+
2709
2617
  /**
2710
2618
  * Modifier used to move the arrows on the edge of the popper to make sure them are always between the popper and the reference element
2711
2619
  * It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed
@@ -2713,147 +2621,136 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
2713
2621
  * @memberof Popper.modifiers
2714
2622
  * @argument {Object} data - The data object generated by _update method
2715
2623
  * @returns {Object} The data object, properly modified
2716
- */
2717
- Popper.prototype.modifiers.arrow = function (data) {
2718
- var arrow = this._options.arrowElement;
2719
- var arrowOffset = this._options.arrowOffset;
2720
-
2721
- // if the arrowElement is a string, suppose it's a CSS selector
2722
- if (typeof arrow === 'string') {
2723
- arrow = this._popper.querySelector(arrow);
2724
- }
2725
-
2726
- // if arrow element is not found, don't run the modifier
2727
- if (!arrow) {
2728
- return data;
2729
- }
2730
-
2731
- // the arrow element must be child of its popper
2732
- if (!this._popper.contains(arrow)) {
2733
- console.warn(
2734
- 'WARNING: `arrowElement` must be child of its popper element!'
2735
- );
2736
- return data;
2737
- }
2738
-
2739
- // arrow depends on keepTogether in order to work
2740
- if (
2741
- !this.isModifierRequired(
2742
- this.modifiers.arrow,
2743
- this.modifiers.keepTogether
2744
- )
2745
- ) {
2746
- console.warn(
2747
- 'WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!'
2748
- );
2749
- return data;
2750
- }
2751
-
2752
- var arrowStyle = {};
2753
- var placement = data.placement.split('-')[0];
2754
- var popper = getPopperClientRect(data.offsets.popper);
2755
- var reference = data.offsets.reference;
2756
- var isVertical = ['left', 'right'].indexOf(placement) !== -1;
2757
-
2758
- var len = isVertical ? 'height' : 'width';
2759
- var side = isVertical ? 'top' : 'left';
2760
- var translate = isVertical ? 'translateY' : 'translateX';
2761
- var altSide = isVertical ? 'left' : 'top';
2762
- var opSide = isVertical ? 'bottom' : 'right';
2763
- var arrowSize = getOuterSizes(arrow)[len];
2764
-
2765
- //
2766
- // extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction
2767
- //
2768
-
2769
- // top/left side
2770
- if (reference[opSide] - arrowSize < popper[side]) {
2771
- data.offsets.popper[side] -=
2772
- popper[side] - (reference[opSide] - arrowSize);
2773
- }
2774
- // bottom/right side
2775
- if (reference[side] + arrowSize > popper[opSide]) {
2776
- data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
2777
- }
2778
-
2779
- // compute center of the popper
2780
- var center =
2781
- reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
2782
-
2783
- var sideValue = center - popper[side];
2784
-
2785
- // prevent arrow from being placed not contiguously to its popper
2786
- sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
2787
- arrowStyle[side] = sideValue;
2788
- arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow
2789
-
2790
- data.offsets.arrow = arrowStyle;
2791
- data.arrowElement = arrow;
2792
-
2793
- return data;
2794
- };
2795
-
2796
- //
2797
- // Helpers
2798
- //
2799
-
2624
+ */
2625
+ Popper.prototype.modifiers.arrow = function (data) {
2626
+ var arrow = this._options.arrowElement;
2627
+ var arrowOffset = this._options.arrowOffset;
2628
+
2629
+ // if the arrowElement is a string, suppose it's a CSS selector
2630
+ if (typeof arrow === 'string') {
2631
+ arrow = this._popper.querySelector(arrow);
2632
+ }
2633
+
2634
+ // if arrow element is not found, don't run the modifier
2635
+ if (!arrow) {
2636
+ return data;
2637
+ }
2638
+
2639
+ // the arrow element must be child of its popper
2640
+ if (!this._popper.contains(arrow)) {
2641
+ console.warn('WARNING: `arrowElement` must be child of its popper element!');
2642
+ return data;
2643
+ }
2644
+
2645
+ // arrow depends on keepTogether in order to work
2646
+ if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {
2647
+ console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!');
2648
+ return data;
2649
+ }
2650
+
2651
+ var arrowStyle = {};
2652
+ var placement = data.placement.split('-')[0];
2653
+ var popper = getPopperClientRect(data.offsets.popper);
2654
+ var reference = data.offsets.reference;
2655
+ var isVertical = ['left', 'right'].indexOf(placement) !== -1;
2656
+
2657
+ var len = isVertical ? 'height' : 'width';
2658
+ var side = isVertical ? 'top' : 'left';
2659
+ var translate = isVertical ? 'translateY' : 'translateX';
2660
+ var altSide = isVertical ? 'left' : 'top';
2661
+ var opSide = isVertical ? 'bottom' : 'right';
2662
+ var arrowSize = getOuterSizes(arrow)[len];
2663
+
2664
+ //
2665
+ // extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction
2666
+ //
2667
+
2668
+ // top/left side
2669
+ if (reference[opSide] - arrowSize < popper[side]) {
2670
+ data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
2671
+ }
2672
+ // bottom/right side
2673
+ if (reference[side] + arrowSize > popper[opSide]) {
2674
+ data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
2675
+ }
2676
+
2677
+ // compute center of the popper
2678
+ var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
2679
+
2680
+ var sideValue = center - popper[side];
2681
+
2682
+ // prevent arrow from being placed not contiguously to its popper
2683
+ sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
2684
+ arrowStyle[side] = sideValue;
2685
+ arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow
2686
+
2687
+ data.offsets.arrow = arrowStyle;
2688
+ data.arrowElement = arrow;
2689
+
2690
+ return data;
2691
+ };
2692
+
2693
+ //
2694
+ // Helpers
2695
+ //
2696
+
2800
2697
  /**
2801
2698
  * Get the outer sizes of the given element (offset size + margins)
2802
2699
  * @function
2803
2700
  * @ignore
2804
2701
  * @argument {Element} element
2805
2702
  * @returns {Object} object containing width and height properties
2806
- */
2807
- function getOuterSizes(element) {
2808
- // NOTE: 1 DOM access here
2809
- var _display = element.style.display,
2810
- _visibility = element.style.visibility;
2811
- element.style.display = 'block';
2812
- element.style.visibility = 'hidden';
2813
- var calcWidthToForceRepaint = element.offsetWidth;
2814
- // original method
2815
- var styles = getRealWindow(element).getComputedStyle(element);
2816
- var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
2817
- var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
2818
- var result = {
2819
- width: element.offsetWidth + y,
2820
- height: element.offsetHeight + x
2821
- };
2822
-
2823
- // reset element styles
2824
- element.style.display = _display;
2825
- element.style.visibility = _visibility;
2826
- return result;
2827
- }
2828
-
2703
+ */
2704
+ function getOuterSizes(element) {
2705
+ // NOTE: 1 DOM access here
2706
+ var _display = element.style.display,
2707
+ _visibility = element.style.visibility;
2708
+ element.style.display = 'block';
2709
+ element.style.visibility = 'hidden';
2710
+ var calcWidthToForceRepaint = element.offsetWidth;
2711
+ // original method
2712
+ var styles = root.getComputedStyle(element);
2713
+ var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
2714
+ var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
2715
+ var result = {
2716
+ width: element.offsetWidth + y,
2717
+ height: element.offsetHeight + x
2718
+ };
2719
+
2720
+ // reset element styles
2721
+ element.style.display = _display;
2722
+ element.style.visibility = _visibility;
2723
+ return result;
2724
+ }
2725
+
2829
2726
  /**
2830
2727
  * Get the opposite placement of the given one/
2831
2728
  * @function
2832
2729
  * @ignore
2833
2730
  * @argument {String} placement
2834
2731
  * @returns {String} flipped placement
2835
- */
2836
- function getOppositePlacement(placement) {
2837
- var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
2838
- return placement.replace(/left|right|bottom|top/g, function (matched) {
2839
- return hash[matched];
2840
- });
2841
- }
2842
-
2732
+ */
2733
+ function getOppositePlacement(placement) {
2734
+ var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
2735
+ return placement.replace(/left|right|bottom|top/g, function (matched) {
2736
+ return hash[matched];
2737
+ });
2738
+ }
2739
+
2843
2740
  /**
2844
2741
  * Given the popper offsets, generate an output similar to getBoundingClientRect
2845
2742
  * @function
2846
2743
  * @ignore
2847
2744
  * @argument {Object} popperOffsets
2848
2745
  * @returns {Object} ClientRect like output
2849
- */
2850
- function getPopperClientRect(popperOffsets) {
2851
- var offsets = Object.assign({}, popperOffsets);
2852
- offsets.right = offsets.left + offsets.width;
2853
- offsets.bottom = offsets.top + offsets.height;
2854
- return offsets;
2855
- }
2856
-
2746
+ */
2747
+ function getPopperClientRect(popperOffsets) {
2748
+ var offsets = Object.assign({}, popperOffsets);
2749
+ offsets.right = offsets.left + offsets.width;
2750
+ offsets.bottom = offsets.top + offsets.height;
2751
+ return offsets;
2752
+ }
2753
+
2857
2754
  /**
2858
2755
  * Given an array and the key to find, returns its index
2859
2756
  * @function
@@ -2861,155 +2758,76 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
2861
2758
  * @argument {Array} arr
2862
2759
  * @argument keyToFind
2863
2760
  * @returns index or null
2864
- */
2865
- function getArrayKeyIndex(arr, keyToFind) {
2866
- var i = 0,
2867
- key;
2868
- for (key in arr) {
2869
- if (arr[key] === keyToFind) {
2870
- return i;
2871
- }
2872
- i++;
2873
- }
2874
- return null;
2875
- }
2876
-
2761
+ */
2762
+ function getArrayKeyIndex(arr, keyToFind) {
2763
+ var i = 0,
2764
+ key;
2765
+ for (key in arr) {
2766
+ if (arr[key] === keyToFind) {
2767
+ return i;
2768
+ }
2769
+ i++;
2770
+ }
2771
+ return null;
2772
+ }
2773
+
2877
2774
  /**
2878
2775
  * Get CSS computed property of the given element
2879
2776
  * @function
2880
2777
  * @ignore
2881
2778
  * @argument {Eement} element
2882
2779
  * @argument {String} property
2883
- */
2884
- function getStyleComputedProperty(element, property) {
2885
- // NOTE: 1 DOM access here
2886
- // 无界等微前端场景下沙箱 window 与元素实际渲染所在 window 可能不一致,
2887
- // 需使用元素自身的 view 读取计算样式,避免跨 document 读取到空值
2888
- var css = getRealWindow(element).getComputedStyle(element, null);
2889
- return css[property];
2890
- }
2891
-
2780
+ */
2781
+ function getStyleComputedProperty(element, property) {
2782
+ // NOTE: 1 DOM access here
2783
+ var css = root.getComputedStyle(element, null);
2784
+ return css[property];
2785
+ }
2892
2786
  /**
2893
2787
  * Returns the offset parent of the given element
2894
2788
  * @function
2895
2789
  * @ignore
2896
2790
  * @argument {Element} element
2897
2791
  * @returns {Element} offset parent
2898
- */
2899
- function getOffsetParent(element) {
2900
- var offsetParent = element.offsetParent;
2901
- return offsetParent === root.document.body || !offsetParent
2902
- ? root.document.documentElement
2903
- : offsetParent;
2904
- }
2905
-
2906
- /**
2907
- * Returns the window the given element actually renders in.
2908
- * 无界等微前端场景下组件代码运行在沙箱 window 中,而 DOM 实际渲染在
2909
- * 主应用的 window(shadowRoot 内),滚动量、视口尺寸等必须取自元素自身的 view
2910
- * @function
2911
- * @ignore
2912
- * @argument {Element} element
2913
- * @returns {Window} window
2914
- */
2915
- function getRealWindow(element) {
2916
- return (
2917
- (element &&
2918
- element.ownerDocument &&
2919
- element.ownerDocument.defaultView) ||
2920
- root
2921
- );
2922
- }
2923
-
2924
- /**
2925
- * Returns the viewport rect of the containing block actually used to position the popper.
2926
- * 无界微前端等场景下 popper 被挂载进子应用的 shadowRoot,offsetParent 的兜底值
2927
- * (documentElement)与浏览器真实的包含块不再重合,导致下拉框/提示框整体偏移
2928
- * (偏移量恰为子应用容器在主应用中的位置),因此需要沿 composed tree 查找:
2929
- * - fixed 定位:包含块为视口;
2930
- * - absolute 定位:最近的 positioned 祖先元素(跨 shadowRoot 边界查找);
2931
- * - 无 positioned 祖先:初始包含块,其视口原点为真实 window 滚动量的负值。
2932
- * @function
2933
- * @ignore
2934
- * @argument {Element} element - popper element
2935
- * @argument {Boolean} fixed - whether the popper is fixed positioned
2936
- * @returns {Object} rect
2937
- */
2938
- function getContainingBlockRect(element, fixed) {
2939
- if (fixed) {
2940
- return { top: 0, left: 0, right: 0, bottom: 0 };
2941
- }
2942
-
2943
- var node = element.parentNode;
2944
- while (node) {
2945
- if (node.nodeType === 1) {
2946
- if (getStyleComputedProperty(node, 'position') !== 'static') {
2947
- return getBoundingClientRect(node);
2948
- }
2949
- } else if (node.nodeType === 11) {
2950
- // 遇到 shadowRoot,跨边界从宿主元素继续向上查找
2951
- node = node.host;
2952
- continue;
2953
- } else {
2954
- break;
2955
- }
2956
- node = node.parentNode;
2957
- }
2958
-
2959
- var win = getRealWindow(element);
2960
- return {
2961
- top: -(win.pageYOffset || 0),
2962
- left: -(win.pageXOffset || 0),
2963
- right: 0,
2964
- bottom: 0
2965
- };
2966
- }
2967
-
2792
+ */
2793
+ function getOffsetParent(element) {
2794
+ var offsetParent = element.offsetParent;
2795
+ return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;
2796
+ }
2797
+
2968
2798
  /**
2969
2799
  * Returns the scrolling parent of the given element
2970
2800
  * @function
2971
2801
  * @ignore
2972
2802
  * @argument {Element} element
2973
2803
  * @returns {Element} offset parent
2974
- */
2975
- function getScrollParent(element) {
2976
- var parent = element.parentNode;
2977
- if (!parent) {
2978
- return element;
2979
- }
2980
-
2981
- if (parent.nodeType === 11) {
2982
- // 无界等微前端场景 DOM 位于 shadowRoot 内,需跨边界从宿主元素继续向上查找,
2983
- // 否则查找到 shadowRoot 即终止,滚动事件无法被监听
2984
- return getScrollParent(parent.host);
2985
- }
2986
-
2987
- if (parent.nodeType !== 1) {
2988
- // 到达 document,返回元素实际渲染所在的真实 window,
2989
- // 保证 window 滚动时能触发位置更新
2990
- return getRealWindow(element);
2991
- }
2992
-
2993
- // Firefox want us to check `-x` and `-y` variations as well
2994
- if (
2995
- ['scroll', 'auto'].indexOf(
2996
- getStyleComputedProperty(parent, 'overflow')
2997
- ) !== -1 ||
2998
- ['scroll', 'auto'].indexOf(
2999
- getStyleComputedProperty(parent, 'overflow-x')
3000
- ) !== -1 ||
3001
- ['scroll', 'auto'].indexOf(
3002
- getStyleComputedProperty(parent, 'overflow-y')
3003
- ) !== -1
3004
- ) {
3005
- // If the detected scrollParent is body, we perform an additional check on its parentNode
3006
- // in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
3007
- // fixes issue #65
3008
- return parent;
3009
- }
3010
- return getScrollParent(parent);
3011
- }
3012
-
2804
+ */
2805
+ function getScrollParent(element) {
2806
+ var parent = element.parentNode;
2807
+ if (!parent || parent.nodeType !== 1) {
2808
+ return element;
2809
+ }
2810
+
2811
+ if (parent === root.document) {
2812
+ // Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is
2813
+ // greater than 0 and return the proper element
2814
+ if (root.document.body.scrollTop || root.document.body.scrollLeft) {
2815
+ return root.document.body;
2816
+ } else {
2817
+ return root.document.documentElement;
2818
+ }
2819
+ }
2820
+
2821
+ // Firefox want us to check `-x` and `-y` variations as well
2822
+ if (['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-x')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-y')) !== -1) {
2823
+ // If the detected scrollParent is body, we perform an additional check on its parentNode
2824
+ // in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
2825
+ // fixes issue #65
2826
+ return parent;
2827
+ }
2828
+ return getScrollParent(element.parentNode);
2829
+ }
2830
+
3013
2831
  /**
3014
2832
  * Check if the given element is fixed or is inside a fixed parent
3015
2833
  * @function
@@ -3017,125 +2835,109 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
3017
2835
  * @argument {Element} element
3018
2836
  * @argument {Element} customContainer
3019
2837
  * @returns {Boolean} answer to "isFixed?"
3020
- */
3021
- function isFixed(element) {
3022
- if (element === root.document.body) {
3023
- return false;
3024
- }
3025
- if (getStyleComputedProperty(element, 'position') === 'fixed') {
3026
- return true;
3027
- }
3028
- var parent = element.parentNode;
3029
- if (parent && parent.nodeType === 11) {
3030
- // 跨 shadowRoot 边界,从宿主元素继续向上判断
3031
- parent = parent.host;
3032
- }
3033
- return parent && parent.nodeType === 1 ? isFixed(parent) : false;
3034
- }
3035
-
2838
+ */
2839
+ function isFixed(element) {
2840
+ if (element === root.document.body) {
2841
+ return false;
2842
+ }
2843
+ if (getStyleComputedProperty(element, 'position') === 'fixed') {
2844
+ return true;
2845
+ }
2846
+ return element.parentNode && element.parentNode.nodeType === 1 ? isFixed(element.parentNode) : element;
2847
+ }
2848
+
3036
2849
  /**
3037
2850
  * Set the style to the given popper
3038
2851
  * @function
3039
2852
  * @ignore
3040
2853
  * @argument {Element} element - Element to apply the style to
3041
2854
  * @argument {Object} styles - Object with a list of properties and values which will be applied to the element
3042
- */
3043
- function setStyle(element, styles) {
3044
- function is_numeric(n) {
3045
- return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
3046
- }
3047
- Object.keys(styles).forEach(function (prop) {
3048
- var unit = '';
3049
- // add unit if the value is numeric and is one of the following
3050
- if (
3051
- ['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !==
3052
- -1 &&
3053
- is_numeric(styles[prop])
3054
- ) {
3055
- unit = 'px';
3056
- }
3057
- element.style[prop] = styles[prop] + unit;
3058
- });
3059
- }
3060
-
2855
+ */
2856
+ function setStyle(element, styles) {
2857
+ function is_numeric(n) {
2858
+ return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
2859
+ }
2860
+ Object.keys(styles).forEach(function (prop) {
2861
+ var unit = '';
2862
+ // add unit if the value is numeric and is one of the following
2863
+ if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {
2864
+ unit = 'px';
2865
+ }
2866
+ element.style[prop] = styles[prop] + unit;
2867
+ });
2868
+ }
2869
+
3061
2870
  /**
3062
2871
  * Check if the given variable is a function
3063
2872
  * @function
3064
2873
  * @ignore
3065
2874
  * @argument {*} functionToCheck - variable to check
3066
2875
  * @returns {Boolean} answer to: is a function?
3067
- */
3068
- function isFunction(functionToCheck) {
3069
- var getType = {};
3070
- return (
3071
- functionToCheck &&
3072
- getType.toString.call(functionToCheck) === '[object Function]'
3073
- );
3074
- }
3075
-
2876
+ */
2877
+ function isFunction(functionToCheck) {
2878
+ var getType = {};
2879
+ return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
2880
+ }
2881
+
3076
2882
  /**
3077
2883
  * Get the position of the given element, relative to its offset parent
3078
2884
  * @function
3079
2885
  * @ignore
3080
2886
  * @param {Element} element
3081
2887
  * @return {Object} position - Coordinates of the element and its `scrollTop`
3082
- */
3083
- function getOffsetRect(element) {
3084
- var transform = getStyle(element, 'transform')
3085
- .replace(/[^0-9\-,]/g, '')
3086
- .split(',');
3087
- var elementRect = {
3088
- width: element.offsetWidth,
3089
- height: element.offsetHeight,
3090
- left:
3091
- element.offsetLeft + (transform[4] ? parseInt(transform[4], 10) : 0),
3092
- top: element.offsetTop + (transform[5] ? parseInt(transform[5], 10) : 0)
3093
- };
3094
-
3095
- elementRect.right = elementRect.left + elementRect.width;
3096
- elementRect.bottom = elementRect.top + elementRect.height;
3097
-
3098
- // position
3099
- return elementRect;
3100
- }
3101
-
2888
+ */
2889
+ function getOffsetRect(element) {
2890
+ var transform = getStyle(element, 'transform').replace(/[^0-9\-,]/g, '').split(',');
2891
+ var elementRect = {
2892
+ width: element.offsetWidth,
2893
+ height: element.offsetHeight,
2894
+ left: element.offsetLeft + (transform[4] ? parseInt(transform[4], 10) : 0),
2895
+ top: element.offsetTop + (transform[5] ? parseInt(transform[5], 10) : 0)
2896
+ };
2897
+
2898
+ elementRect.right = elementRect.left + elementRect.width;
2899
+ elementRect.bottom = elementRect.top + elementRect.height;
2900
+
2901
+ // position
2902
+ return elementRect;
2903
+ }
2904
+
3102
2905
  /**
3103
2906
  * Get bounding client rect of given element
3104
2907
  * @function
3105
2908
  * @ignore
3106
2909
  * @param {HTMLElement} element
3107
2910
  * @return {Object} client rect
3108
- */
3109
- function getBoundingClientRect(element) {
3110
- var rect = element.getBoundingClientRect();
3111
-
3112
- // whether the IE version is lower than 11
3113
- var isIE = /MSIE|Trident/.test(navigator.userAgent);
3114
-
3115
- // fix ie document bounding top always 0 bug
3116
- var rectTop =
3117
- isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;
3118
-
3119
- return {
3120
- left: rect.left,
3121
- top: rectTop,
3122
- right: rect.right,
3123
- bottom: rect.bottom,
3124
- width: rect.right - rect.left,
3125
- height: rect.bottom - rectTop
3126
- };
3127
- }
3128
-
3129
- function getStyle(dom, attr) {
3130
- if (dom.style[attr]) {
3131
- return dom.style[attr];
3132
- }
3133
- if (window.getComputedStyle) {
3134
- return getComputedStyle(dom, null)[attr];
3135
- }
3136
- return dom.currentStyle[attr];
3137
- }
3138
-
2911
+ */
2912
+ function getBoundingClientRect(element) {
2913
+ var rect = element.getBoundingClientRect();
2914
+
2915
+ // whether the IE version is lower than 11
2916
+ var isIE = /MSIE|Trident/.test(navigator.userAgent);
2917
+
2918
+ // fix ie document bounding top always 0 bug
2919
+ var rectTop = isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;
2920
+
2921
+ return {
2922
+ left: rect.left,
2923
+ top: rectTop,
2924
+ right: rect.right,
2925
+ bottom: rect.bottom,
2926
+ width: rect.right - rect.left,
2927
+ height: rect.bottom - rectTop
2928
+ };
2929
+ }
2930
+
2931
+ function getStyle(dom, attr) {
2932
+ if (dom.style[attr]) {
2933
+ return dom.style[attr];
2934
+ }
2935
+ if (window.getComputedStyle) {
2936
+ return getComputedStyle(dom, null)[attr];
2937
+ }
2938
+ return dom.currentStyle[attr];
2939
+ }
2940
+
3139
2941
  /**
3140
2942
  * Given an element and one of its parents, return the offset
3141
2943
  * @function
@@ -3143,45 +2945,49 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
3143
2945
  * @param {HTMLElement} element
3144
2946
  * @param {HTMLElement} parent
3145
2947
  * @return {Object} rect
3146
- */
3147
- function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
3148
- var elementRect = getBoundingClientRect(element);
3149
- // parent 为 popper 元素:取其真实包含块的视口 rect,
3150
- // 避免无界 shadowRoot 等场景下包含块假设错误导致的整体偏移
3151
- var parentRect = getContainingBlockRect(parent, fixed);
3152
-
3153
- var rect = {
3154
- top: elementRect.top - parentRect.top,
3155
- left: elementRect.left - parentRect.left,
3156
- bottom: elementRect.top - parentRect.top + elementRect.height,
3157
- right: elementRect.left - parentRect.left + elementRect.width,
3158
- width: elementRect.width,
3159
- height: elementRect.height
3160
- };
3161
- return rect;
3162
- }
3163
-
2948
+ */
2949
+ function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
2950
+ var elementRect = getBoundingClientRect(element);
2951
+ var parentRect = getBoundingClientRect(parent);
2952
+
2953
+ if (fixed) {
2954
+ var scrollParent = getScrollParent(parent);
2955
+ parentRect.top += scrollParent.scrollTop;
2956
+ parentRect.bottom += scrollParent.scrollTop;
2957
+ parentRect.left += scrollParent.scrollLeft;
2958
+ parentRect.right += scrollParent.scrollLeft;
2959
+ }
2960
+
2961
+ var rect = {
2962
+ top: elementRect.top - parentRect.top,
2963
+ left: elementRect.left - parentRect.left,
2964
+ bottom: elementRect.top - parentRect.top + elementRect.height,
2965
+ right: elementRect.left - parentRect.left + elementRect.width,
2966
+ width: elementRect.width,
2967
+ height: elementRect.height
2968
+ };
2969
+ return rect;
2970
+ }
2971
+
3164
2972
  /**
3165
2973
  * Get the prefixed supported property name
3166
2974
  * @function
3167
2975
  * @ignore
3168
2976
  * @argument {String} property (camelCase)
3169
2977
  * @returns {String} prefixed property (camelCase)
3170
- */
3171
- function getSupportedPropertyName(property) {
3172
- var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
3173
-
3174
- for (var i = 0; i < prefixes.length; i++) {
3175
- var toCheck = prefixes[i]
3176
- ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1)
3177
- : property;
3178
- if (typeof root.document.body.style[toCheck] !== 'undefined') {
3179
- return toCheck;
3180
- }
3181
- }
3182
- return null;
3183
- }
3184
-
2978
+ */
2979
+ function getSupportedPropertyName(property) {
2980
+ var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
2981
+
2982
+ for (var i = 0; i < prefixes.length; i++) {
2983
+ var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;
2984
+ if (typeof root.document.body.style[toCheck] !== 'undefined') {
2985
+ return toCheck;
2986
+ }
2987
+ }
2988
+ return null;
2989
+ }
2990
+
3185
2991
  /**
3186
2992
  * The Object.assign() method is used to copy the values of all enumerable own properties from one or more source
3187
2993
  * objects to a target object. It will return the target object.
@@ -3189,46 +2995,41 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
3189
2995
  * Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
3190
2996
  * @function
3191
2997
  * @ignore
3192
- */
3193
- if (!Object.assign) {
3194
- Object.defineProperty(Object, 'assign', {
3195
- enumerable: false,
3196
- configurable: true,
3197
- writable: true,
3198
- value: function (target) {
3199
- if (target === undefined || target === null) {
3200
- throw new TypeError('Cannot convert first argument to object');
3201
- }
3202
-
3203
- var to = Object(target);
3204
- for (var i = 1; i < arguments.length; i++) {
3205
- var nextSource = arguments[i];
3206
- if (nextSource === undefined || nextSource === null) {
3207
- continue;
3208
- }
3209
- nextSource = Object(nextSource);
3210
-
3211
- var keysArray = Object.keys(nextSource);
3212
- for (
3213
- var nextIndex = 0, len = keysArray.length;
3214
- nextIndex < len;
3215
- nextIndex++
3216
- ) {
3217
- var nextKey = keysArray[nextIndex];
3218
- var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
3219
- if (desc !== undefined && desc.enumerable) {
3220
- to[nextKey] = nextSource[nextKey];
3221
- }
3222
- }
3223
- }
3224
- return to;
3225
- }
3226
- });
3227
- }
3228
-
3229
- return Popper;
3230
- });
2998
+ */
2999
+ if (!Object.assign) {
3000
+ Object.defineProperty(Object, 'assign', {
3001
+ enumerable: false,
3002
+ configurable: true,
3003
+ writable: true,
3004
+ value: function value(target) {
3005
+ if (target === undefined || target === null) {
3006
+ throw new TypeError('Cannot convert first argument to object');
3007
+ }
3231
3008
 
3009
+ var to = Object(target);
3010
+ for (var i = 1; i < arguments.length; i++) {
3011
+ var nextSource = arguments[i];
3012
+ if (nextSource === undefined || nextSource === null) {
3013
+ continue;
3014
+ }
3015
+ nextSource = Object(nextSource);
3016
+
3017
+ var keysArray = Object.keys(nextSource);
3018
+ for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
3019
+ var nextKey = keysArray[nextIndex];
3020
+ var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
3021
+ if (desc !== undefined && desc.enumerable) {
3022
+ to[nextKey] = nextSource[nextKey];
3023
+ }
3024
+ }
3025
+ }
3026
+ return to;
3027
+ }
3028
+ });
3029
+ }
3030
+
3031
+ return Popper;
3032
+ });
3232
3033
 
3233
3034
  /***/ }),
3234
3035