@geneui/components 3.0.0-next-7221a3a-16092024 → 3.0.0-next-1b7eefe-17092024

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 (135) hide show
  1. package/ActionableList/index.js +7 -8
  2. package/AdvancedSearch/index.js +5 -6
  3. package/Alert/index.js +3 -3
  4. package/Avatar/index.js +1 -1
  5. package/Badge/index.js +1 -1
  6. package/Breadcrumb/index.js +4 -5
  7. package/BusyLoader/index.js +2 -2
  8. package/Button/index.js +2 -2
  9. package/CHANGELOG.md +23 -0
  10. package/Card/index.js +4 -5
  11. package/CardList/index.js +11 -12
  12. package/{CellMeasurerCache-dbb3a6e5.js → CellMeasurerCache-f0690f3b.js} +2 -2
  13. package/Charts/index.js +19 -19
  14. package/Checkbox/index.js +4 -4
  15. package/CheckboxGroup/index.js +4 -4
  16. package/CheckboxGroupWithSearch/index.js +5 -6
  17. package/Collapse/index.js +2 -2
  18. package/ColorPicker/index.js +2 -2
  19. package/ComboBox/index.js +6 -6
  20. package/Copy/index.js +5 -5
  21. package/Counter/index.js +4 -5
  22. package/DateFilter/index.js +5 -6
  23. package/DatePicker/index.js +2 -2
  24. package/DatePickerInput/index.js +6 -7
  25. package/Divider/index.js +1 -1
  26. package/Drawer/index.js +5 -5
  27. package/Dropdown/index.js +8 -9
  28. package/Editor/index.js +7 -14
  29. package/Empty/index.js +1 -1
  30. package/ExtendedInput/index.js +5 -5
  31. package/Form/index.js +8 -9
  32. package/FormContainer/index.js +2 -2
  33. package/FormableCheckbox/index.js +5 -5
  34. package/FormableDatePicker/index.js +6 -7
  35. package/FormableDropdown/index.js +8 -9
  36. package/FormableEditor/index.js +3 -3
  37. package/{FormableHOC-c02b8928.js → FormableHOC-300e2dd7.js} +2 -2
  38. package/FormableMultiSelectDropdown/index.js +8 -9
  39. package/FormableNumberInput/index.js +5 -5
  40. package/FormableRadio/index.js +3 -3
  41. package/FormableSwitcher/index.js +3 -3
  42. package/FormableTextInput/index.js +5 -5
  43. package/FormableUploader/index.js +4 -5
  44. package/GeneUIProvider/index.js +3 -2
  45. package/Grid/index.js +3 -3
  46. package/HelperText/index.js +118 -0
  47. package/Holder/index.js +4 -5
  48. package/Icon/index.js +2 -2
  49. package/Image/index.js +6 -7
  50. package/ImagePreview/index.js +4 -5
  51. package/InteractiveWidget/index.js +4 -5
  52. package/KeyValue/index.js +2 -2
  53. package/Label/index.js +1 -1
  54. package/LinkButton/index.js +2 -2
  55. package/Menu/index.js +5 -5
  56. package/MobileNavigation/index.js +2 -2
  57. package/MobilePopup/index.js +5 -5
  58. package/Modal/index.js +3 -3
  59. package/ModuleTitle/index.js +5 -5
  60. package/NavigationMenu/index.js +6 -6
  61. package/Notification/index.js +3 -3
  62. package/Option/index.js +5 -5
  63. package/Overlay/index.js +4 -5
  64. package/Overspread/index.js +9 -10
  65. package/Pagination/index.js +4 -5
  66. package/Paper/index.js +2 -2
  67. package/Popover/index.js +411 -6
  68. package/PopoverV2/index.js +3 -3
  69. package/Products/index.js +3 -3
  70. package/Profile/index.js +4 -5
  71. package/Progress/index.js +2 -2
  72. package/Radio/index.js +2 -2
  73. package/RadioGroup/index.js +2 -2
  74. package/Range/index.js +3 -3
  75. package/Rating/index.js +4 -4
  76. package/RichEditor/index.js +1 -1
  77. package/{RichEditor-a3f1150e.js → RichEditor-3ad651c7.js} +1 -1
  78. package/Scrollbar/index.js +3 -3
  79. package/Search/index.js +4 -4
  80. package/SearchWithDropdown/index.js +9 -10
  81. package/Section/index.js +3 -3
  82. package/SkeletonLoader/index.js +2 -2
  83. package/Slider/index.js +5 -5
  84. package/Status/index.js +6 -6
  85. package/Steps/index.js +6 -6
  86. package/SuggestionList/index.js +3 -3
  87. package/Switcher/index.js +3 -3
  88. package/Table/index.js +16 -17
  89. package/TableCompositions/index.js +14 -15
  90. package/Tabs/index.js +2 -2
  91. package/Tag/index.js +3 -3
  92. package/Textarea/index.js +4 -4
  93. package/Time/index.js +2 -2
  94. package/TimePicker/index.js +57 -39
  95. package/Timeline/index.js +3 -3
  96. package/Title/index.js +3 -3
  97. package/Toaster/index.js +3 -3
  98. package/Tooltip/index.js +10 -153
  99. package/TransferList/index.js +9 -10
  100. package/Uploader/index.js +7 -8
  101. package/ValidatableCheckbox/index.js +4 -4
  102. package/ValidatableDatePicker/index.js +5 -6
  103. package/ValidatableDropdown/index.js +7 -8
  104. package/ValidatableElements/index.js +7 -8
  105. package/ValidatableMultiSelectDropdown/index.js +7 -8
  106. package/ValidatableNumberInput/index.js +4 -4
  107. package/ValidatableRadio/index.js +2 -2
  108. package/ValidatableSwitcher/index.js +2 -2
  109. package/ValidatableTextInput/index.js +4 -4
  110. package/ValidatableTimeInput/index.js +4 -4
  111. package/ValidatableUploader/index.js +3 -4
  112. package/Widget/index.js +4 -5
  113. package/_rollupPluginBabelHelpers-e8fb2e5c.js +16 -0
  114. package/{configs-1fb8eed2.js → configs-34847b77.js} +1 -1
  115. package/hooks/useDeviceType.js +1 -1
  116. package/index-006d8b06.js +3080 -0
  117. package/{index-34914e4c.js → index-263b0f0b.js} +1 -1
  118. package/{index-d10283d4.js → index-558ac559.js} +87 -64
  119. package/{index-46532c91.js → index-761141c1.js} +11 -10
  120. package/{index-282407ff.js → index-ac5c45f7.js} +3 -3
  121. package/index.d.ts +1 -0
  122. package/index.js +15 -15
  123. package/lib/atoms/Button/Button.d.ts +1 -1
  124. package/lib/atoms/HelperText/HelperText.d.ts +42 -0
  125. package/lib/atoms/HelperText/index.d.ts +1 -0
  126. package/lib/molecules/Tooltip/Tooltip.d.ts +58 -0
  127. package/lib/molecules/Tooltip/index.d.ts +1 -0
  128. package/objectWithoutPropertiesLoose-d8a4a68c.js +78 -0
  129. package/package.json +3 -2
  130. package/{rangeAndSlider-693a3d41.js → rangeAndSlider-63c5d423.js} +8 -16
  131. package/{react-beautiful-dnd.esm-ec039212.js → react-beautiful-dnd.esm-0ce25a0e.js} +7 -4
  132. package/{index-b7c1fe38.js → redux-b3e598ca.js} +2 -273
  133. package/Popover-f4d1cac0.js +0 -411
  134. package/_rollupPluginBabelHelpers-a83240e1.js +0 -11
  135. package/objectWithoutPropertiesLoose-e1596bdb.js +0 -62
@@ -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 _ };
@@ -1,11 +0,0 @@
1
- function _extends() {
2
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
3
- for (var e = 1; e < arguments.length; e++) {
4
- var t = arguments[e];
5
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
6
- }
7
- return n;
8
- }, _extends.apply(null, arguments);
9
- }
10
-
11
- export { _extends as _ };
@@ -1,62 +0,0 @@
1
- function _typeof(o) {
2
- "@babel/helpers - typeof";
3
-
4
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
5
- return typeof o;
6
- } : function (o) {
7
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
8
- }, _typeof(o);
9
- }
10
-
11
- function toPrimitive(t, r) {
12
- if ("object" != _typeof(t) || !t) return t;
13
- var e = t[Symbol.toPrimitive];
14
- if (void 0 !== e) {
15
- var i = e.call(t, r || "default");
16
- if ("object" != _typeof(i)) return i;
17
- throw new TypeError("@@toPrimitive must return a primitive value.");
18
- }
19
- return ("string" === r ? String : Number)(t);
20
- }
21
-
22
- function toPropertyKey(t) {
23
- var i = toPrimitive(t, "string");
24
- return "symbol" == _typeof(i) ? i : i + "";
25
- }
26
-
27
- function _setPrototypeOf(t, e) {
28
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
29
- return t.__proto__ = e, t;
30
- }, _setPrototypeOf(t, e);
31
- }
32
-
33
- function _defineProperty(e, r, t) {
34
- return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
35
- value: t,
36
- enumerable: !0,
37
- configurable: !0,
38
- writable: !0
39
- }) : e[r] = t, e;
40
- }
41
-
42
- function _extends() {
43
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
44
- for (var e = 1; e < arguments.length; e++) {
45
- var t = arguments[e];
46
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
47
- }
48
- return n;
49
- }, _extends.apply(null, arguments);
50
- }
51
-
52
- function _objectWithoutPropertiesLoose(r, e) {
53
- if (null == r) return {};
54
- var t = {};
55
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
56
- if (e.indexOf(n) >= 0) continue;
57
- t[n] = r[n];
58
- }
59
- return t;
60
- }
61
-
62
- export { _defineProperty as _, _setPrototypeOf as a, _objectWithoutPropertiesLoose as b, _extends as c, _typeof as d, toPropertyKey as t };