@geneui/components 2.16.0-canary-12a636d-09092024 → 2.16.0-canary-7376102-11092024

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 (127) hide show
  1. package/ActionableList/index.js +5 -6
  2. package/AdvancedSearch/index.js +4 -5
  3. package/Alert/index.js +2 -2
  4. package/Avatar/index.js +1 -1
  5. package/Badge/index.js +1 -1
  6. package/Breadcrumb/index.js +3 -4
  7. package/BusyLoader/index.js +1 -1
  8. package/Button/index.js +1 -1
  9. package/CHANGELOG.md +7 -0
  10. package/Card/index.js +3 -4
  11. package/CardList/index.js +9 -10
  12. package/{CellMeasurerCache-b172f99b.js → CellMeasurerCache-b31d12fe.js} +1 -1
  13. package/Charts/index.js +18 -18
  14. package/Checkbox/index.js +3 -3
  15. package/CheckboxGroup/index.js +3 -3
  16. package/CheckboxGroupWithSearch/index.js +4 -5
  17. package/Collapse/index.js +1 -1
  18. package/ColorPicker/index.js +1 -1
  19. package/ComboBox/index.js +5 -5
  20. package/Copy/index.js +4 -4
  21. package/Counter/index.js +3 -4
  22. package/DateFilter/index.js +4 -5
  23. package/DatePicker/index.js +1 -1
  24. package/DatePickerInput/index.js +5 -6
  25. package/Divider/index.js +1 -1
  26. package/Drawer/index.js +4 -4
  27. package/Dropdown/index.js +6 -7
  28. package/Editor/index.js +2 -2
  29. package/Empty/index.js +1 -1
  30. package/ExtendedInput/index.js +4 -4
  31. package/Form/index.js +6 -7
  32. package/FormContainer/index.js +1 -1
  33. package/FormableCheckbox/index.js +4 -4
  34. package/FormableDatePicker/index.js +5 -6
  35. package/FormableDropdown/index.js +6 -7
  36. package/FormableEditor/index.js +2 -2
  37. package/{FormableHOC-b26c5b16.js → FormableHOC-8c6104f7.js} +1 -1
  38. package/FormableMultiSelectDropdown/index.js +6 -7
  39. package/FormableNumberInput/index.js +4 -4
  40. package/FormableRadio/index.js +2 -2
  41. package/FormableSwitcher/index.js +2 -2
  42. package/FormableTextInput/index.js +4 -4
  43. package/FormableUploader/index.js +3 -4
  44. package/GeneUIProvider/index.js +2 -1
  45. package/Grid/index.js +2 -2
  46. package/Holder/index.js +3 -4
  47. package/Icon/index.js +1 -1
  48. package/Image/index.js +6 -7
  49. package/ImagePreview/index.js +3 -4
  50. package/InteractiveWidget/index.js +3 -4
  51. package/KeyValue/index.js +1 -1
  52. package/Label/index.js +1 -1
  53. package/LinkButton/index.js +1 -1
  54. package/Menu/index.js +4 -4
  55. package/MobileNavigation/index.js +1 -1
  56. package/MobilePopup/index.js +4 -4
  57. package/Modal/index.js +2 -2
  58. package/ModuleTitle/index.js +4 -4
  59. package/NavigationMenu/index.js +5 -5
  60. package/Notification/index.js +2 -2
  61. package/Option/index.js +4 -4
  62. package/Overlay/index.js +3 -4
  63. package/Overspread/index.js +7 -8
  64. package/Pagination/index.js +3 -4
  65. package/Paper/index.js +1 -1
  66. package/Popover/index.js +410 -5
  67. package/PopoverV2/index.js +2 -2
  68. package/Products/index.js +2 -2
  69. package/Profile/index.js +3 -4
  70. package/Progress/index.js +1 -1
  71. package/Radio/index.js +1 -1
  72. package/RadioGroup/index.js +1 -1
  73. package/Range/index.js +2 -2
  74. package/Rating/index.js +4 -4
  75. package/RichEditor/index.js +1 -1
  76. package/{RichEditor-a3f1150e.js → RichEditor-de21fe2b.js} +1 -1
  77. package/Scrollbar/index.js +2 -2
  78. package/Search/index.js +3 -3
  79. package/SearchWithDropdown/index.js +7 -8
  80. package/Section/index.js +2 -2
  81. package/SkeletonLoader/index.js +1 -1
  82. package/Slider/index.js +4 -4
  83. package/Status/index.js +5 -5
  84. package/Steps/index.js +5 -5
  85. package/SuggestionList/index.js +2 -2
  86. package/Switcher/index.js +2 -2
  87. package/Table/index.js +15 -16
  88. package/TableCompositions/index.js +12 -13
  89. package/Tabs/index.js +1 -1
  90. package/Tag/index.js +2 -2
  91. package/Textarea/index.js +3 -3
  92. package/Time/index.js +1 -1
  93. package/TimePicker/index.js +5 -5
  94. package/Timeline/index.js +2 -2
  95. package/Title/index.js +2 -2
  96. package/Toaster/index.js +2 -2
  97. package/Tooltip/index.js +10 -153
  98. package/TransferList/index.js +7 -8
  99. package/Uploader/index.js +6 -7
  100. package/ValidatableCheckbox/index.js +3 -3
  101. package/ValidatableDatePicker/index.js +4 -5
  102. package/ValidatableDropdown/index.js +5 -6
  103. package/ValidatableElements/index.js +5 -6
  104. package/ValidatableMultiSelectDropdown/index.js +5 -6
  105. package/ValidatableNumberInput/index.js +3 -3
  106. package/ValidatableRadio/index.js +1 -1
  107. package/ValidatableSwitcher/index.js +1 -1
  108. package/ValidatableTextInput/index.js +3 -3
  109. package/ValidatableTimeInput/index.js +3 -3
  110. package/ValidatableUploader/index.js +2 -3
  111. package/Widget/index.js +3 -4
  112. package/{configs-1fb8eed2.js → configs-00612ce0.js} +1 -1
  113. package/hooks/useDeviceType.js +1 -1
  114. package/{index-617ffc3a.js → index-1d3b2bbf.js} +10 -9
  115. package/index-464ea32b.js +3064 -0
  116. package/{index-18431aad.js → index-664c705c.js} +2 -2
  117. package/{index-34914e4c.js → index-898121d3.js} +1 -1
  118. package/{index-1beae3bb.js → index-9e11ebfb.js} +4 -4
  119. package/index.js +12 -13
  120. package/lib/atoms/Button/Button.d.ts +1 -1
  121. package/lib/molecules/Tooltip/Tooltip.d.ts +62 -0
  122. package/lib/molecules/Tooltip/index.d.ts +1 -0
  123. package/package.json +2 -1
  124. package/{rangeAndSlider-63c5d423.js → rangeAndSlider-693a3d41.js} +16 -8
  125. package/{react-beautiful-dnd.esm-04c14563.js → react-beautiful-dnd.esm-be4bf1e2.js} +2 -1
  126. package/{index-b1e429a7.js → redux-b3e598ca.js} +1 -272
  127. package/Popover-f4d1cac0.js +0 -411
@@ -1,411 +0,0 @@
1
- import { c as commonjsGlobal } from './_commonjsHelpers-24198af3.js';
2
- import React__default from 'react';
3
- import ReactDOM__default from 'react-dom';
4
-
5
- var Popover$1 = {};
6
-
7
- var util = {};
8
-
9
- Object.defineProperty(util, "__esModule", { value: true });
10
- util.Constants = {
11
- POPOVER_CONTAINER_CLASS_NAME: 'react-tiny-popover-container',
12
- DEFAULT_PADDING: 6,
13
- DEFAULT_WINDOW_PADDING: 6,
14
- FADE_TRANSITION: 0.35,
15
- DEFAULT_ARROW_COLOR: 'black',
16
- DEFAULT_POSITIONS: ['top', 'left', 'right', 'bottom'],
17
- EMPTY_CLIENT_RECT: {
18
- top: 0,
19
- left: 0,
20
- bottom: 0,
21
- height: 0,
22
- right: 0,
23
- width: 0,
24
- },
25
- };
26
- util.arrayUnique = function (array) { return array.filter(function (value, index, self) { return self.indexOf(value) === index; }); };
27
-
28
- var ArrowContainer$1 = {};
29
-
30
- var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
31
- __assign = Object.assign || function(t) {
32
- for (var s, i = 1, n = arguments.length; i < n; i++) {
33
- s = arguments[i];
34
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
- t[p] = s[p];
36
- }
37
- return t;
38
- };
39
- return __assign.apply(this, arguments);
40
- };
41
- Object.defineProperty(ArrowContainer$1, "__esModule", { value: true });
42
- var React$1 = React__default;
43
- var util_1$1 = util;
44
- var ArrowContainer = function (_a) {
45
- var position = _a.position, children = _a.children, style = _a.style, _b = _a.arrowColor, arrowColor = _b === void 0 ? util_1$1.Constants.DEFAULT_ARROW_COLOR : _b, _c = _a.arrowSize, arrowSize = _c === void 0 ? 10 : _c, arrowStyle = _a.arrowStyle, popoverRect = _a.popoverRect, targetRect = _a.targetRect;
46
- return (React$1.createElement("div", { style: __assign({ paddingLeft: position === 'right' ? arrowSize : 0, paddingTop: position === 'bottom' ? arrowSize : 0, paddingBottom: position === 'top' ? arrowSize : 0, paddingRight: position === 'left' ? arrowSize : 0 }, style) },
47
- React$1.createElement("div", { style: __assign({ position: 'absolute' }, (function () {
48
- var arrowWidth = arrowSize * 2;
49
- var top = (targetRect.top - popoverRect.top) + (targetRect.height / 2) - (arrowWidth / 2);
50
- var left = (targetRect.left - popoverRect.left) + (targetRect.width / 2) - (arrowWidth / 2);
51
- left = left < 0 ? 0 : left;
52
- left = left + arrowWidth > popoverRect.width ? popoverRect.width - arrowWidth : left;
53
- top = top < 0 ? 0 : top;
54
- top = top + arrowWidth > popoverRect.height ? popoverRect.height - arrowWidth : top;
55
- switch (position) {
56
- case 'right':
57
- return {
58
- borderTop: arrowSize + "px solid transparent",
59
- borderBottom: arrowSize + "px solid transparent",
60
- borderRight: arrowSize + "px solid " + arrowColor,
61
- left: 0,
62
- top: top,
63
- };
64
- case 'left':
65
- return {
66
- borderTop: arrowSize + "px solid transparent",
67
- borderBottom: arrowSize + "px solid transparent",
68
- borderLeft: arrowSize + "px solid " + arrowColor,
69
- right: 0,
70
- top: top,
71
- };
72
- case 'bottom':
73
- return {
74
- borderLeft: arrowSize + "px solid transparent",
75
- borderRight: arrowSize + "px solid transparent",
76
- borderBottom: arrowSize + "px solid " + arrowColor,
77
- top: 0,
78
- left: left,
79
- };
80
- case 'top':
81
- default:
82
- return {
83
- borderLeft: arrowSize + "px solid transparent",
84
- borderRight: arrowSize + "px solid transparent",
85
- borderTop: arrowSize + "px solid " + arrowColor,
86
- bottom: 0,
87
- left: left,
88
- };
89
- }
90
- })(), arrowStyle) }),
91
- children));
92
- };
93
- ArrowContainer$1.ArrowContainer = ArrowContainer;
94
-
95
- var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
96
- var extendStatics = function (d, b) {
97
- extendStatics = Object.setPrototypeOf ||
98
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
99
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
100
- return extendStatics(d, b);
101
- };
102
- return function (d, b) {
103
- extendStatics(d, b);
104
- function __() { this.constructor = d; }
105
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
106
- };
107
- })();
108
- Object.defineProperty(Popover$1, "__esModule", { value: true });
109
- var React = React__default;
110
- var react_dom_1 = ReactDOM__default;
111
- var util_1 = util;
112
- var ArrowContainer_1 = ArrowContainer$1;
113
- Popover$1.ArrowContainer = ArrowContainer_1.ArrowContainer;
114
- var Popover = /** @class */ (function (_super) {
115
- __extends(Popover, _super);
116
- function Popover() {
117
- var _this = _super !== null && _super.apply(this, arguments) || this;
118
- _this.target = null;
119
- _this.targetRect = null;
120
- _this.targetPositionIntervalHandler = null;
121
- _this.popoverDiv = null;
122
- _this.positionOrder = null;
123
- _this.willUnmount = false;
124
- _this.willMount = false;
125
- _this.onResize = function (e) {
126
- _this.renderPopover();
127
- };
128
- _this.onClick = function (e) {
129
- var _a = _this.props, onClickOutside = _a.onClickOutside, isOpen = _a.isOpen;
130
- if (!_this.willUnmount && !_this.willMount && !_this.popoverDiv.contains(e.target) && !_this.target.contains(e.target) && onClickOutside && isOpen) {
131
- onClickOutside(e);
132
- }
133
- };
134
- return _this;
135
- }
136
- Popover.prototype.componentDidMount = function () {
137
- var _this = this;
138
- window.setTimeout(function () { return _this.willMount = false; });
139
- var _a = this.props, position = _a.position, isOpen = _a.isOpen;
140
- this.target = react_dom_1.findDOMNode(this);
141
- this.positionOrder = this.getPositionPriorityOrder(position);
142
- this.updatePopover(isOpen);
143
- };
144
- Popover.prototype.componentDidUpdate = function (prevProps) {
145
- if (this.target == null) {
146
- this.target = react_dom_1.findDOMNode(this);
147
- }
148
- var prevIsOpen = prevProps.isOpen, prevPosition = prevProps.position, prevBody = prevProps.content;
149
- var _a = this.props, isOpen = _a.isOpen, content = _a.content, position = _a.position;
150
- this.positionOrder = this.getPositionPriorityOrder(this.props.position);
151
- var hasNewDestination = prevProps.contentDestination !== this.props.contentDestination;
152
- if (prevIsOpen !== isOpen ||
153
- prevBody !== content ||
154
- prevPosition !== position ||
155
- hasNewDestination) {
156
- if (hasNewDestination) {
157
- this.removePopover();
158
- this.popoverDiv.remove();
159
- }
160
- this.updatePopover(isOpen);
161
- }
162
- };
163
- Popover.prototype.componentWillMount = function () {
164
- this.willUnmount = false;
165
- this.willMount = true;
166
- };
167
- Popover.prototype.componentWillUnmount = function () {
168
- this.willUnmount = true;
169
- this.removePopover();
170
- };
171
- Popover.prototype.render = function () {
172
- return this.props.children;
173
- };
174
- Popover.prototype.updatePopover = function (isOpen) {
175
- if (isOpen && this.target != null) {
176
- if (!this.popoverDiv || !this.popoverDiv.parentNode) {
177
- var transitionDuration = this.props.transitionDuration;
178
- this.popoverDiv = this.createContainer();
179
- this.popoverDiv.style.opacity = '0';
180
- this.popoverDiv.style.transition = "opacity " + (transitionDuration || util_1.Constants.FADE_TRANSITION) + "s";
181
- (this.props.contentDestination || window.document.body).appendChild(this.popoverDiv);
182
- window.addEventListener('resize', this.onResize);
183
- window.addEventListener('click', this.onClick);
184
- }
185
- this.renderPopover();
186
- }
187
- else if (this.popoverDiv && this.popoverDiv.parentNode) {
188
- this.removePopover();
189
- }
190
- };
191
- Popover.prototype.renderPopover = function (positionIndex) {
192
- var _this = this;
193
- if (positionIndex === void 0) { positionIndex = 0; }
194
- if (positionIndex >= this.positionOrder.length) {
195
- this.removePopover();
196
- return;
197
- }
198
- this.renderWithPosition({ position: this.positionOrder[positionIndex], targetRect: this.target.getBoundingClientRect() }, function (violation, rect) {
199
- var _a;
200
- var _b = _this.props, disableReposition = _b.disableReposition, contentLocation = _b.contentLocation;
201
- if (violation && !disableReposition && !(typeof contentLocation === 'object')) {
202
- _this.renderPopover(positionIndex + 1);
203
- }
204
- else {
205
- var _c = _this.props, contentLocation_1 = _c.contentLocation, align = _c.align;
206
- var _d = _this.getNudgedPopoverPosition(rect), nudgedTop = _d.top, nudgedLeft = _d.left;
207
- var rectTop = rect.top, rectLeft = rect.left;
208
- var position = _this.positionOrder[positionIndex];
209
- var _e = disableReposition ? { top: rectTop, left: rectLeft } : { top: nudgedTop, left: nudgedLeft }, top_1 = _e.top, left = _e.left;
210
- if (contentLocation_1) {
211
- var targetRect = _this.target.getBoundingClientRect();
212
- var popoverRect = _this.popoverDiv.getBoundingClientRect();
213
- (_a = typeof contentLocation_1 === 'function' ? contentLocation_1({ targetRect: targetRect, popoverRect: popoverRect, position: position, align: align, nudgedLeft: nudgedLeft, nudgedTop: nudgedTop }) : contentLocation_1, top_1 = _a.top, left = _a.left);
214
- _this.popoverDiv.style.left = left.toFixed() + "px";
215
- _this.popoverDiv.style.top = top_1.toFixed() + "px";
216
- }
217
- else {
218
- var destinationTopOffset = 0;
219
- var destinationLeftOffset = 0;
220
- if (_this.props.contentDestination) {
221
- var destRect = _this.props.contentDestination.getBoundingClientRect();
222
- destinationTopOffset = -destRect.top;
223
- destinationLeftOffset = -destRect.left;
224
- }
225
- var _f = [top_1 + window.pageYOffset, left + window.pageXOffset], absoluteTop = _f[0], absoluteLeft = _f[1];
226
- var finalLeft = absoluteLeft + destinationTopOffset;
227
- var finalTop = absoluteTop + destinationLeftOffset;
228
- _this.popoverDiv.style.left = finalLeft.toFixed() + "px";
229
- _this.popoverDiv.style.top = finalTop.toFixed() + "px";
230
- }
231
- _this.popoverDiv.style.width = null;
232
- _this.popoverDiv.style.height = null;
233
- _this.renderWithPosition({
234
- position: position,
235
- nudgedTop: nudgedTop - rect.top,
236
- nudgedLeft: nudgedLeft - rect.left,
237
- targetRect: _this.target.getBoundingClientRect(),
238
- popoverRect: _this.popoverDiv.getBoundingClientRect(),
239
- }, function () {
240
- _this.startTargetPositionListener(10);
241
- if (_this.popoverDiv.style.opacity !== '1') {
242
- _this.popoverDiv.style.opacity = '1';
243
- }
244
- });
245
- }
246
- });
247
- };
248
- Popover.prototype.startTargetPositionListener = function (checkInterval) {
249
- var _this = this;
250
- if (this.targetPositionIntervalHandler === null) {
251
- this.targetPositionIntervalHandler = window.setInterval(function () {
252
- var newTargetRect = _this.target.getBoundingClientRect();
253
- if (_this.targetPositionHasChanged(_this.targetRect, newTargetRect)) {
254
- _this.renderPopover();
255
- }
256
- _this.targetRect = newTargetRect;
257
- }, checkInterval);
258
- }
259
- };
260
- Popover.prototype.renderWithPosition = function (_a, callback) {
261
- var _this = this;
262
- var position = _a.position, _b = _a.nudgedLeft, nudgedLeft = _b === void 0 ? 0 : _b, _c = _a.nudgedTop, nudgedTop = _c === void 0 ? 0 : _c, _d = _a.targetRect, targetRect = _d === void 0 ? util_1.Constants.EMPTY_CLIENT_RECT : _d, _e = _a.popoverRect, popoverRect = _e === void 0 ? util_1.Constants.EMPTY_CLIENT_RECT : _e;
263
- var _f = this.props, padding = _f.windowBorderPadding, content = _f.content, align = _f.align;
264
- var getContent = function (args) {
265
- return typeof content === 'function'
266
- ? content(args)
267
- : content;
268
- };
269
- react_dom_1.unstable_renderSubtreeIntoContainer(this, getContent({ position: position, nudgedLeft: nudgedLeft, nudgedTop: nudgedTop, targetRect: targetRect, popoverRect: popoverRect, align: align }), this.popoverDiv, function () {
270
- if (_this.willUnmount) {
271
- return;
272
- }
273
- var targetRect = _this.target.getBoundingClientRect();
274
- var popoverRect = _this.popoverDiv.getBoundingClientRect();
275
- var _a = _this.getLocationForPosition(position, targetRect, popoverRect), top = _a.top, left = _a.left;
276
- callback(position === 'top' && top < padding ||
277
- position === 'left' && left < padding ||
278
- position === 'right' && left + popoverRect.width > window.innerWidth - padding ||
279
- position === 'bottom' && top + popoverRect.height > window.innerHeight - padding, { width: popoverRect.width, height: popoverRect.height, top: top, left: left });
280
- });
281
- };
282
- Popover.prototype.getNudgedPopoverPosition = function (_a) {
283
- var top = _a.top, left = _a.left, width = _a.width, height = _a.height;
284
- var padding = this.props.windowBorderPadding;
285
- top = top < padding ? padding : top;
286
- top = top + height > window.innerHeight - padding ? window.innerHeight - padding - height : top;
287
- left = left < padding ? padding : left;
288
- left = left + width > window.innerWidth - padding ? window.innerWidth - padding - width : left;
289
- return { top: top, left: left };
290
- };
291
- Popover.prototype.removePopover = function () {
292
- var _this = this;
293
- if (this.popoverDiv) {
294
- var transitionDuration = this.props.transitionDuration;
295
- this.popoverDiv.style.opacity = '0';
296
- var remove = function () {
297
- if (_this.willUnmount || !_this.props.isOpen || !_this.popoverDiv.parentNode) {
298
- window.clearInterval(_this.targetPositionIntervalHandler);
299
- window.removeEventListener('resize', _this.onResize);
300
- window.removeEventListener('click', _this.onClick);
301
- _this.targetPositionIntervalHandler = null;
302
- if (_this.popoverDiv.parentNode) {
303
- _this.popoverDiv.parentNode.removeChild(_this.popoverDiv);
304
- }
305
- }
306
- };
307
- if (!this.willUnmount) {
308
- window.setTimeout(remove, (transitionDuration || util_1.Constants.FADE_TRANSITION) * 1000);
309
- }
310
- else {
311
- remove();
312
- }
313
- }
314
- };
315
- Popover.prototype.getPositionPriorityOrder = function (position) {
316
- if (position && typeof position !== 'string') {
317
- if (util_1.Constants.DEFAULT_POSITIONS.every(function (defaultPosition) { return position.find(function (p) { return p === defaultPosition; }) !== undefined; })) {
318
- return util_1.arrayUnique(position);
319
- }
320
- else {
321
- var remainingPositions = util_1.Constants.DEFAULT_POSITIONS.filter(function (defaultPosition) { return position.find(function (p) { return p === defaultPosition; }) === undefined; });
322
- return util_1.arrayUnique(position.concat(remainingPositions));
323
- }
324
- }
325
- else if (position && typeof position === 'string') {
326
- var remainingPositions = util_1.Constants.DEFAULT_POSITIONS.filter(function (defaultPosition) { return defaultPosition !== position; });
327
- return util_1.arrayUnique([position].concat(remainingPositions));
328
- }
329
- };
330
- Popover.prototype.createContainer = function () {
331
- var _a = this.props, containerStyle = _a.containerStyle, containerClassName = _a.containerClassName;
332
- var container = window.document.createElement('div');
333
- container.style.overflow = 'hidden';
334
- if (containerStyle) {
335
- Object.keys(containerStyle).forEach(function (key) { return container.style[key] = containerStyle[key]; });
336
- }
337
- container.className = containerClassName;
338
- container.style.position = 'absolute';
339
- container.style.top = '0';
340
- container.style.left = '0';
341
- return container;
342
- };
343
- Popover.prototype.getLocationForPosition = function (position, newTargetRect, popoverRect) {
344
- var _a = this.props, padding = _a.padding, align = _a.align;
345
- var targetMidX = newTargetRect.left + (newTargetRect.width / 2);
346
- var targetMidY = newTargetRect.top + (newTargetRect.height / 2);
347
- var top;
348
- var left;
349
- switch (position) {
350
- case 'top':
351
- top = newTargetRect.top - popoverRect.height - padding;
352
- left = targetMidX - (popoverRect.width / 2);
353
- if (align === 'start') {
354
- left = newTargetRect.left;
355
- }
356
- if (align === 'end') {
357
- left = newTargetRect.right - popoverRect.width;
358
- }
359
- break;
360
- case 'left':
361
- top = targetMidY - (popoverRect.height / 2);
362
- left = newTargetRect.left - padding - popoverRect.width;
363
- if (align === 'start') {
364
- top = newTargetRect.top;
365
- }
366
- if (align === 'end') {
367
- top = newTargetRect.bottom - popoverRect.height;
368
- }
369
- break;
370
- case 'bottom':
371
- top = newTargetRect.bottom + padding;
372
- left = targetMidX - (popoverRect.width / 2);
373
- if (align === 'start') {
374
- left = newTargetRect.left;
375
- }
376
- if (align === 'end') {
377
- left = newTargetRect.right - popoverRect.width;
378
- }
379
- break;
380
- case 'right':
381
- top = targetMidY - (popoverRect.height / 2);
382
- left = newTargetRect.right + padding;
383
- if (align === 'start') {
384
- top = newTargetRect.top;
385
- }
386
- if (align === 'end') {
387
- top = newTargetRect.bottom - popoverRect.height;
388
- }
389
- break;
390
- }
391
- return { top: top, left: left };
392
- };
393
- Popover.prototype.targetPositionHasChanged = function (oldTargetRect, newTargetRect) {
394
- return oldTargetRect === null
395
- || oldTargetRect.left !== newTargetRect.left
396
- || oldTargetRect.top !== newTargetRect.top
397
- || oldTargetRect.width !== newTargetRect.width
398
- || oldTargetRect.height !== newTargetRect.height;
399
- };
400
- Popover.defaultProps = {
401
- padding: util_1.Constants.DEFAULT_PADDING,
402
- windowBorderPadding: util_1.Constants.DEFAULT_WINDOW_PADDING,
403
- position: ['top', 'right', 'left', 'bottom'],
404
- align: 'center',
405
- containerClassName: util_1.Constants.POPOVER_CONTAINER_CLASS_NAME,
406
- };
407
- return Popover;
408
- }(React.Component));
409
- var _default = Popover$1.default = Popover;
410
-
411
- export { _default as _ };