@geneui/components 3.0.0-next-06dadf3-29102024 → 3.0.0-next-63cb5e7-01112024

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 (247) hide show
  1. package/Avatar.js +63 -0
  2. package/Divider.js +23 -0
  3. package/{GeneUIProvider/index.js → GeneUIProvider.js} +51 -64
  4. package/HelperText.js +69 -0
  5. package/Info.js +64 -0
  6. package/Label.js +38 -0
  7. package/Loader.js +21 -0
  8. package/Pill.js +64 -0
  9. package/TextLink.js +20 -0
  10. package/{index-c7646e48.js → Tooltip.js} +101 -79
  11. package/{lib → components}/atoms/Avatar/Avatar.d.ts +7 -6
  12. package/components/atoms/Avatar/index.d.ts +1 -0
  13. package/{lib → components}/atoms/Divider/Divider.d.ts +5 -5
  14. package/components/atoms/Divider/index.d.ts +1 -0
  15. package/{lib → components}/atoms/HelperText/HelperText.d.ts +6 -5
  16. package/components/atoms/HelperText/index.d.ts +1 -0
  17. package/{lib → components}/atoms/Info/Info.d.ts +5 -5
  18. package/components/atoms/Info/index.d.ts +1 -0
  19. package/{lib → components}/atoms/Label/Label.d.ts +3 -3
  20. package/components/atoms/Label/index.d.ts +1 -0
  21. package/{lib → components}/atoms/Loader/Loader.d.ts +5 -5
  22. package/components/atoms/Loader/index.d.ts +1 -0
  23. package/{lib → components}/atoms/Pill/Pill.d.ts +7 -6
  24. package/components/atoms/Pill/index.d.ts +1 -0
  25. package/{lib → components}/atoms/TextLink/TextLink.d.ts +5 -5
  26. package/components/atoms/TextLink/index.d.ts +1 -0
  27. package/{lib → components}/molecules/Tooltip/Tooltip.d.ts +26 -21
  28. package/components/molecules/Tooltip/index.d.ts +1 -0
  29. package/components/providers/GeneUIProvider/GeneUIProvider.d.ts +30 -0
  30. package/components/providers/GeneUIProvider/index.d.ts +1 -0
  31. package/hooks/index.d.ts +2 -20
  32. package/hooks/useDebounceCallback/index.d.ts +1 -0
  33. package/hooks/useDebounceCallback/useDebounceCallback.d.ts +2 -0
  34. package/hooks/useEllipsisDetection/index.d.ts +1 -1
  35. package/hooks/useEllipsisDetection/useEllipsisDetection.d.ts +2 -2
  36. package/{index-031ff73c.js → index-ce02421b.js} +4 -4
  37. package/index.d.ts +11 -121
  38. package/index.js +12 -159
  39. package/package.json +24 -43
  40. package/tokens-0abb4e1b.js +6 -0
  41. package/types/index.d.ts +0 -3
  42. package/useEllipsisDetection-46d712b6.js +34 -0
  43. package/ActionableList/index.js +0 -1694
  44. package/AdvancedSearch/index.js +0 -892
  45. package/Alert/index.js +0 -98
  46. package/Avatar/index.js +0 -58
  47. package/Badge/index.js +0 -29
  48. package/Breadcrumb/index.js +0 -130
  49. package/BusyLoader/index.js +0 -31
  50. package/Button/index.js +0 -30
  51. package/Card/index.js +0 -502
  52. package/CardList/index.js +0 -662
  53. package/CellMeasurerCache-26f3693c.js +0 -229
  54. package/Charts/index.js +0 -17662
  55. package/Checkbox/index.js +0 -229
  56. package/CheckboxGroup/index.js +0 -203
  57. package/CheckboxGroupWithSearch/index.js +0 -280
  58. package/Collapse/index.js +0 -195
  59. package/ColorPicker/index.js +0 -210
  60. package/ComboBox/index.js +0 -524
  61. package/Copy/index.js +0 -56
  62. package/Counter/index.js +0 -312
  63. package/DateFilter/index.js +0 -183
  64. package/DatePicker/index.js +0 -1229
  65. package/DatePickerInput/index.js +0 -883
  66. package/Divider/index.js +0 -23
  67. package/Drawer/index.js +0 -261
  68. package/Dropdown/index.js +0 -43
  69. package/Editor/index.js +0 -22975
  70. package/Empty/index.js +0 -76
  71. package/ExtendedInput/index.js +0 -590
  72. package/Form/index.js +0 -85
  73. package/FormContainer/index.js +0 -189
  74. package/FormableCheckbox/index.js +0 -24
  75. package/FormableDatePicker/index.js +0 -43
  76. package/FormableDropdown/index.js +0 -50
  77. package/FormableEditor/index.js +0 -26
  78. package/FormableHOC-85f89a81.js +0 -83
  79. package/FormableMultiSelectDropdown/index.js +0 -50
  80. package/FormableNumberInput/index.js +0 -34
  81. package/FormableRadio/index.js +0 -22
  82. package/FormableSwitcher/index.js +0 -22
  83. package/FormableTextInput/index.js +0 -34
  84. package/FormableUploader/index.js +0 -44
  85. package/Grid/index.js +0 -167
  86. package/HelperText/index.js +0 -86
  87. package/Holder/index.js +0 -261
  88. package/Icon/index.js +0 -62
  89. package/Image/index.js +0 -45
  90. package/ImagePreview/index.js +0 -217
  91. package/Info/index.js +0 -41
  92. package/InfoOutline-dd2e89d9.js +0 -29
  93. package/InteractiveWidget/index.js +0 -78
  94. package/KeyValue/index.js +0 -22
  95. package/Label/index.js +0 -48
  96. package/LinkButton/index.js +0 -34
  97. package/Loader/index.js +0 -23
  98. package/Menu/index.js +0 -281
  99. package/MobileNavigation/index.js +0 -94
  100. package/MobilePopup/index.js +0 -182
  101. package/Modal/index.js +0 -251
  102. package/ModuleTitle/index.js +0 -141
  103. package/NavigationMenu/index.js +0 -222
  104. package/Notification/index.js +0 -120
  105. package/Option/index.js +0 -184
  106. package/Overlay/index.js +0 -187
  107. package/Overspread/index.js +0 -291
  108. package/Pagination/index.js +0 -261
  109. package/Paper/index.js +0 -96
  110. package/Pill/index.js +0 -67
  111. package/Popover/index.js +0 -725
  112. package/PopoverV2/index.js +0 -19
  113. package/Portal/index.js +0 -58
  114. package/Products/index.js +0 -115
  115. package/Profile/index.js +0 -589
  116. package/Progress/index.js +0 -200
  117. package/QRCode/index.js +0 -814
  118. package/Radio/index.js +0 -151
  119. package/RadioGroup/index.js +0 -104
  120. package/Range/index.js +0 -191
  121. package/Rating/index.js +0 -174
  122. package/RichEditor/index.js +0 -13
  123. package/RichEditor-6ca8346f.js +0 -228
  124. package/Scrollbar/index.js +0 -1585
  125. package/Search/index.js +0 -75
  126. package/SearchWithDropdown/index.js +0 -140
  127. package/Section/index.js +0 -61
  128. package/SkeletonLoader/index.js +0 -81
  129. package/Slider/index.js +0 -261
  130. package/Status/index.js +0 -97
  131. package/Steps/index.js +0 -314
  132. package/SuggestionList/index.js +0 -385
  133. package/Switcher/index.js +0 -193
  134. package/Table/index.js +0 -57
  135. package/TableCompositions/index.js +0 -16995
  136. package/Tabs/index.js +0 -235
  137. package/Tag/index.js +0 -102
  138. package/TextLink/index.js +0 -20
  139. package/Textarea/index.js +0 -242
  140. package/Time/index.js +0 -62
  141. package/TimePicker/index.js +0 -575
  142. package/Timeline/index.js +0 -113
  143. package/Title/index.js +0 -65
  144. package/Toaster/index.js +0 -116
  145. package/Tooltip/index.js +0 -6
  146. package/TransferList/index.js +0 -493
  147. package/Uploader/index.js +0 -992
  148. package/ValidatableCheckbox/index.js +0 -123
  149. package/ValidatableDatePicker/index.js +0 -316
  150. package/ValidatableDropdown/index.js +0 -141
  151. package/ValidatableElements/index.js +0 -67
  152. package/ValidatableMultiSelectDropdown/index.js +0 -152
  153. package/ValidatableNumberInput/index.js +0 -204
  154. package/ValidatableRadio/index.js +0 -116
  155. package/ValidatableSwitcher/index.js +0 -93
  156. package/ValidatableTextInput/index.js +0 -167
  157. package/ValidatableTimeInput/index.js +0 -174
  158. package/ValidatableUploader/index.js +0 -98
  159. package/Widget/index.js +0 -225
  160. package/_commonjsHelpers-24198af3.js +0 -35
  161. package/_rollupPluginBabelHelpers-a83240e1.js +0 -11
  162. package/callAfterDelay-7272faca.js +0 -12
  163. package/checkTimeValidation-e56771be.js +0 -16
  164. package/checkboxRadioSwitcher-5b69d7bd.js +0 -4
  165. package/clsx.m-2bb6df4b.js +0 -3
  166. package/config-1053d64d.js +0 -20
  167. package/configs-00612ce0.js +0 -103
  168. package/configs.js +0 -111
  169. package/dateValidation-67caec66.js +0 -225
  170. package/debounce-4419bc2f.js +0 -17
  171. package/guid-8ddf77b3.js +0 -16
  172. package/hooks/useBodyScroll.js +0 -16
  173. package/hooks/useClick.js +0 -18
  174. package/hooks/useClickOutside.js +0 -25
  175. package/hooks/useDebounce.js +0 -28
  176. package/hooks/useDeviceType.js +0 -17
  177. package/hooks/useDidMount.js +0 -15
  178. package/hooks/useForceUpdate.js +0 -8
  179. package/hooks/useHover.js +0 -20
  180. package/hooks/useImgDownload.js +0 -18
  181. package/hooks/useKeyDown.js +0 -21
  182. package/hooks/useMount.js +0 -13
  183. package/hooks/useMutationObserver.js +0 -21
  184. package/hooks/usePrevious.js +0 -10
  185. package/hooks/useThrottle.js +0 -16
  186. package/hooks/useToggle.js +0 -11
  187. package/hooks/useUpdatableRef.js +0 -14
  188. package/hooks/useUpdate.js +0 -10
  189. package/hooks/useWidth.js +0 -16
  190. package/hooks/useWindowSize.js +0 -40
  191. package/index-122432cd.js +0 -270
  192. package/index-262edd7a.js +0 -77
  193. package/index-3188e46e.js +0 -1940
  194. package/index-45eafea6.js +0 -90
  195. package/index-5f37f281.js +0 -168
  196. package/index-ce12e4a9.js +0 -10032
  197. package/index-d0ecb950.js +0 -6483
  198. package/index-fcbae78d.js +0 -4
  199. package/index.mobile.d.ts +0 -14
  200. package/lib/atoms/Avatar/index.d.ts +0 -1
  201. package/lib/atoms/Badge/Badge.d.ts +0 -36
  202. package/lib/atoms/Badge/index.d.ts +0 -1
  203. package/lib/atoms/BusyLoader/BusyLoader.d.ts +0 -32
  204. package/lib/atoms/BusyLoader/BusyLoaderHolderHOC.d.ts +0 -8
  205. package/lib/atoms/BusyLoader/index.d.ts +0 -1
  206. package/lib/atoms/Button/Button.d.ts +0 -70
  207. package/lib/atoms/Button/index.d.ts +0 -1
  208. package/lib/atoms/Divider/index.d.ts +0 -1
  209. package/lib/atoms/Empty/Empty.d.ts +0 -39
  210. package/lib/atoms/Empty/index.d.ts +0 -1
  211. package/lib/atoms/Empty/utils.d.ts +0 -9
  212. package/lib/atoms/HelperText/index.d.ts +0 -1
  213. package/lib/atoms/Image/Image.d.ts +0 -51
  214. package/lib/atoms/Image/index.d.ts +0 -1
  215. package/lib/atoms/ImagePreview/ImagePreview.d.ts +0 -56
  216. package/lib/atoms/ImagePreview/ImagePreviewHOC.d.ts +0 -4
  217. package/lib/atoms/ImagePreview/Magnifier.d.ts +0 -40
  218. package/lib/atoms/ImagePreview/index.d.ts +0 -1
  219. package/lib/atoms/Info/index.d.ts +0 -1
  220. package/lib/atoms/KeyValue/KeyValue.d.ts +0 -29
  221. package/lib/atoms/KeyValue/index.d.ts +0 -1
  222. package/lib/atoms/Label/index.d.ts +0 -1
  223. package/lib/atoms/LinkButton/LinkButton.d.ts +0 -46
  224. package/lib/atoms/LinkButton/index.d.ts +0 -1
  225. package/lib/atoms/Loader/index.d.ts +0 -1
  226. package/lib/atoms/Pill/index.d.ts +0 -1
  227. package/lib/atoms/Rating/DefaultSvg.d.ts +0 -3
  228. package/lib/atoms/Rating/Rating.d.ts +0 -49
  229. package/lib/atoms/Rating/index.d.ts +0 -1
  230. package/lib/atoms/TextLink/index.d.ts +0 -1
  231. package/lib/molecules/Copy/Copy.d.ts +0 -38
  232. package/lib/molecules/Copy/index.d.ts +0 -1
  233. package/lib/molecules/InteractiveWidget/InteractiveWidget.d.ts +0 -70
  234. package/lib/molecules/InteractiveWidget/InteractiveWidgetIcon.d.ts +0 -8
  235. package/lib/molecules/InteractiveWidget/index.d.ts +0 -1
  236. package/lib/molecules/Tooltip/index.d.ts +0 -1
  237. package/lib/providers/GeneUIProvider/GeneUIProvider.d.ts +0 -30
  238. package/lib/providers/GeneUIProvider/index.d.ts +0 -1
  239. package/localization-4ba17032.js +0 -46
  240. package/objectWithoutPropertiesLoose-e1596bdb.js +0 -62
  241. package/rangeAndSlider-740a236c.js +0 -8676
  242. package/react-beautiful-dnd.esm-8c7b5a83.js +0 -10116
  243. package/react-lifecycles-compat.es-6e1f3768.js +0 -158
  244. package/redux-e591c1b8.js +0 -536
  245. package/tokens-8ab1179c.js +0 -6
  246. package/tslib.es6-f211516f.js +0 -35
  247. package/useEllipsisDetection-c1c9ad94.js +0 -38
package/index-3188e46e.js DELETED
@@ -1,1940 +0,0 @@
1
- import { _ as _extends } from './_rollupPluginBabelHelpers-a83240e1.js';
2
- import React__default, { forwardRef, useContext, useRef, useState, useMemo, useEffect, useCallback } from 'react';
3
- import { c as commonjsGlobal } from './_commonjsHelpers-24198af3.js';
4
- import ReactDOM__default from 'react-dom';
5
- import { u as useSwipeable } from './index-122432cd.js';
6
- import { c as classnames } from './index-031ff73c.js';
7
- import PropTypes from 'prop-types';
8
- import { n as noop, s as stopEvent } from './index-5f37f281.js';
9
- import useDeviceType from './hooks/useDeviceType.js';
10
- import useClickOutside from './hooks/useClickOutside.js';
11
- import { p as popoverV2Config, s as screenTypes } from './configs-00612ce0.js';
12
- import CustomScrollbar from './Scrollbar/index.js';
13
- import { GeneUIDesignSystemContext } from './GeneUIProvider/index.js';
14
- import { s as styleInject } from './style-inject.es-746bb8ed.js';
15
- import { d as debounce } from './debounce-4419bc2f.js';
16
-
17
- var Popover = {};
18
-
19
- var jsxRuntimeExports = {};
20
- var jsxRuntime = {
21
- get exports(){ return jsxRuntimeExports; },
22
- set exports(v){ jsxRuntimeExports = v; },
23
- };
24
-
25
- var reactJsxRuntime_production_min = {};
26
-
27
- /** @license React v16.14.0
28
- * react-jsx-runtime.production.min.js
29
- *
30
- * Copyright (c) Facebook, Inc. and its affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */
35
-
36
- var hasRequiredReactJsxRuntime_production_min;
37
-
38
- function requireReactJsxRuntime_production_min () {
39
- if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
40
- hasRequiredReactJsxRuntime_production_min = 1;
41
- var f=React__default,g=60103;reactJsxRuntime_production_min.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");reactJsxRuntime_production_min.Fragment=h("react.fragment");}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};
42
- function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
43
- return reactJsxRuntime_production_min;
44
- }
45
-
46
- var reactJsxRuntime_development = {};
47
-
48
- /** @license React v16.14.0
49
- * react-jsx-runtime.development.js
50
- *
51
- * Copyright (c) Facebook, Inc. and its affiliates.
52
- *
53
- * This source code is licensed under the MIT license found in the
54
- * LICENSE file in the root directory of this source tree.
55
- */
56
-
57
- var hasRequiredReactJsxRuntime_development;
58
-
59
- function requireReactJsxRuntime_development () {
60
- if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
61
- hasRequiredReactJsxRuntime_development = 1;
62
- (function (exports) {
63
-
64
- if (process.env.NODE_ENV !== "production") {
65
- (function() {
66
-
67
- var React = React__default;
68
-
69
- // ATTENTION
70
- // When adding new symbols to this file,
71
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
72
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
73
- // nor polyfill, then a plain number is used for performance.
74
- var REACT_ELEMENT_TYPE = 0xeac7;
75
- var REACT_PORTAL_TYPE = 0xeaca;
76
- exports.Fragment = 0xeacb;
77
- var REACT_STRICT_MODE_TYPE = 0xeacc;
78
- var REACT_PROFILER_TYPE = 0xead2;
79
- var REACT_PROVIDER_TYPE = 0xeacd;
80
- var REACT_CONTEXT_TYPE = 0xeace;
81
- var REACT_FORWARD_REF_TYPE = 0xead0;
82
- var REACT_SUSPENSE_TYPE = 0xead1;
83
- var REACT_SUSPENSE_LIST_TYPE = 0xead8;
84
- var REACT_MEMO_TYPE = 0xead3;
85
- var REACT_LAZY_TYPE = 0xead4;
86
- var REACT_BLOCK_TYPE = 0xead9;
87
- var REACT_SERVER_BLOCK_TYPE = 0xeada;
88
- var REACT_FUNDAMENTAL_TYPE = 0xead5;
89
- var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
90
- var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
91
-
92
- if (typeof Symbol === 'function' && Symbol.for) {
93
- var symbolFor = Symbol.for;
94
- REACT_ELEMENT_TYPE = symbolFor('react.element');
95
- REACT_PORTAL_TYPE = symbolFor('react.portal');
96
- exports.Fragment = symbolFor('react.fragment');
97
- REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
98
- REACT_PROFILER_TYPE = symbolFor('react.profiler');
99
- REACT_PROVIDER_TYPE = symbolFor('react.provider');
100
- REACT_CONTEXT_TYPE = symbolFor('react.context');
101
- REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
102
- REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
103
- REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
104
- REACT_MEMO_TYPE = symbolFor('react.memo');
105
- REACT_LAZY_TYPE = symbolFor('react.lazy');
106
- REACT_BLOCK_TYPE = symbolFor('react.block');
107
- REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
108
- REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
109
- symbolFor('react.scope');
110
- symbolFor('react.opaque.id');
111
- REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
112
- symbolFor('react.offscreen');
113
- REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
114
- }
115
-
116
- var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
117
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
118
- function getIteratorFn(maybeIterable) {
119
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
120
- return null;
121
- }
122
-
123
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
124
-
125
- if (typeof maybeIterator === 'function') {
126
- return maybeIterator;
127
- }
128
-
129
- return null;
130
- }
131
-
132
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
133
-
134
- function error(format) {
135
- {
136
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
137
- args[_key2 - 1] = arguments[_key2];
138
- }
139
-
140
- printWarning('error', format, args);
141
- }
142
- }
143
-
144
- function printWarning(level, format, args) {
145
- // When changing this logic, you might want to also
146
- // update consoleWithStackDev.www.js as well.
147
- {
148
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
149
- var stack = '';
150
-
151
- if (currentlyValidatingElement) {
152
- var name = getComponentName(currentlyValidatingElement.type);
153
- var owner = currentlyValidatingElement._owner;
154
- stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
155
- }
156
-
157
- stack += ReactDebugCurrentFrame.getStackAddendum();
158
-
159
- if (stack !== '') {
160
- format += '%s';
161
- args = args.concat([stack]);
162
- }
163
-
164
- var argsWithFormat = args.map(function (item) {
165
- return '' + item;
166
- }); // Careful: RN currently depends on this prefix
167
-
168
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
169
- // breaks IE9: https://github.com/facebook/react/issues/13610
170
- // eslint-disable-next-line react-internal/no-production-logging
171
-
172
- Function.prototype.apply.call(console[level], console, argsWithFormat);
173
- }
174
- }
175
-
176
- // Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
177
-
178
- var enableScopeAPI = false; // Experimental Create Event Handle API.
179
-
180
- function isValidElementType(type) {
181
- if (typeof type === 'string' || typeof type === 'function') {
182
- return true;
183
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
184
-
185
-
186
- if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
187
- return true;
188
- }
189
-
190
- if (typeof type === 'object' && type !== null) {
191
- if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
192
- return true;
193
- }
194
- }
195
-
196
- return false;
197
- }
198
-
199
-
200
- var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
201
- function describeComponentFrame (name, source, ownerName) {
202
- var sourceInfo = '';
203
-
204
- if (source) {
205
- var path = source.fileName;
206
- var fileName = path.replace(BEFORE_SLASH_RE, '');
207
-
208
- {
209
- // In DEV, include code for a common special case:
210
- // prefer "folder/index.js" instead of just "index.js".
211
- if (/^index\./.test(fileName)) {
212
- var match = path.match(BEFORE_SLASH_RE);
213
-
214
- if (match) {
215
- var pathBeforeSlash = match[1];
216
-
217
- if (pathBeforeSlash) {
218
- var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
219
- fileName = folderName + '/' + fileName;
220
- }
221
- }
222
- }
223
- }
224
-
225
- sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
226
- } else if (ownerName) {
227
- sourceInfo = ' (created by ' + ownerName + ')';
228
- }
229
-
230
- return '\n in ' + (name || 'Unknown') + sourceInfo;
231
- }
232
-
233
- var Resolved = 1;
234
- function refineResolvedLazyComponent(lazyComponent) {
235
- return lazyComponent._status === Resolved ? lazyComponent._result : null;
236
- }
237
-
238
- function getWrappedName(outerType, innerType, wrapperName) {
239
- var functionName = innerType.displayName || innerType.name || '';
240
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
241
- }
242
-
243
- function getComponentName(type) {
244
- if (type == null) {
245
- // Host root, text node or just invalid type.
246
- return null;
247
- }
248
-
249
- {
250
- if (typeof type.tag === 'number') {
251
- error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
252
- }
253
- }
254
-
255
- if (typeof type === 'function') {
256
- return type.displayName || type.name || null;
257
- }
258
-
259
- if (typeof type === 'string') {
260
- return type;
261
- }
262
-
263
- switch (type) {
264
- case exports.Fragment:
265
- return 'Fragment';
266
-
267
- case REACT_PORTAL_TYPE:
268
- return 'Portal';
269
-
270
- case REACT_PROFILER_TYPE:
271
- return "Profiler";
272
-
273
- case REACT_STRICT_MODE_TYPE:
274
- return 'StrictMode';
275
-
276
- case REACT_SUSPENSE_TYPE:
277
- return 'Suspense';
278
-
279
- case REACT_SUSPENSE_LIST_TYPE:
280
- return 'SuspenseList';
281
- }
282
-
283
- if (typeof type === 'object') {
284
- switch (type.$$typeof) {
285
- case REACT_CONTEXT_TYPE:
286
- return 'Context.Consumer';
287
-
288
- case REACT_PROVIDER_TYPE:
289
- return 'Context.Provider';
290
-
291
- case REACT_FORWARD_REF_TYPE:
292
- return getWrappedName(type, type.render, 'ForwardRef');
293
-
294
- case REACT_MEMO_TYPE:
295
- return getComponentName(type.type);
296
-
297
- case REACT_BLOCK_TYPE:
298
- return getComponentName(type.render);
299
-
300
- case REACT_LAZY_TYPE:
301
- {
302
- var thenable = type;
303
- var resolvedThenable = refineResolvedLazyComponent(thenable);
304
-
305
- if (resolvedThenable) {
306
- return getComponentName(resolvedThenable);
307
- }
308
-
309
- break;
310
- }
311
- }
312
- }
313
-
314
- return null;
315
- }
316
-
317
- var loggedTypeFailures = {};
318
- ReactSharedInternals.ReactDebugCurrentFrame;
319
- var currentlyValidatingElement = null;
320
-
321
- function setCurrentlyValidatingElement(element) {
322
- {
323
- currentlyValidatingElement = element;
324
- }
325
- }
326
-
327
- function checkPropTypes(typeSpecs, values, location, componentName, element) {
328
- {
329
- // $FlowFixMe This is okay but Flow doesn't know it.
330
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
331
-
332
- for (var typeSpecName in typeSpecs) {
333
- if (has(typeSpecs, typeSpecName)) {
334
- var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
335
- // fail the render phase where it didn't fail before. So we log it.
336
- // After these have been cleaned up, we'll let them throw.
337
-
338
- try {
339
- // This is intentionally an invariant that gets caught. It's the same
340
- // behavior as without this statement except with a better message.
341
- if (typeof typeSpecs[typeSpecName] !== 'function') {
342
- var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
343
- err.name = 'Invariant Violation';
344
- throw err;
345
- }
346
-
347
- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
348
- } catch (ex) {
349
- error$1 = ex;
350
- }
351
-
352
- if (error$1 && !(error$1 instanceof Error)) {
353
- setCurrentlyValidatingElement(element);
354
-
355
- error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
356
-
357
- setCurrentlyValidatingElement(null);
358
- }
359
-
360
- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
361
- // Only monitor this failure once because there tends to be a lot of the
362
- // same error.
363
- loggedTypeFailures[error$1.message] = true;
364
- setCurrentlyValidatingElement(element);
365
-
366
- error('Failed %s type: %s', location, error$1.message);
367
-
368
- setCurrentlyValidatingElement(null);
369
- }
370
- }
371
- }
372
- }
373
- }
374
-
375
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
376
- var hasOwnProperty = Object.prototype.hasOwnProperty;
377
- var RESERVED_PROPS = {
378
- key: true,
379
- ref: true,
380
- __self: true,
381
- __source: true
382
- };
383
- var specialPropKeyWarningShown;
384
- var specialPropRefWarningShown;
385
- var didWarnAboutStringRefs;
386
-
387
- {
388
- didWarnAboutStringRefs = {};
389
- }
390
-
391
- function hasValidRef(config) {
392
- {
393
- if (hasOwnProperty.call(config, 'ref')) {
394
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
395
-
396
- if (getter && getter.isReactWarning) {
397
- return false;
398
- }
399
- }
400
- }
401
-
402
- return config.ref !== undefined;
403
- }
404
-
405
- function hasValidKey(config) {
406
- {
407
- if (hasOwnProperty.call(config, 'key')) {
408
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
409
-
410
- if (getter && getter.isReactWarning) {
411
- return false;
412
- }
413
- }
414
- }
415
-
416
- return config.key !== undefined;
417
- }
418
-
419
- function warnIfStringRefCannotBeAutoConverted(config, self) {
420
- {
421
- if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
422
- var componentName = getComponentName(ReactCurrentOwner.current.type);
423
-
424
- if (!didWarnAboutStringRefs[componentName]) {
425
- error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
426
-
427
- didWarnAboutStringRefs[componentName] = true;
428
- }
429
- }
430
- }
431
- }
432
-
433
- function defineKeyPropWarningGetter(props, displayName) {
434
- {
435
- var warnAboutAccessingKey = function () {
436
- if (!specialPropKeyWarningShown) {
437
- specialPropKeyWarningShown = true;
438
-
439
- error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
440
- }
441
- };
442
-
443
- warnAboutAccessingKey.isReactWarning = true;
444
- Object.defineProperty(props, 'key', {
445
- get: warnAboutAccessingKey,
446
- configurable: true
447
- });
448
- }
449
- }
450
-
451
- function defineRefPropWarningGetter(props, displayName) {
452
- {
453
- var warnAboutAccessingRef = function () {
454
- if (!specialPropRefWarningShown) {
455
- specialPropRefWarningShown = true;
456
-
457
- error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
458
- }
459
- };
460
-
461
- warnAboutAccessingRef.isReactWarning = true;
462
- Object.defineProperty(props, 'ref', {
463
- get: warnAboutAccessingRef,
464
- configurable: true
465
- });
466
- }
467
- }
468
- /**
469
- * Factory method to create a new React element. This no longer adheres to
470
- * the class pattern, so do not use new to call it. Also, instanceof check
471
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
472
- * if something is a React Element.
473
- *
474
- * @param {*} type
475
- * @param {*} props
476
- * @param {*} key
477
- * @param {string|object} ref
478
- * @param {*} owner
479
- * @param {*} self A *temporary* helper to detect places where `this` is
480
- * different from the `owner` when React.createElement is called, so that we
481
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
482
- * functions, and as long as `this` and owner are the same, there will be no
483
- * change in behavior.
484
- * @param {*} source An annotation object (added by a transpiler or otherwise)
485
- * indicating filename, line number, and/or other information.
486
- * @internal
487
- */
488
-
489
-
490
- var ReactElement = function (type, key, ref, self, source, owner, props) {
491
- var element = {
492
- // This tag allows us to uniquely identify this as a React Element
493
- $$typeof: REACT_ELEMENT_TYPE,
494
- // Built-in properties that belong on the element
495
- type: type,
496
- key: key,
497
- ref: ref,
498
- props: props,
499
- // Record the component responsible for creating this element.
500
- _owner: owner
501
- };
502
-
503
- {
504
- // The validation flag is currently mutative. We put it on
505
- // an external backing store so that we can freeze the whole object.
506
- // This can be replaced with a WeakMap once they are implemented in
507
- // commonly used development environments.
508
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
509
- // the validation flag non-enumerable (where possible, which should
510
- // include every environment we run tests in), so the test framework
511
- // ignores it.
512
-
513
- Object.defineProperty(element._store, 'validated', {
514
- configurable: false,
515
- enumerable: false,
516
- writable: true,
517
- value: false
518
- }); // self and source are DEV only properties.
519
-
520
- Object.defineProperty(element, '_self', {
521
- configurable: false,
522
- enumerable: false,
523
- writable: false,
524
- value: self
525
- }); // Two elements created in two different places should be considered
526
- // equal for testing purposes and therefore we hide it from enumeration.
527
-
528
- Object.defineProperty(element, '_source', {
529
- configurable: false,
530
- enumerable: false,
531
- writable: false,
532
- value: source
533
- });
534
-
535
- if (Object.freeze) {
536
- Object.freeze(element.props);
537
- Object.freeze(element);
538
- }
539
- }
540
-
541
- return element;
542
- };
543
- /**
544
- * https://github.com/reactjs/rfcs/pull/107
545
- * @param {*} type
546
- * @param {object} props
547
- * @param {string} key
548
- */
549
-
550
- function jsxDEV(type, config, maybeKey, source, self) {
551
- {
552
- var propName; // Reserved names are extracted
553
-
554
- var props = {};
555
- var key = null;
556
- var ref = null; // Currently, key can be spread in as a prop. This causes a potential
557
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
558
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
559
- // but as an intermediary step, we will use jsxDEV for everything except
560
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
561
- // key is explicitly declared to be undefined or not.
562
-
563
- if (maybeKey !== undefined) {
564
- key = '' + maybeKey;
565
- }
566
-
567
- if (hasValidKey(config)) {
568
- key = '' + config.key;
569
- }
570
-
571
- if (hasValidRef(config)) {
572
- ref = config.ref;
573
- warnIfStringRefCannotBeAutoConverted(config, self);
574
- } // Remaining properties are added to a new props object
575
-
576
-
577
- for (propName in config) {
578
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
579
- props[propName] = config[propName];
580
- }
581
- } // Resolve default props
582
-
583
-
584
- if (type && type.defaultProps) {
585
- var defaultProps = type.defaultProps;
586
-
587
- for (propName in defaultProps) {
588
- if (props[propName] === undefined) {
589
- props[propName] = defaultProps[propName];
590
- }
591
- }
592
- }
593
-
594
- if (key || ref) {
595
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
596
-
597
- if (key) {
598
- defineKeyPropWarningGetter(props, displayName);
599
- }
600
-
601
- if (ref) {
602
- defineRefPropWarningGetter(props, displayName);
603
- }
604
- }
605
-
606
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
607
- }
608
- }
609
-
610
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
611
- ReactSharedInternals.ReactDebugCurrentFrame;
612
-
613
- function setCurrentlyValidatingElement$1(element) {
614
- currentlyValidatingElement = element;
615
- }
616
-
617
- var propTypesMisspellWarningShown;
618
-
619
- {
620
- propTypesMisspellWarningShown = false;
621
- }
622
- /**
623
- * Verifies the object is a ReactElement.
624
- * See https://reactjs.org/docs/react-api.html#isvalidelement
625
- * @param {?object} object
626
- * @return {boolean} True if `object` is a ReactElement.
627
- * @final
628
- */
629
-
630
- function isValidElement(object) {
631
- {
632
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
633
- }
634
- }
635
-
636
- function getDeclarationErrorAddendum() {
637
- {
638
- if (ReactCurrentOwner$1.current) {
639
- var name = getComponentName(ReactCurrentOwner$1.current.type);
640
-
641
- if (name) {
642
- return '\n\nCheck the render method of `' + name + '`.';
643
- }
644
- }
645
-
646
- return '';
647
- }
648
- }
649
-
650
- function getSourceInfoErrorAddendum(source) {
651
- {
652
- if (source !== undefined) {
653
- var fileName = source.fileName.replace(/^.*[\\\/]/, '');
654
- var lineNumber = source.lineNumber;
655
- return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
656
- }
657
-
658
- return '';
659
- }
660
- }
661
- /**
662
- * Warn if there's no key explicitly set on dynamic arrays of children or
663
- * object keys are not valid. This allows us to keep track of children between
664
- * updates.
665
- */
666
-
667
-
668
- var ownerHasKeyUseWarning = {};
669
-
670
- function getCurrentComponentErrorInfo(parentType) {
671
- {
672
- var info = getDeclarationErrorAddendum();
673
-
674
- if (!info) {
675
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
676
-
677
- if (parentName) {
678
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
679
- }
680
- }
681
-
682
- return info;
683
- }
684
- }
685
- /**
686
- * Warn if the element doesn't have an explicit key assigned to it.
687
- * This element is in an array. The array could grow and shrink or be
688
- * reordered. All children that haven't already been validated are required to
689
- * have a "key" property assigned to it. Error statuses are cached so a warning
690
- * will only be shown once.
691
- *
692
- * @internal
693
- * @param {ReactElement} element Element that requires a key.
694
- * @param {*} parentType element's parent's type.
695
- */
696
-
697
-
698
- function validateExplicitKey(element, parentType) {
699
- {
700
- if (!element._store || element._store.validated || element.key != null) {
701
- return;
702
- }
703
-
704
- element._store.validated = true;
705
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
706
-
707
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
708
- return;
709
- }
710
-
711
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
712
- // property, it may be the creator of the child that's responsible for
713
- // assigning it a key.
714
-
715
- var childOwner = '';
716
-
717
- if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
718
- // Give the component that originally created this child.
719
- childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
720
- }
721
-
722
- setCurrentlyValidatingElement$1(element);
723
-
724
- error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
725
-
726
- setCurrentlyValidatingElement$1(null);
727
- }
728
- }
729
- /**
730
- * Ensure that every element either is passed in a static location, in an
731
- * array with an explicit keys property defined, or in an object literal
732
- * with valid key property.
733
- *
734
- * @internal
735
- * @param {ReactNode} node Statically passed child of any type.
736
- * @param {*} parentType node's parent's type.
737
- */
738
-
739
-
740
- function validateChildKeys(node, parentType) {
741
- {
742
- if (typeof node !== 'object') {
743
- return;
744
- }
745
-
746
- if (Array.isArray(node)) {
747
- for (var i = 0; i < node.length; i++) {
748
- var child = node[i];
749
-
750
- if (isValidElement(child)) {
751
- validateExplicitKey(child, parentType);
752
- }
753
- }
754
- } else if (isValidElement(node)) {
755
- // This element was passed in a valid location.
756
- if (node._store) {
757
- node._store.validated = true;
758
- }
759
- } else if (node) {
760
- var iteratorFn = getIteratorFn(node);
761
-
762
- if (typeof iteratorFn === 'function') {
763
- // Entry iterators used to provide implicit keys,
764
- // but now we print a separate warning for them later.
765
- if (iteratorFn !== node.entries) {
766
- var iterator = iteratorFn.call(node);
767
- var step;
768
-
769
- while (!(step = iterator.next()).done) {
770
- if (isValidElement(step.value)) {
771
- validateExplicitKey(step.value, parentType);
772
- }
773
- }
774
- }
775
- }
776
- }
777
- }
778
- }
779
- /**
780
- * Given an element, validate that its props follow the propTypes definition,
781
- * provided by the type.
782
- *
783
- * @param {ReactElement} element
784
- */
785
-
786
-
787
- function validatePropTypes(element) {
788
- {
789
- var type = element.type;
790
-
791
- if (type === null || type === undefined || typeof type === 'string') {
792
- return;
793
- }
794
-
795
- var propTypes;
796
-
797
- if (typeof type === 'function') {
798
- propTypes = type.propTypes;
799
- } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
800
- // Inner props are checked in the reconciler.
801
- type.$$typeof === REACT_MEMO_TYPE)) {
802
- propTypes = type.propTypes;
803
- } else {
804
- return;
805
- }
806
-
807
- if (propTypes) {
808
- // Intentionally inside to avoid triggering lazy initializers:
809
- var name = getComponentName(type);
810
- checkPropTypes(propTypes, element.props, 'prop', name, element);
811
- } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
812
- propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
813
-
814
- var _name = getComponentName(type);
815
-
816
- error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
817
- }
818
-
819
- if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
820
- error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
821
- }
822
- }
823
- }
824
- /**
825
- * Given a fragment, validate that it can only be provided with fragment props
826
- * @param {ReactElement} fragment
827
- */
828
-
829
-
830
- function validateFragmentProps(fragment) {
831
- {
832
- var keys = Object.keys(fragment.props);
833
-
834
- for (var i = 0; i < keys.length; i++) {
835
- var key = keys[i];
836
-
837
- if (key !== 'children' && key !== 'key') {
838
- setCurrentlyValidatingElement$1(fragment);
839
-
840
- error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
841
-
842
- setCurrentlyValidatingElement$1(null);
843
- break;
844
- }
845
- }
846
-
847
- if (fragment.ref !== null) {
848
- setCurrentlyValidatingElement$1(fragment);
849
-
850
- error('Invalid attribute `ref` supplied to `React.Fragment`.');
851
-
852
- setCurrentlyValidatingElement$1(null);
853
- }
854
- }
855
- }
856
-
857
- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
858
- {
859
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
860
- // succeed and there will likely be errors in render.
861
-
862
- if (!validType) {
863
- var info = '';
864
-
865
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
866
- info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
867
- }
868
-
869
- var sourceInfo = getSourceInfoErrorAddendum(source);
870
-
871
- if (sourceInfo) {
872
- info += sourceInfo;
873
- } else {
874
- info += getDeclarationErrorAddendum();
875
- }
876
-
877
- var typeString;
878
-
879
- if (type === null) {
880
- typeString = 'null';
881
- } else if (Array.isArray(type)) {
882
- typeString = 'array';
883
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
884
- typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
885
- info = ' Did you accidentally export a JSX literal instead of a component?';
886
- } else {
887
- typeString = typeof type;
888
- }
889
-
890
- error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
891
- }
892
-
893
- var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
894
- // TODO: Drop this when these are no longer allowed as the type argument.
895
-
896
- if (element == null) {
897
- return element;
898
- } // Skip key warning if the type isn't valid since our key validation logic
899
- // doesn't expect a non-string/function type and can throw confusing errors.
900
- // We don't want exception behavior to differ between dev and prod.
901
- // (Rendering will throw with a helpful message and as soon as the type is
902
- // fixed, the key warnings will appear.)
903
-
904
-
905
- if (validType) {
906
- var children = props.children;
907
-
908
- if (children !== undefined) {
909
- if (isStaticChildren) {
910
- if (Array.isArray(children)) {
911
- for (var i = 0; i < children.length; i++) {
912
- validateChildKeys(children[i], type);
913
- }
914
-
915
- if (Object.freeze) {
916
- Object.freeze(children);
917
- }
918
- } else {
919
- error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
920
- }
921
- } else {
922
- validateChildKeys(children, type);
923
- }
924
- }
925
- }
926
-
927
- if (type === exports.Fragment) {
928
- validateFragmentProps(element);
929
- } else {
930
- validatePropTypes(element);
931
- }
932
-
933
- return element;
934
- }
935
- } // These two functions exist to still get child warnings in dev
936
- // even with the prod transform. This means that jsxDEV is purely
937
- // opt-in behavior for better messages but that we won't stop
938
- // giving you warnings if you use production apis.
939
-
940
- function jsxWithValidationStatic(type, props, key) {
941
- {
942
- return jsxWithValidation(type, props, key, true);
943
- }
944
- }
945
- function jsxWithValidationDynamic(type, props, key) {
946
- {
947
- return jsxWithValidation(type, props, key, false);
948
- }
949
- }
950
-
951
- var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
952
- // for now we can ship identical prod functions
953
-
954
- var jsxs = jsxWithValidationStatic ;
955
-
956
- exports.jsx = jsx;
957
- exports.jsxs = jsxs;
958
- })();
959
- }
960
- } (reactJsxRuntime_development));
961
- return reactJsxRuntime_development;
962
- }
963
-
964
- (function (module) {
965
-
966
- if (process.env.NODE_ENV === 'production') {
967
- module.exports = requireReactJsxRuntime_production_min();
968
- } else {
969
- module.exports = requireReactJsxRuntime_development();
970
- }
971
- } (jsxRuntime));
972
-
973
- var PopoverPortal$1 = {};
974
-
975
- Object.defineProperty(PopoverPortal$1, "__esModule", { value: true });
976
- PopoverPortal$1.PopoverPortal = void 0;
977
- var react_1$5 = React__default;
978
- var react_dom_1 = ReactDOM__default;
979
- var PopoverPortal = function (_a) {
980
- var container = _a.container, element = _a.element, children = _a.children;
981
- react_1$5.useLayoutEffect(function () {
982
- container.appendChild(element);
983
- return function () {
984
- container.removeChild(element);
985
- };
986
- }, [container, element]);
987
- return react_dom_1.createPortal(children, element);
988
- };
989
- PopoverPortal$1.PopoverPortal = PopoverPortal;
990
-
991
- var util = {};
992
-
993
- (function (exports) {
994
- Object.defineProperty(exports, "__esModule", { value: true });
995
- exports.getNudgedPopoverRect = exports.getNewPopoverRect = exports.popoverRectForPosition = exports.createContainer = exports.targetPositionHasChanged = exports.popoverStatesAreEqual = exports.rectsAreEqual = exports.arrayUnique = exports.Constants = void 0;
996
- exports.Constants = {
997
- POPOVER_CONTAINER_CLASS_NAME: 'react-tiny-popover-container',
998
- DEFAULT_ALIGN: 'center',
999
- OBSERVER_THRESHOLDS: Array(1000)
1000
- .fill(null)
1001
- .map(function (_, i) { return i / 1000; })
1002
- .reverse(),
1003
- DEFAULT_POSITIONS: ['top', 'left', 'right', 'bottom'],
1004
- EMPTY_CLIENT_RECT: {
1005
- top: 0,
1006
- left: 0,
1007
- bottom: 0,
1008
- height: 0,
1009
- right: 0,
1010
- width: 0,
1011
- },
1012
- };
1013
- var arrayUnique = function (array) {
1014
- return array.filter(function (value, index, self) { return self.indexOf(value) === index; });
1015
- };
1016
- exports.arrayUnique = arrayUnique;
1017
- var rectsAreEqual = function (rectA, rectB) {
1018
- return rectA === rectB ||
1019
- ((rectA === null || rectA === void 0 ? void 0 : rectA.bottom) === (rectB === null || rectB === void 0 ? void 0 : rectB.bottom) &&
1020
- (rectA === null || rectA === void 0 ? void 0 : rectA.height) === (rectB === null || rectB === void 0 ? void 0 : rectB.height) &&
1021
- (rectA === null || rectA === void 0 ? void 0 : rectA.left) === (rectB === null || rectB === void 0 ? void 0 : rectB.left) &&
1022
- (rectA === null || rectA === void 0 ? void 0 : rectA.right) === (rectB === null || rectB === void 0 ? void 0 : rectB.right) &&
1023
- (rectA === null || rectA === void 0 ? void 0 : rectA.top) === (rectB === null || rectB === void 0 ? void 0 : rectB.top) &&
1024
- (rectA === null || rectA === void 0 ? void 0 : rectA.width) === (rectB === null || rectB === void 0 ? void 0 : rectB.width));
1025
- };
1026
- exports.rectsAreEqual = rectsAreEqual;
1027
- var popoverStatesAreEqual = function (stateA, stateB) {
1028
- return stateA === stateB ||
1029
- ((stateA === null || stateA === void 0 ? void 0 : stateA.align) === (stateB === null || stateB === void 0 ? void 0 : stateB.align) &&
1030
- (stateA === null || stateA === void 0 ? void 0 : stateA.nudgedLeft) === (stateB === null || stateB === void 0 ? void 0 : stateB.nudgedLeft) &&
1031
- (stateA === null || stateA === void 0 ? void 0 : stateA.nudgedTop) === (stateB === null || stateB === void 0 ? void 0 : stateB.nudgedTop) &&
1032
- stateA.padding === stateB.padding &&
1033
- exports.rectsAreEqual(stateA === null || stateA === void 0 ? void 0 : stateA.popoverRect, stateB === null || stateB === void 0 ? void 0 : stateB.popoverRect) &&
1034
- exports.rectsAreEqual(stateA === null || stateA === void 0 ? void 0 : stateA.childRect, stateB === null || stateB === void 0 ? void 0 : stateB.childRect) &&
1035
- (stateA === null || stateA === void 0 ? void 0 : stateA.position) === (stateB === null || stateB === void 0 ? void 0 : stateB.position));
1036
- };
1037
- exports.popoverStatesAreEqual = popoverStatesAreEqual;
1038
- var targetPositionHasChanged = function (oldRect, newRect) {
1039
- return oldRect === undefined ||
1040
- oldRect.left !== newRect.left ||
1041
- oldRect.top !== newRect.top ||
1042
- oldRect.width !== newRect.width ||
1043
- oldRect.height !== newRect.height;
1044
- };
1045
- exports.targetPositionHasChanged = targetPositionHasChanged;
1046
- var createContainer = function (containerStyle, containerClassName) {
1047
- var container = window.document.createElement('div');
1048
- if (containerClassName)
1049
- container.className = containerClassName;
1050
- Object.assign(container.style, containerStyle);
1051
- return container;
1052
- };
1053
- exports.createContainer = createContainer;
1054
- var popoverRectForPosition = function (position, childRect, popoverRect, padding, align) {
1055
- var targetMidX = childRect.left + childRect.width / 2;
1056
- var targetMidY = childRect.top + childRect.height / 2;
1057
- var width = popoverRect.width, height = popoverRect.height;
1058
- var top;
1059
- var left;
1060
- switch (position) {
1061
- case 'left':
1062
- top = targetMidY - height / 2;
1063
- left = childRect.left - padding - width;
1064
- if (align === 'start') {
1065
- top = childRect.top;
1066
- }
1067
- if (align === 'end') {
1068
- top = childRect.bottom - height;
1069
- }
1070
- break;
1071
- case 'bottom':
1072
- top = childRect.bottom + padding;
1073
- left = targetMidX - width / 2;
1074
- if (align === 'start') {
1075
- left = childRect.left;
1076
- }
1077
- if (align === 'end') {
1078
- left = childRect.right - width;
1079
- }
1080
- break;
1081
- case 'right':
1082
- top = targetMidY - height / 2;
1083
- left = childRect.right + padding;
1084
- if (align === 'start') {
1085
- top = childRect.top;
1086
- }
1087
- if (align === 'end') {
1088
- top = childRect.bottom - height;
1089
- }
1090
- break;
1091
- default:
1092
- top = childRect.top - height - padding;
1093
- left = targetMidX - width / 2;
1094
- if (align === 'start') {
1095
- left = childRect.left;
1096
- }
1097
- if (align === 'end') {
1098
- left = childRect.right - width;
1099
- }
1100
- break;
1101
- }
1102
- return { top: top, left: left, width: width, height: height, right: left + width, bottom: top + height };
1103
- };
1104
- exports.popoverRectForPosition = popoverRectForPosition;
1105
- var getNewPopoverRect = function (_a, boundaryInset) {
1106
- var position = _a.position, align = _a.align, childRect = _a.childRect, popoverRect = _a.popoverRect, parentRect = _a.parentRect, padding = _a.padding, reposition = _a.reposition;
1107
- var rect = exports.popoverRectForPosition(position, childRect, popoverRect, padding, align);
1108
- var boundaryViolation = reposition &&
1109
- ((position === 'top' && rect.top < parentRect.top + boundaryInset) ||
1110
- (position === 'left' && rect.left < parentRect.left + boundaryInset) ||
1111
- (position === 'right' && rect.right > parentRect.right - boundaryInset) ||
1112
- (position === 'bottom' && rect.bottom > parentRect.bottom - boundaryInset));
1113
- return {
1114
- rect: rect,
1115
- boundaryViolation: boundaryViolation,
1116
- };
1117
- };
1118
- exports.getNewPopoverRect = getNewPopoverRect;
1119
- var getNudgedPopoverRect = function (popoverRect, parentRect, boundaryInset) {
1120
- var topBoundary = parentRect.top + boundaryInset;
1121
- var leftBoundary = parentRect.left + boundaryInset;
1122
- var rightBoundary = parentRect.right - boundaryInset;
1123
- var bottomBoundary = parentRect.bottom - boundaryInset;
1124
- var top = popoverRect.top < topBoundary ? topBoundary : popoverRect.top;
1125
- top = top + popoverRect.height > bottomBoundary ? bottomBoundary - popoverRect.height : top;
1126
- var left = popoverRect.left < leftBoundary ? leftBoundary : popoverRect.left;
1127
- left = left + popoverRect.width > rightBoundary ? rightBoundary - popoverRect.width : left;
1128
- return {
1129
- top: top,
1130
- left: left,
1131
- width: popoverRect.width,
1132
- height: popoverRect.height,
1133
- right: left + popoverRect.width,
1134
- bottom: top + popoverRect.height,
1135
- };
1136
- };
1137
- exports.getNudgedPopoverRect = getNudgedPopoverRect;
1138
-
1139
- } (util));
1140
-
1141
- var usePopover$1 = {};
1142
-
1143
- var useElementRef$1 = {};
1144
-
1145
- Object.defineProperty(useElementRef$1, "__esModule", { value: true });
1146
- useElementRef$1.useElementRef = void 0;
1147
- var react_1$4 = React__default;
1148
- var util_1$1 = util;
1149
- var useElementRef = function (containerClassName, containerStyle) {
1150
- var element = react_1$4.useMemo(function () { return util_1$1.createContainer(containerStyle, containerClassName); }, [containerClassName, containerStyle]);
1151
- return react_1$4.useRef(element);
1152
- };
1153
- useElementRef$1.useElementRef = useElementRef;
1154
-
1155
- Object.defineProperty(usePopover$1, "__esModule", { value: true });
1156
- usePopover$1.usePopover = void 0;
1157
- var react_1$3 = React__default;
1158
- var util_1 = util;
1159
- var useElementRef_1 = useElementRef$1;
1160
- var usePopover = function (_a) {
1161
- var childRef = _a.childRef, positions = _a.positions, containerClassName = _a.containerClassName, containerParent = _a.containerParent, contentLocation = _a.contentLocation, align = _a.align, padding = _a.padding, reposition = _a.reposition, boundaryInset = _a.boundaryInset, onPositionPopover = _a.onPositionPopover;
1162
- var popoverRef = useElementRef_1.useElementRef(containerClassName, {
1163
- position: 'fixed',
1164
- overflow: 'visible',
1165
- top: '0px',
1166
- left: '0px',
1167
- });
1168
- var positionPopover = react_1$3.useCallback(function (positionIndex, childRect, popoverRect, parentRect) {
1169
- var _a;
1170
- if (positionIndex === void 0) { positionIndex = 0; }
1171
- if (childRect === void 0) { childRect = (_a = childRef === null || childRef === void 0 ? void 0 : childRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(); }
1172
- if (popoverRect === void 0) { popoverRect = popoverRef.current.getBoundingClientRect(); }
1173
- if (parentRect === void 0) { parentRect = containerParent === null || containerParent === void 0 ? void 0 : containerParent.getBoundingClientRect(); }
1174
- if (!childRect || !parentRect) {
1175
- return;
1176
- }
1177
- if (contentLocation) {
1178
- var _b = typeof contentLocation === 'function'
1179
- ? contentLocation({
1180
- childRect: childRect,
1181
- popoverRect: popoverRect,
1182
- parentRect: parentRect,
1183
- padding: padding,
1184
- nudgedTop: 0,
1185
- nudgedLeft: 0,
1186
- boundaryInset: boundaryInset,
1187
- })
1188
- : contentLocation, inputTop = _b.top, inputLeft = _b.left;
1189
- var left_1 = parentRect.left + inputLeft;
1190
- var top_1 = parentRect.top + inputTop;
1191
- popoverRef.current.style.transform = "translate(" + left_1 + "px, " + top_1 + "px)";
1192
- onPositionPopover({
1193
- childRect: childRect,
1194
- popoverRect: popoverRect,
1195
- parentRect: parentRect,
1196
- padding: padding,
1197
- nudgedTop: 0,
1198
- nudgedLeft: 0,
1199
- boundaryInset: boundaryInset,
1200
- });
1201
- return;
1202
- }
1203
- var isExhausted = positionIndex === positions.length;
1204
- var position = isExhausted ? positions[0] : positions[positionIndex];
1205
- var _c = util_1.getNewPopoverRect({
1206
- childRect: childRect,
1207
- popoverRect: popoverRect,
1208
- parentRect: parentRect,
1209
- position: position,
1210
- align: align,
1211
- padding: padding,
1212
- reposition: reposition,
1213
- }, boundaryInset), rect = _c.rect, boundaryViolation = _c.boundaryViolation;
1214
- if (boundaryViolation && reposition && !isExhausted) {
1215
- positionPopover(positionIndex + 1, childRect, popoverRect, parentRect);
1216
- return;
1217
- }
1218
- var top = rect.top, left = rect.left, width = rect.width, height = rect.height;
1219
- var shouldNudge = reposition && !isExhausted;
1220
- var _d = util_1.getNudgedPopoverRect(rect, parentRect, boundaryInset), nudgedLeft = _d.left, nudgedTop = _d.top;
1221
- var finalTop = top;
1222
- var finalLeft = left;
1223
- if (shouldNudge) {
1224
- finalTop = nudgedTop;
1225
- finalLeft = nudgedLeft;
1226
- }
1227
- popoverRef.current.style.transform = "translate(" + finalLeft + "px, " + finalTop + "px)";
1228
- onPositionPopover({
1229
- childRect: childRect,
1230
- popoverRect: {
1231
- top: finalTop,
1232
- left: finalLeft,
1233
- width: width,
1234
- height: height,
1235
- right: finalLeft + width,
1236
- bottom: finalTop + height,
1237
- },
1238
- parentRect: parentRect,
1239
- position: position,
1240
- align: align,
1241
- padding: padding,
1242
- nudgedTop: nudgedTop - top,
1243
- nudgedLeft: nudgedLeft - left,
1244
- boundaryInset: boundaryInset,
1245
- });
1246
- }, [
1247
- childRef,
1248
- popoverRef,
1249
- positions,
1250
- align,
1251
- padding,
1252
- reposition,
1253
- boundaryInset,
1254
- containerParent,
1255
- contentLocation,
1256
- onPositionPopover,
1257
- ]);
1258
- return [positionPopover, popoverRef];
1259
- };
1260
- usePopover$1.usePopover = usePopover;
1261
-
1262
- var useMemoizedArray$1 = {};
1263
-
1264
- Object.defineProperty(useMemoizedArray$1, "__esModule", { value: true });
1265
- useMemoizedArray$1.useMemoizedArray = void 0;
1266
- var react_1$2 = React__default;
1267
- var useMemoizedArray = function (externalArray) {
1268
- var prevArrayRef = react_1$2.useRef(externalArray);
1269
- var array = react_1$2.useMemo(function () {
1270
- if (prevArrayRef.current === externalArray)
1271
- return prevArrayRef.current;
1272
- if (prevArrayRef.current.length !== externalArray.length) {
1273
- prevArrayRef.current = externalArray;
1274
- return externalArray;
1275
- }
1276
- for (var i = 0; i < externalArray.length; i += 1) {
1277
- if (externalArray[i] !== prevArrayRef.current[i]) {
1278
- prevArrayRef.current = externalArray;
1279
- return externalArray;
1280
- }
1281
- }
1282
- return prevArrayRef.current;
1283
- }, [externalArray]);
1284
- return array;
1285
- };
1286
- useMemoizedArray$1.useMemoizedArray = useMemoizedArray;
1287
-
1288
- var useArrowContainer$1 = {};
1289
-
1290
- var __assign$1 = (commonjsGlobal && commonjsGlobal.__assign) || function () {
1291
- __assign$1 = Object.assign || function(t) {
1292
- for (var s, i = 1, n = arguments.length; i < n; i++) {
1293
- s = arguments[i];
1294
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
1295
- t[p] = s[p];
1296
- }
1297
- return t;
1298
- };
1299
- return __assign$1.apply(this, arguments);
1300
- };
1301
- Object.defineProperty(useArrowContainer$1, "__esModule", { value: true });
1302
- useArrowContainer$1.useArrowContainer = void 0;
1303
- var react_1$1 = React__default;
1304
- var useArrowContainer = function (_a) {
1305
- var childRect = _a.childRect, popoverRect = _a.popoverRect, position = _a.position, arrowSize = _a.arrowSize, arrowColor = _a.arrowColor;
1306
- var arrowContainerStyle = react_1$1.useMemo(function () {
1307
- return ({
1308
- padding: arrowSize,
1309
- });
1310
- }, [arrowSize]);
1311
- var arrowStyle = react_1$1.useMemo(function () {
1312
- return (__assign$1({ position: 'absolute' }, (function () {
1313
- var arrowWidth = arrowSize * 2;
1314
- var top = childRect.top - popoverRect.top + childRect.height / 2 - arrowWidth / 2;
1315
- var left = childRect.left - popoverRect.left + childRect.width / 2 - arrowWidth / 2;
1316
- var lowerBound = arrowSize;
1317
- var leftUpperBound = popoverRect.width - arrowSize;
1318
- var topUpperBound = popoverRect.height - arrowSize;
1319
- left = left < lowerBound ? lowerBound : left;
1320
- left = left + arrowWidth > leftUpperBound ? leftUpperBound - arrowWidth : left;
1321
- top = top < lowerBound ? lowerBound : top;
1322
- top = top + arrowWidth > topUpperBound ? topUpperBound - arrowWidth : top;
1323
- top = Number.isNaN(top) ? 0 : top;
1324
- left = Number.isNaN(left) ? 0 : left;
1325
- switch (position) {
1326
- case 'right':
1327
- return {
1328
- borderTop: arrowSize + "px solid transparent",
1329
- borderBottom: arrowSize + "px solid transparent",
1330
- borderRight: arrowSize + "px solid " + arrowColor,
1331
- left: 0,
1332
- top: top,
1333
- };
1334
- case 'left':
1335
- return {
1336
- borderTop: arrowSize + "px solid transparent",
1337
- borderBottom: arrowSize + "px solid transparent",
1338
- borderLeft: arrowSize + "px solid " + arrowColor,
1339
- right: 0,
1340
- top: top,
1341
- };
1342
- case 'bottom':
1343
- return {
1344
- borderLeft: arrowSize + "px solid transparent",
1345
- borderRight: arrowSize + "px solid transparent",
1346
- borderBottom: arrowSize + "px solid " + arrowColor,
1347
- top: 0,
1348
- left: left,
1349
- };
1350
- case 'top':
1351
- return {
1352
- borderLeft: arrowSize + "px solid transparent",
1353
- borderRight: arrowSize + "px solid transparent",
1354
- borderTop: arrowSize + "px solid " + arrowColor,
1355
- bottom: 0,
1356
- left: left,
1357
- };
1358
- default:
1359
- return {
1360
- display: 'hidden',
1361
- };
1362
- }
1363
- })()));
1364
- }, [
1365
- arrowColor,
1366
- arrowSize,
1367
- childRect.height,
1368
- childRect.left,
1369
- childRect.top,
1370
- childRect.width,
1371
- popoverRect.height,
1372
- popoverRect.left,
1373
- popoverRect.top,
1374
- popoverRect.width,
1375
- position,
1376
- ]);
1377
- return {
1378
- arrowContainerStyle: arrowContainerStyle,
1379
- arrowStyle: arrowStyle,
1380
- };
1381
- };
1382
- useArrowContainer$1.useArrowContainer = useArrowContainer;
1383
-
1384
- var ArrowContainer$1 = {};
1385
-
1386
- var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
1387
- __assign = Object.assign || function(t) {
1388
- for (var s, i = 1, n = arguments.length; i < n; i++) {
1389
- s = arguments[i];
1390
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
1391
- t[p] = s[p];
1392
- }
1393
- return t;
1394
- };
1395
- return __assign.apply(this, arguments);
1396
- };
1397
- Object.defineProperty(ArrowContainer$1, "__esModule", { value: true });
1398
- ArrowContainer$1.ArrowContainer = void 0;
1399
- var jsx_runtime_1 = jsxRuntimeExports;
1400
- var react_1 = React__default;
1401
- var useArrowContainer_1 = useArrowContainer$1;
1402
- var ArrowContainer = function (_a) {
1403
- var childRect = _a.childRect, popoverRect = _a.popoverRect, position = _a.position, arrowColor = _a.arrowColor, arrowSize = _a.arrowSize, arrowClassName = _a.arrowClassName, externalArrowStyle = _a.arrowStyle, className = _a.className, children = _a.children, externalArrowContainerStyle = _a.style;
1404
- var _b = useArrowContainer_1.useArrowContainer({
1405
- childRect: childRect,
1406
- popoverRect: popoverRect,
1407
- position: position,
1408
- arrowColor: arrowColor,
1409
- arrowSize: arrowSize,
1410
- }), arrowContainerStyle = _b.arrowContainerStyle, arrowStyle = _b.arrowStyle;
1411
- var mergedContainerStyle = react_1.useMemo(function () { return (__assign(__assign({}, arrowContainerStyle), externalArrowContainerStyle)); }, [arrowContainerStyle, externalArrowContainerStyle]);
1412
- var mergedArrowStyle = react_1.useMemo(function () { return (__assign(__assign({}, arrowStyle), externalArrowStyle)); }, [arrowStyle, externalArrowStyle]);
1413
- return (jsx_runtime_1.jsxs("div", __assign({ className: className, style: mergedContainerStyle }, { children: [jsx_runtime_1.jsx("div", { style: mergedArrowStyle, className: arrowClassName }, void 0), children] }), void 0));
1414
- };
1415
- ArrowContainer$1.ArrowContainer = ArrowContainer;
1416
-
1417
- (function (exports) {
1418
- var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
1419
- __assign = Object.assign || function(t) {
1420
- for (var s, i = 1, n = arguments.length; i < n; i++) {
1421
- s = arguments[i];
1422
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
1423
- t[p] = s[p];
1424
- }
1425
- return t;
1426
- };
1427
- return __assign.apply(this, arguments);
1428
- };
1429
- Object.defineProperty(exports, "__esModule", { value: true });
1430
- exports.Popover = exports.usePopover = exports.ArrowContainer = exports.useArrowContainer = void 0;
1431
- var jsx_runtime_1 = jsxRuntimeExports;
1432
- var react_1 = React__default;
1433
- var PopoverPortal_1 = PopoverPortal$1;
1434
- var util_1 = util;
1435
- var usePopover_1 = usePopover$1;
1436
- Object.defineProperty(exports, "usePopover", { enumerable: true, get: function () { return usePopover_1.usePopover; } });
1437
- var useMemoizedArray_1 = useMemoizedArray$1;
1438
- var useArrowContainer_1 = useArrowContainer$1;
1439
- Object.defineProperty(exports, "useArrowContainer", { enumerable: true, get: function () { return useArrowContainer_1.useArrowContainer; } });
1440
- var ArrowContainer_1 = ArrowContainer$1;
1441
- Object.defineProperty(exports, "ArrowContainer", { enumerable: true, get: function () { return ArrowContainer_1.ArrowContainer; } });
1442
- exports.Popover = react_1.forwardRef(function (_a, externalRef) {
1443
- var isOpen = _a.isOpen, children = _a.children, content = _a.content, _b = _a.positions, externalPositions = _b === void 0 ? util_1.Constants.DEFAULT_POSITIONS : _b, _c = _a.align, align = _c === void 0 ? util_1.Constants.DEFAULT_ALIGN : _c, _d = _a.padding, padding = _d === void 0 ? 0 : _d, _e = _a.reposition, reposition = _e === void 0 ? true : _e, _f = _a.containerParent, containerParent = _f === void 0 ? window.document.body : _f, _g = _a.containerClassName, containerClassName = _g === void 0 ? 'react-tiny-popover-container' : _g, containerStyle = _a.containerStyle, contentLocation = _a.contentLocation, _h = _a.boundaryInset, boundaryInset = _h === void 0 ? 0 : _h, onClickOutside = _a.onClickOutside;
1444
- var positions = useMemoizedArray_1.useMemoizedArray(externalPositions);
1445
- // TODO: factor prevs out into a custom prevs hook
1446
- var prevIsOpen = react_1.useRef(false);
1447
- var prevPositions = react_1.useRef();
1448
- var prevContentLocation = react_1.useRef();
1449
- var prevReposition = react_1.useRef(reposition);
1450
- var childRef = react_1.useRef();
1451
- var _j = react_1.useState({
1452
- align: align,
1453
- nudgedLeft: 0,
1454
- nudgedTop: 0,
1455
- position: positions[0],
1456
- padding: padding,
1457
- childRect: util_1.Constants.EMPTY_CLIENT_RECT,
1458
- popoverRect: util_1.Constants.EMPTY_CLIENT_RECT,
1459
- parentRect: util_1.Constants.EMPTY_CLIENT_RECT,
1460
- boundaryInset: boundaryInset,
1461
- }), popoverState = _j[0], setPopoverState = _j[1];
1462
- var onPositionPopover = react_1.useCallback(function (popoverState) { return setPopoverState(popoverState); }, []);
1463
- var _k = usePopover_1.usePopover({
1464
- childRef: childRef,
1465
- containerClassName: containerClassName,
1466
- containerParent: containerParent,
1467
- contentLocation: contentLocation,
1468
- positions: positions,
1469
- align: align,
1470
- padding: padding,
1471
- boundaryInset: boundaryInset,
1472
- reposition: reposition,
1473
- onPositionPopover: onPositionPopover,
1474
- }), positionPopover = _k[0], popoverRef = _k[1];
1475
- react_1.useLayoutEffect(function () {
1476
- var shouldUpdate = true;
1477
- var updatePopover = function () {
1478
- var _a, _b;
1479
- if (isOpen && shouldUpdate) {
1480
- var childRect = (_a = childRef === null || childRef === void 0 ? void 0 : childRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1481
- var popoverRect = (_b = popoverRef === null || popoverRef === void 0 ? void 0 : popoverRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
1482
- if (childRect != null &&
1483
- popoverRect != null &&
1484
- (!util_1.rectsAreEqual(childRect, {
1485
- top: popoverState.childRect.top,
1486
- left: popoverState.childRect.left,
1487
- width: popoverState.childRect.width,
1488
- height: popoverState.childRect.height,
1489
- bottom: popoverState.childRect.top + popoverState.childRect.height,
1490
- right: popoverState.childRect.left + popoverState.childRect.width,
1491
- }) ||
1492
- popoverRect.width !== popoverState.popoverRect.width ||
1493
- popoverRect.height !== popoverState.popoverRect.height ||
1494
- popoverState.padding !== padding ||
1495
- popoverState.align !== align ||
1496
- positions !== prevPositions.current ||
1497
- contentLocation !== prevContentLocation.current ||
1498
- reposition !== prevReposition.current)) {
1499
- positionPopover();
1500
- }
1501
- // TODO: factor prev checks out into the custom prevs hook
1502
- if (positions !== prevPositions.current) {
1503
- prevPositions.current = positions;
1504
- }
1505
- if (contentLocation !== prevContentLocation.current) {
1506
- prevContentLocation.current = contentLocation;
1507
- }
1508
- if (reposition !== prevReposition.current) {
1509
- prevReposition.current = reposition;
1510
- }
1511
- if (shouldUpdate) {
1512
- window.requestAnimationFrame(updatePopover);
1513
- }
1514
- }
1515
- prevIsOpen.current = isOpen;
1516
- };
1517
- window.requestAnimationFrame(updatePopover);
1518
- return function () {
1519
- shouldUpdate = false;
1520
- };
1521
- }, [
1522
- align,
1523
- contentLocation,
1524
- isOpen,
1525
- padding,
1526
- popoverRef,
1527
- popoverState.align,
1528
- popoverState.childRect.height,
1529
- popoverState.childRect.left,
1530
- popoverState.childRect.top,
1531
- popoverState.childRect.width,
1532
- popoverState.padding,
1533
- popoverState.popoverRect.height,
1534
- popoverState.popoverRect.width,
1535
- positionPopover,
1536
- positions,
1537
- reposition,
1538
- ]);
1539
- react_1.useEffect(function () {
1540
- var popoverElement = popoverRef.current;
1541
- Object.assign(popoverElement.style, containerStyle);
1542
- return function () {
1543
- Object.keys(containerStyle !== null && containerStyle !== void 0 ? containerStyle : {}).forEach(function (key) {
1544
- return delete popoverElement.style[key];
1545
- });
1546
- };
1547
- }, [containerStyle, isOpen, popoverRef]);
1548
- var handleOnClickOutside = react_1.useCallback(function (e) {
1549
- var _a, _b;
1550
- if (isOpen &&
1551
- !((_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) &&
1552
- !((_b = childRef.current) === null || _b === void 0 ? void 0 : _b.contains(e.target))) {
1553
- onClickOutside === null || onClickOutside === void 0 ? void 0 : onClickOutside(e);
1554
- }
1555
- }, [isOpen, onClickOutside, popoverRef]);
1556
- var handleWindowResize = react_1.useCallback(function () {
1557
- if (childRef.current) {
1558
- window.requestAnimationFrame(function () { return positionPopover(); });
1559
- }
1560
- }, [positionPopover]);
1561
- react_1.useEffect(function () {
1562
- window.addEventListener('click', handleOnClickOutside);
1563
- window.addEventListener('resize', handleWindowResize);
1564
- return function () {
1565
- window.removeEventListener('click', handleOnClickOutside);
1566
- window.removeEventListener('resize', handleWindowResize);
1567
- };
1568
- }, [handleOnClickOutside, handleWindowResize]);
1569
- var handleRef = react_1.useCallback(function (node) {
1570
- childRef.current = node;
1571
- if (externalRef != null) {
1572
- if (typeof externalRef === 'object') {
1573
- externalRef.current = node;
1574
- }
1575
- else if (typeof externalRef === 'function') {
1576
- externalRef(node);
1577
- }
1578
- }
1579
- }, [externalRef]);
1580
- var renderChild = function () {
1581
- return react_1.cloneElement(children, {
1582
- ref: handleRef,
1583
- });
1584
- };
1585
- var renderPopover = function () {
1586
- if (!isOpen)
1587
- return null;
1588
- return (jsx_runtime_1.jsx(PopoverPortal_1.PopoverPortal, __assign({ element: popoverRef.current, container: containerParent }, { children: typeof content === 'function' ? content(popoverState) : content }), void 0));
1589
- };
1590
- return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderChild(), renderPopover()] }, void 0));
1591
- });
1592
-
1593
- } (Popover));
1594
-
1595
- var css_248z = "[data-gene-ui-version=\"2.16.4\"] .popover-positioner{--popover-border-radius:1rem;--popover-shadow:0 0.2rem 0.4rem 0 #0000000d,0 0 0 1px rgba(var(--background-sc-rgb),0.08);z-index:400}[data-gene-ui-version=\"2.16.4\"] .popover-positioner.cr-smooth-radius{--popover-border-radius:0.4rem}[data-gene-ui-version=\"2.16.4\"] .popover-positioner.mobile-view{--popover-border-radius:0.8rem 0.8rem 0 0;--popover-shadow:0 -1px 0.2rem 0 #0000000d;bottom:0;left:0!important;overflow:hidden;position:fixed!important;top:0!important;transform:translate(0)!important;width:100%}[data-gene-ui-version=\"2.16.4\"] .popover-positioner .popover-top-bottom-padding{padding:1rem 0;width:100%}[data-gene-ui-version=\"2.16.4\"] .popover-positioner .popover-top-bottom-padding>div[style*=width]{width:100%!important}[data-gene-ui-version=\"2.16.4\"] .popover{width:100%}[data-gene-ui-version=\"2.16.4\"] .popover-positioner.mobile-view .popover{height:100%;position:relative}[data-gene-ui-version=\"2.16.4\"] .popover-positioner-disable{margin-top:5px;position:inherit!important;transform:none!important}[data-gene-ui-version=\"2.16.4\"] .popover-track{width:100%}[data-gene-ui-version=\"2.16.4\"] .popover-content{background:var(--background);border-radius:var(--popover-border-radius);box-shadow:var(--popover-shadow);overflow:hidden;padding:0 0 env(safe-area-inset-bottom);transition:padding .4s;width:100%}[data-gene-ui-version=\"2.16.4\"] .popover-positioner.mobile-view .popover-content{-webkit-overflow-scrolling:auto;bottom:0;left:0;max-height:calc(100% - 10rem);overflow-x:hidden;overflow-y:auto;position:absolute;z-index:1}[data-gene-ui-version=\"2.16.4\"] .popover-positioner.mobile-view[style*=\"opacity: 0\"] .popover-content{transform:translateY(100%)}[data-gene-ui-version=\"2.16.4\"] .popover-positioner.mobile-view .popover-content{transform:translateY(0)}[data-gene-ui-version=\"2.16.4\"] .popover-mobile-backdrop{background:#0003;height:100%;left:0;opacity:1;position:absolute;top:0;width:100%;z-index:0}[data-gene-ui-version=\"2.16.4\"] .popover-footer,[data-gene-ui-version=\"2.16.4\"] .popover-header{background:var(--background);position:-webkit-sticky;position:sticky;z-index:1}[data-gene-ui-version=\"2.16.4\"] .popover-header{border-bottom:1px solid rgba(var(--background-sc-rgb),.1);top:0}[data-gene-ui-version=\"2.16.4\"] .popover-footer{align-items:stretch;border-top:1px solid rgba(var(--background-sc-rgb),.1);bottom:calc(env(safe-area-inset-bottom)*-1);display:flex;padding:0 0 env(safe-area-inset-bottom);transition:padding .4s}[data-gene-ui-version=\"2.16.4\"] .popover-body{position:relative;z-index:0}[data-gene-ui-version=\"2.16.4\"] .popover-search{padding:1.4rem 1.5rem}[data-gene-ui-version=\"2.16.4\"] .empty-data-holder{align-items:center;display:flex;height:19rem;justify-content:center;width:100%}[data-gene-ui-version=\"2.16.4\"] .popover-disabled{opacity:.5;pointer-events:none;transition:opacity .5s}";
1596
- styleInject(css_248z);
1597
-
1598
- const PopoverV2 = /*#__PURE__*/forwardRef((props, ref) => {
1599
- var _popoverRef$current4;
1600
- const {
1601
- nativeOutsideClick,
1602
- extendTargetWidth,
1603
- disableReposition,
1604
- disableTransform,
1605
- containerParent,
1606
- scrollbarNeeded,
1607
- onClickOutside,
1608
- trackClassName,
1609
- toggleHandler,
1610
- cornerRadius,
1611
- getScrollRef,
1612
- onSwipedDown,
1613
- contentRef,
1614
- screenType,
1615
- minHeight,
1616
- maxHeight,
1617
- className,
1618
- swipeable,
1619
- children,
1620
- position,
1621
- disabled,
1622
- Content,
1623
- padding,
1624
- behave,
1625
- Header,
1626
- Footer,
1627
- isOpen,
1628
- align,
1629
- scrollbarProps,
1630
- ...restProps
1631
- } = props;
1632
- const {
1633
- geneUIProviderRef
1634
- } = useContext(GeneUIDesignSystemContext);
1635
- const popoverRef = useRef(null);
1636
- const popoverBodyRef = useRef(null);
1637
- const popoverTrackRef = useRef(null);
1638
- const [updateKey, setUpdateKey] = useState(0);
1639
- const [targetWidth, setTargetWidth] = useState(null);
1640
- const [popoverOpened, setPopoverOpened] = useState(false);
1641
- const [swipingPosition, setSwipingPosition] = useState(0);
1642
- const {
1643
- isMobile
1644
- } = useDeviceType(screenType);
1645
- const isControlled = ('isOpen' in props);
1646
- const popoverState = isControlled ? isOpen : popoverOpened;
1647
- const positions = useMemo(() => Array.isArray(position) ? position : [position], [position]);
1648
- useEffect(() => {
1649
- document.documentElement.classList[popoverState ? 'add' : 'remove'](popoverV2Config.onOpenClassName);
1650
- }, [popoverState]);
1651
- useEffect(() => {
1652
- setUpdateKey(Date.now());
1653
- }, [isMobile, cornerRadius]);
1654
- useEffect(() => {
1655
- var _popoverRef$current;
1656
- if (popoverRef.current && (_popoverRef$current = popoverRef.current) !== null && _popoverRef$current !== void 0 && _popoverRef$current.offsetWidth) {
1657
- var _popoverRef$current2;
1658
- setTargetWidth((_popoverRef$current2 = popoverRef.current) === null || _popoverRef$current2 === void 0 ? void 0 : _popoverRef$current2.offsetWidth);
1659
- const debouncedHandleResize = debounce(() => {
1660
- var _popoverRef$current3;
1661
- setTargetWidth((_popoverRef$current3 = popoverRef.current) === null || _popoverRef$current3 === void 0 ? void 0 : _popoverRef$current3.offsetWidth);
1662
- }, 20);
1663
- window.addEventListener('resize', debouncedHandleResize);
1664
- return () => window.removeEventListener('resize', debouncedHandleResize);
1665
- }
1666
- }, [(_popoverRef$current4 = popoverRef.current) === null || _popoverRef$current4 === void 0 ? void 0 : _popoverRef$current4.offsetWidth]);
1667
-
1668
- /* *** START SWIPE FUNCTIONALITY *** */
1669
- const checkBodyContains = event => popoverBodyRef.current.contains(event.target);
1670
- const handleSwiped = event => setSwipingPosition(0);
1671
- const handleSwipedDown = touchEvent => {
1672
- !checkBodyContains(touchEvent.event) && onSwipedDown(touchEvent);
1673
- };
1674
- const handleSwiping = useCallback(_ref => {
1675
- let {
1676
- deltaY,
1677
- event
1678
- } = _ref;
1679
- if (checkBodyContains(event)) {
1680
- stopEvent(event);
1681
- } else if (deltaY >= 0) {
1682
- setSwipingPosition(deltaY * -1);
1683
- }
1684
- }, [popoverBodyRef, setSwipingPosition]);
1685
- const swipeHandlers = useSwipeable(useMemo(() => swipeable ? {
1686
- onSwipedDown: handleSwipedDown,
1687
- onSwiping: handleSwiping,
1688
- onSwiped: handleSwiped
1689
- } : {}, [swipeable, handleSwipedDown, handleSwiping, handleSwiped]));
1690
- /* *** END SWIPE FUNCTIONALITY *** */
1691
-
1692
- /* *** START OPEN/CLOSE FUNCTIONALITY *** */
1693
- const togglePopupOpened = useCallback(event => {
1694
- stopEvent(event);
1695
- if (isControlled) {
1696
- toggleHandler(event, isOpen);
1697
- } else {
1698
- setPopoverOpened(status => {
1699
- toggleHandler(event, !status);
1700
- return !status;
1701
- });
1702
- }
1703
- }, [isControlled, toggleHandler, isOpen]);
1704
- const handleTrackClick = useCallback(event => {
1705
- if (!disabled) {
1706
- if (behave === 'toggle') {
1707
- togglePopupOpened(event);
1708
- } else if (!isControlled && behave === 'open') {
1709
- setPopoverOpened(true);
1710
- }
1711
- }
1712
- }, [disabled, isControlled, behave, togglePopupOpened]);
1713
- const handleOutsideClick = useClickOutside(event => {
1714
- if (popoverRef && !popoverRef.current.contains(event.target)) {
1715
- onClickOutside(event);
1716
- if (!isControlled) {
1717
- setPopoverOpened(false);
1718
- }
1719
- }
1720
- });
1721
- /* *** END OPEN/CLOSE FUNCTIONALITY *** */
1722
-
1723
- /* *** START GENERATE REFS *** */
1724
- const generatePopoverRef = useCallback(element => {
1725
- popoverRef && (popoverRef.current = element);
1726
- ref && (ref.current = element);
1727
- }, [ref]);
1728
- const generateContentRef = useCallback(element => {
1729
- isMobile && getScrollRef(element);
1730
- handleOutsideClick(element);
1731
- if (contentRef) {
1732
- typeof contentRef === 'function' ? contentRef(element) : contentRef.current = element;
1733
- }
1734
- }, [isMobile, contentRef, getScrollRef]);
1735
- /* *** END GENERATE REFS *** */
1736
- const portalContent = /*#__PURE__*/React__default.createElement("div", swipeHandlers, /*#__PURE__*/React__default.createElement("ul", {
1737
- onClick: stopEvent,
1738
- ref: generateContentRef,
1739
- className: "popover-content",
1740
- style: {
1741
- bottom: swipingPosition,
1742
- width: extendTargetWidth && !isMobile && targetWidth || null
1743
- }
1744
- }, Header && /*#__PURE__*/React__default.createElement("li", {
1745
- className: "popover-header"
1746
- }, Header), /*#__PURE__*/React__default.createElement("li", {
1747
- ref: popoverBodyRef,
1748
- className: "popover-body"
1749
- }, scrollbarNeeded && !isMobile ? /*#__PURE__*/React__default.createElement(CustomScrollbar, _extends({
1750
- ref: scrollbar => {
1751
- scrollbar && getScrollRef(scrollbar.view);
1752
- },
1753
- autoHeight: true,
1754
- autoHeightMax: maxHeight,
1755
- autoHeightMin: minHeight
1756
- }, scrollbarProps), Content) : Content), Footer && /*#__PURE__*/React__default.createElement("li", {
1757
- className: "popover-footer"
1758
- }, Footer)), isMobile && /*#__PURE__*/React__default.createElement("div", {
1759
- className: "popover-mobile-backdrop",
1760
- onClick: togglePopupOpened
1761
- }));
1762
- const childElement = useMemo(() => /*#__PURE__*/React__default.createElement("div", {
1763
- onClick: handleTrackClick,
1764
- className: classnames('popover-track cursor-pointer', trackClassName, {
1765
- 'popover-opened': popoverState,
1766
- 'popover-disabled': disabled
1767
- })
1768
- }, children), [popoverTrackRef, children, trackClassName, popoverState, disabled, handleTrackClick]);
1769
- const containerParentMemo = useMemo(() => containerParent || geneUIProviderRef.current ? {
1770
- containerParent: containerParent || geneUIProviderRef.current
1771
- } : {}, [containerParent, geneUIProviderRef.current]);
1772
- if (!Content) {
1773
- return childElement;
1774
- }
1775
- return /*#__PURE__*/React__default.createElement(Popover.Popover, _extends({
1776
- key: updateKey,
1777
- ref: generatePopoverRef,
1778
- align: align,
1779
- positions: positions,
1780
- padding: padding,
1781
- onClickOutside: nativeOutsideClick,
1782
- isOpen: popoverState,
1783
- content: portalContent,
1784
- reposition: !isMobile && disableReposition,
1785
- containerStyle: {
1786
- overflow: null
1787
- },
1788
- containerClassName: classnames('popover-positioner', "cr-".concat(cornerRadius), className, {
1789
- 'mobile-view': isMobile,
1790
- 'popover-positioner-disable': disableTransform && containerParent && !isMobile
1791
- }),
1792
- children: childElement
1793
- }, containerParentMemo, restProps));
1794
- });
1795
- PopoverV2.propTypes = {
1796
- /**
1797
- * The component that need to be displayed in the Popover. Any valid React node
1798
- */
1799
- Content: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
1800
- /**
1801
- * The component that need to be displayed as Popover header. Any valid React node
1802
- */
1803
- Header: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
1804
- /**
1805
- * The component that need to be displayed as Popover footer. Any valid React node
1806
- */
1807
- Footer: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
1808
- /**
1809
- * The component which click needs to trigger the Popover to open. Need to passed as child to Popover. Any valid React node
1810
- */
1811
- children: PropTypes.node,
1812
- /**
1813
- * The Popover will get the width of its child. The property will not work when "width" prop is specified
1814
- */
1815
- extendTargetWidth: PropTypes.bool,
1816
- /**
1817
- * The Popover "Content" minimum scroll height
1818
- */
1819
- minHeight: PropTypes.number,
1820
- /**
1821
- * The Popover "Content" maximum scroll height. Will not work when the "screenType" is "mobile"
1822
- */
1823
- maxHeight: PropTypes.number,
1824
- /**
1825
- * Use this prop to control the Popover. Note the component will start not to open and close automatically
1826
- */
1827
- isOpen: PropTypes.bool,
1828
- /**
1829
- * Popover position to be displayed
1830
- */
1831
- position: PropTypes.oneOfType([PropTypes.oneOf(popoverV2Config.position), PropTypes.arrayOf(PropTypes.oneOf(popoverV2Config.position))]),
1832
- /**
1833
- * Will called each time the popover need to be toggled(child click, close button click, backdrop click).
1834
- * (event: Event, isOpen: bool) => void
1835
- */
1836
- toggleHandler: PropTypes.func,
1837
- /**
1838
- * Possible values are start, center, and end.
1839
- * If start is specified, the popover content's top or left location is aligned with its target's.
1840
- * With end specified, the content's bottom or right location is aligned with its target's.
1841
- * If center is specified, the popover content and target's centers are aligned.
1842
- */
1843
- align: PropTypes.oneOf(popoverV2Config.align),
1844
- /**
1845
- * If you'd like to apply styles to the single container div that your popover content is rendered within via stylesheets,
1846
- * you can specify a custom className for the container here.
1847
- */
1848
- className: PropTypes.string,
1849
- /**
1850
- * This number determines the gap, in pixels, between your target content and your popover content
1851
- */
1852
- padding: PropTypes.number,
1853
- /**
1854
- * If this property is enabled, rather than the popover content repositioning on a boundary collision,
1855
- * the popover content container will move beyond the window's bounds.
1856
- * You are, however, supplied with nudgedLeft and nudgedTop values, so you may choose to handle content overflow as you wish.
1857
- */
1858
- disableReposition: PropTypes.bool,
1859
- /**
1860
- * Popover corner radius
1861
- */
1862
- cornerRadius: PropTypes.oneOf(popoverV2Config.cornerRadius),
1863
- /**
1864
- * The switch between mobile and desktop version of Popover will be applied automatically, when the prop is not specified.
1865
- * When the prop is present it must be changed from outside.
1866
- */
1867
- screenType: PropTypes.oneOf(screenTypes),
1868
- /**
1869
- * Specify does Popover needs to be toggled on child click
1870
- */
1871
- behave: PropTypes.oneOf(popoverV2Config.behave),
1872
- /**
1873
- * Given content prop can have its own scroll, and with this props we can use/not use default scroll that has popover
1874
- */
1875
- scrollbarNeeded: PropTypes.bool,
1876
- /**
1877
- * Popover content ref
1878
- */
1879
- contentRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
1880
- current: PropTypes.any
1881
- })]),
1882
- disabled: PropTypes.bool,
1883
- getScrollRef: PropTypes.func,
1884
- /**
1885
- * This number specifies the inset around your containerParent's border
1886
- * that boundary violations are determined at. Defaults to 0. Can be negative.
1887
- */
1888
- boundaryInset: PropTypes.number,
1889
- /**
1890
- * If you want to apply styles to the popup tracker div where your children are using
1891
- * stylesheets, you can provide a custom class name for the container here.
1892
- */
1893
- trackClassName: PropTypes.string,
1894
- /*
1895
- * After DOWN swipe (SwipeEventData) => void
1896
- */
1897
- onSwipedDown: PropTypes.func,
1898
- swipeable: PropTypes.bool,
1899
- /*
1900
- * If react-tiny-popover detects a click event outside of the target and outside
1901
- * of the popover, you may handle this event here, in the form of (e: MouseEvent) => void.
1902
- */
1903
- onClickOutside: PropTypes.func,
1904
- nativeOutsideClick: PropTypes.func,
1905
- /*
1906
- * props for scrollbar
1907
- */
1908
- scrollbarProps: PropTypes.shape({
1909
- ...CustomScrollbar.propTypes
1910
- }),
1911
- /*
1912
- * When disableTransform is true and containerParent has ref.current, the popover generates in a dropdown wrapper instead of closing the body tag, and the position will not calculate.
1913
- */
1914
- disableTransform: PropTypes.bool,
1915
- /*
1916
- * Provide an HTML element ref here to have your popover content appended to that element rather than document.body. This is useful if you'd like your popover to sit at a particular place within the DOM.
1917
- */
1918
- containerParent: PropTypes.object
1919
- };
1920
- PopoverV2.defaultProps = {
1921
- cornerRadius: popoverV2Config.cornerRadius[0],
1922
- position: popoverV2Config.position,
1923
- align: popoverV2Config.align[0],
1924
- toggleHandler: noop,
1925
- behave: popoverV2Config.behave[0],
1926
- extendTargetWidth: true,
1927
- disableReposition: true,
1928
- disableTransform: false,
1929
- minHeight: 0,
1930
- maxHeight: 510,
1931
- padding: 10,
1932
- getScrollRef: noop,
1933
- scrollbarNeeded: true,
1934
- swipeable: false,
1935
- onSwipedDown: noop,
1936
- onClickOutside: noop,
1937
- nativeOutsideClick: noop
1938
- };
1939
-
1940
- export { PopoverV2 as P, jsxRuntimeExports as j };