@geneui/components 3.0.0-next-9ffcb93-16102024 → 3.0.0-next-48d0ef7-31102024

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 (248) hide show
  1. package/Avatar.js +63 -0
  2. package/CHANGELOG.md +7 -0
  3. package/Divider.js +23 -0
  4. package/{GeneUIProvider/index.js → GeneUIProvider.js} +52 -65
  5. package/HelperText.js +69 -0
  6. package/Info.js +64 -0
  7. package/Label.js +38 -0
  8. package/Loader.js +21 -0
  9. package/Pill.js +64 -0
  10. package/TextLink.js +20 -0
  11. package/{index-65217440.js → Tooltip.js} +104 -80
  12. package/{lib → components}/atoms/Avatar/Avatar.d.ts +7 -6
  13. package/components/atoms/Avatar/index.d.ts +1 -0
  14. package/{lib → components}/atoms/Divider/Divider.d.ts +5 -5
  15. package/components/atoms/Divider/index.d.ts +1 -0
  16. package/{lib → components}/atoms/HelperText/HelperText.d.ts +6 -5
  17. package/components/atoms/HelperText/index.d.ts +1 -0
  18. package/{lib → components}/atoms/Info/Info.d.ts +5 -5
  19. package/components/atoms/Info/index.d.ts +1 -0
  20. package/{lib → components}/atoms/Label/Label.d.ts +3 -3
  21. package/components/atoms/Label/index.d.ts +1 -0
  22. package/{lib → components}/atoms/Loader/Loader.d.ts +5 -5
  23. package/components/atoms/Loader/index.d.ts +1 -0
  24. package/{lib → components}/atoms/Pill/Pill.d.ts +7 -6
  25. package/components/atoms/Pill/index.d.ts +1 -0
  26. package/{lib → components}/atoms/TextLink/TextLink.d.ts +5 -5
  27. package/components/atoms/TextLink/index.d.ts +1 -0
  28. package/{lib → components}/molecules/Tooltip/Tooltip.d.ts +26 -21
  29. package/components/molecules/Tooltip/index.d.ts +1 -0
  30. package/components/providers/GeneUIProvider/GeneUIProvider.d.ts +30 -0
  31. package/components/providers/GeneUIProvider/index.d.ts +1 -0
  32. package/hooks/index.d.ts +2 -20
  33. package/hooks/useDebounceCallback/index.d.ts +1 -0
  34. package/hooks/useDebounceCallback/useDebounceCallback.d.ts +2 -0
  35. package/hooks/useEllipsisDetection/index.d.ts +1 -1
  36. package/hooks/useEllipsisDetection/useEllipsisDetection.d.ts +2 -2
  37. package/{index-031ff73c.js → index-ce02421b.js} +4 -4
  38. package/index.d.ts +11 -121
  39. package/index.js +12 -159
  40. package/package.json +24 -43
  41. package/tokens-0abb4e1b.js +6 -0
  42. package/types/index.d.ts +0 -3
  43. package/useEllipsisDetection-46d712b6.js +34 -0
  44. package/ActionableList/index.js +0 -1694
  45. package/AdvancedSearch/index.js +0 -892
  46. package/Alert/index.js +0 -98
  47. package/Avatar/index.js +0 -58
  48. package/Badge/index.js +0 -29
  49. package/Breadcrumb/index.js +0 -130
  50. package/BusyLoader/index.js +0 -31
  51. package/Button/index.js +0 -30
  52. package/Card/index.js +0 -502
  53. package/CardList/index.js +0 -662
  54. package/CellMeasurerCache-80be385d.js +0 -229
  55. package/Charts/index.js +0 -17662
  56. package/Checkbox/index.js +0 -229
  57. package/CheckboxGroup/index.js +0 -203
  58. package/CheckboxGroupWithSearch/index.js +0 -280
  59. package/Collapse/index.js +0 -195
  60. package/ColorPicker/index.js +0 -210
  61. package/ComboBox/index.js +0 -524
  62. package/Copy/index.js +0 -56
  63. package/Counter/index.js +0 -312
  64. package/DateFilter/index.js +0 -183
  65. package/DatePicker/index.js +0 -1229
  66. package/DatePickerInput/index.js +0 -883
  67. package/Divider/index.js +0 -23
  68. package/Drawer/index.js +0 -261
  69. package/Dropdown/index.js +0 -43
  70. package/Editor/index.js +0 -22975
  71. package/Empty/index.js +0 -76
  72. package/ExtendedInput/index.js +0 -590
  73. package/Form/index.js +0 -85
  74. package/FormContainer/index.js +0 -189
  75. package/FormableCheckbox/index.js +0 -24
  76. package/FormableDatePicker/index.js +0 -43
  77. package/FormableDropdown/index.js +0 -50
  78. package/FormableEditor/index.js +0 -26
  79. package/FormableHOC-85f89a81.js +0 -83
  80. package/FormableMultiSelectDropdown/index.js +0 -50
  81. package/FormableNumberInput/index.js +0 -34
  82. package/FormableRadio/index.js +0 -22
  83. package/FormableSwitcher/index.js +0 -22
  84. package/FormableTextInput/index.js +0 -34
  85. package/FormableUploader/index.js +0 -44
  86. package/Grid/index.js +0 -167
  87. package/HelperText/index.js +0 -86
  88. package/Holder/index.js +0 -261
  89. package/Icon/index.js +0 -62
  90. package/Image/index.js +0 -45
  91. package/ImagePreview/index.js +0 -217
  92. package/Info/index.js +0 -41
  93. package/InfoOutline-dd2e89d9.js +0 -29
  94. package/InteractiveWidget/index.js +0 -78
  95. package/KeyValue/index.js +0 -22
  96. package/Label/index.js +0 -48
  97. package/LinkButton/index.js +0 -34
  98. package/Loader/index.js +0 -23
  99. package/Menu/index.js +0 -281
  100. package/MobileNavigation/index.js +0 -94
  101. package/MobilePopup/index.js +0 -182
  102. package/Modal/index.js +0 -251
  103. package/ModuleTitle/index.js +0 -141
  104. package/NavigationMenu/index.js +0 -222
  105. package/Notification/index.js +0 -120
  106. package/Option/index.js +0 -184
  107. package/Overlay/index.js +0 -187
  108. package/Overspread/index.js +0 -291
  109. package/Pagination/index.js +0 -261
  110. package/Paper/index.js +0 -96
  111. package/Pill/index.js +0 -67
  112. package/Popover/index.js +0 -725
  113. package/PopoverV2/index.js +0 -19
  114. package/Portal/index.js +0 -58
  115. package/Products/index.js +0 -115
  116. package/Profile/index.js +0 -589
  117. package/Progress/index.js +0 -200
  118. package/QRCode/index.js +0 -814
  119. package/Radio/index.js +0 -151
  120. package/RadioGroup/index.js +0 -104
  121. package/Range/index.js +0 -191
  122. package/Rating/index.js +0 -174
  123. package/RichEditor/index.js +0 -13
  124. package/RichEditor-78c2617e.js +0 -228
  125. package/Scrollbar/index.js +0 -1585
  126. package/Search/index.js +0 -75
  127. package/SearchWithDropdown/index.js +0 -140
  128. package/Section/index.js +0 -61
  129. package/SkeletonLoader/index.js +0 -81
  130. package/Slider/index.js +0 -261
  131. package/Status/index.js +0 -97
  132. package/Steps/index.js +0 -314
  133. package/SuggestionList/index.js +0 -385
  134. package/Switcher/index.js +0 -193
  135. package/Table/index.js +0 -57
  136. package/TableCompositions/index.js +0 -16995
  137. package/Tabs/index.js +0 -235
  138. package/Tag/index.js +0 -102
  139. package/TextLink/index.js +0 -20
  140. package/Textarea/index.js +0 -242
  141. package/Time/index.js +0 -62
  142. package/TimePicker/index.js +0 -575
  143. package/Timeline/index.js +0 -113
  144. package/Title/index.js +0 -65
  145. package/Toaster/index.js +0 -116
  146. package/Tooltip/index.js +0 -6
  147. package/TransferList/index.js +0 -493
  148. package/Uploader/index.js +0 -992
  149. package/ValidatableCheckbox/index.js +0 -123
  150. package/ValidatableDatePicker/index.js +0 -316
  151. package/ValidatableDropdown/index.js +0 -141
  152. package/ValidatableElements/index.js +0 -67
  153. package/ValidatableMultiSelectDropdown/index.js +0 -152
  154. package/ValidatableNumberInput/index.js +0 -204
  155. package/ValidatableRadio/index.js +0 -116
  156. package/ValidatableSwitcher/index.js +0 -93
  157. package/ValidatableTextInput/index.js +0 -167
  158. package/ValidatableTimeInput/index.js +0 -174
  159. package/ValidatableUploader/index.js +0 -98
  160. package/Widget/index.js +0 -225
  161. package/_commonjsHelpers-24198af3.js +0 -35
  162. package/_rollupPluginBabelHelpers-a83240e1.js +0 -11
  163. package/callAfterDelay-7272faca.js +0 -12
  164. package/checkTimeValidation-e56771be.js +0 -16
  165. package/checkboxRadioSwitcher-5b69d7bd.js +0 -4
  166. package/clsx.m-2bb6df4b.js +0 -3
  167. package/config-1053d64d.js +0 -20
  168. package/configs-00612ce0.js +0 -103
  169. package/configs.js +0 -111
  170. package/dateValidation-67caec66.js +0 -225
  171. package/debounce-4419bc2f.js +0 -17
  172. package/guid-8ddf77b3.js +0 -16
  173. package/hooks/useBodyScroll.js +0 -16
  174. package/hooks/useClick.js +0 -18
  175. package/hooks/useClickOutside.js +0 -25
  176. package/hooks/useDebounce.js +0 -28
  177. package/hooks/useDeviceType.js +0 -17
  178. package/hooks/useDidMount.js +0 -15
  179. package/hooks/useForceUpdate.js +0 -8
  180. package/hooks/useHover.js +0 -20
  181. package/hooks/useImgDownload.js +0 -18
  182. package/hooks/useKeyDown.js +0 -21
  183. package/hooks/useMount.js +0 -13
  184. package/hooks/useMutationObserver.js +0 -21
  185. package/hooks/usePrevious.js +0 -10
  186. package/hooks/useThrottle.js +0 -16
  187. package/hooks/useToggle.js +0 -11
  188. package/hooks/useUpdatableRef.js +0 -14
  189. package/hooks/useUpdate.js +0 -10
  190. package/hooks/useWidth.js +0 -16
  191. package/hooks/useWindowSize.js +0 -40
  192. package/index-122432cd.js +0 -270
  193. package/index-262edd7a.js +0 -77
  194. package/index-2f5aa51e.js +0 -6483
  195. package/index-370f9acd.js +0 -4
  196. package/index-45eafea6.js +0 -90
  197. package/index-480fd7d9.js +0 -10032
  198. package/index-5f37f281.js +0 -168
  199. package/index-73aaa093.js +0 -1940
  200. package/index.mobile.d.ts +0 -14
  201. package/lib/atoms/Avatar/index.d.ts +0 -1
  202. package/lib/atoms/Badge/Badge.d.ts +0 -36
  203. package/lib/atoms/Badge/index.d.ts +0 -1
  204. package/lib/atoms/BusyLoader/BusyLoader.d.ts +0 -32
  205. package/lib/atoms/BusyLoader/BusyLoaderHolderHOC.d.ts +0 -8
  206. package/lib/atoms/BusyLoader/index.d.ts +0 -1
  207. package/lib/atoms/Button/Button.d.ts +0 -70
  208. package/lib/atoms/Button/index.d.ts +0 -1
  209. package/lib/atoms/Divider/index.d.ts +0 -1
  210. package/lib/atoms/Empty/Empty.d.ts +0 -39
  211. package/lib/atoms/Empty/index.d.ts +0 -1
  212. package/lib/atoms/Empty/utils.d.ts +0 -9
  213. package/lib/atoms/HelperText/index.d.ts +0 -1
  214. package/lib/atoms/Image/Image.d.ts +0 -51
  215. package/lib/atoms/Image/index.d.ts +0 -1
  216. package/lib/atoms/ImagePreview/ImagePreview.d.ts +0 -56
  217. package/lib/atoms/ImagePreview/ImagePreviewHOC.d.ts +0 -4
  218. package/lib/atoms/ImagePreview/Magnifier.d.ts +0 -40
  219. package/lib/atoms/ImagePreview/index.d.ts +0 -1
  220. package/lib/atoms/Info/index.d.ts +0 -1
  221. package/lib/atoms/KeyValue/KeyValue.d.ts +0 -29
  222. package/lib/atoms/KeyValue/index.d.ts +0 -1
  223. package/lib/atoms/Label/index.d.ts +0 -1
  224. package/lib/atoms/LinkButton/LinkButton.d.ts +0 -46
  225. package/lib/atoms/LinkButton/index.d.ts +0 -1
  226. package/lib/atoms/Loader/index.d.ts +0 -1
  227. package/lib/atoms/Pill/index.d.ts +0 -1
  228. package/lib/atoms/Rating/DefaultSvg.d.ts +0 -3
  229. package/lib/atoms/Rating/Rating.d.ts +0 -49
  230. package/lib/atoms/Rating/index.d.ts +0 -1
  231. package/lib/atoms/TextLink/index.d.ts +0 -1
  232. package/lib/molecules/Copy/Copy.d.ts +0 -38
  233. package/lib/molecules/Copy/index.d.ts +0 -1
  234. package/lib/molecules/InteractiveWidget/InteractiveWidget.d.ts +0 -70
  235. package/lib/molecules/InteractiveWidget/InteractiveWidgetIcon.d.ts +0 -8
  236. package/lib/molecules/InteractiveWidget/index.d.ts +0 -1
  237. package/lib/molecules/Tooltip/index.d.ts +0 -1
  238. package/lib/providers/GeneUIProvider/GeneUIProvider.d.ts +0 -30
  239. package/lib/providers/GeneUIProvider/index.d.ts +0 -1
  240. package/localization-4ba17032.js +0 -46
  241. package/objectWithoutPropertiesLoose-e1596bdb.js +0 -62
  242. package/rangeAndSlider-693a3d41.js +0 -8684
  243. package/react-beautiful-dnd.esm-b637016a.js +0 -10116
  244. package/react-lifecycles-compat.es-6e1f3768.js +0 -158
  245. package/redux-e591c1b8.js +0 -536
  246. package/tokens-8ab1179c.js +0 -6
  247. package/tslib.es6-f211516f.js +0 -35
  248. package/useEllipsisDetection-c1c9ad94.js +0 -38
@@ -1,291 +0,0 @@
1
- import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
2
- import React__default, { useState, useRef, useEffect, useCallback } from 'react';
3
- import PropTypes from 'prop-types';
4
- import { n as noop } from '../index-5f37f281.js';
5
- import '../configs-00612ce0.js';
6
- import useClickOutside from '../hooks/useClickOutside.js';
7
- import Icon from '../Icon/index.js';
8
- import Portal from '../Portal/index.js';
9
- import Popover from '../Popover/index.js';
10
- import Menu from '../Menu/index.js';
11
- import { D as Dropdown } from '../index-480fd7d9.js';
12
- import { s as styleInject } from '../style-inject.es-746bb8ed.js';
13
- import '../dateValidation-67caec66.js';
14
- import '../_commonjsHelpers-24198af3.js';
15
- import 'react-dom';
16
- import '../index-031ff73c.js';
17
- import '../GeneUIProvider/index.js';
18
- import '../index-122432cd.js';
19
- import '../hooks/useDeviceType.js';
20
- import '../hooks/useWindowSize.js';
21
- import '../hooks/useDebounce.js';
22
- import '../hooks/useUpdatableRef.js';
23
- import '../hooks/useForceUpdate.js';
24
- import '../Scrollbar/index.js';
25
- import '../guid-8ddf77b3.js';
26
- import '../Option/index.js';
27
- import '../useEllipsisDetection-c1c9ad94.js';
28
- import '../index-65217440.js';
29
- import '../tslib.es6-f211516f.js';
30
- import '../objectWithoutPropertiesLoose-e1596bdb.js';
31
- import '../react-lifecycles-compat.es-6e1f3768.js';
32
- import '../clsx.m-2bb6df4b.js';
33
- import '../hooks/useMount.js';
34
- import '../hooks/useClick.js';
35
- import '../hooks/useKeyDown.js';
36
- import '../BusyLoader/index.js';
37
- import '../Empty/index.js';
38
- import '../index-73aaa093.js';
39
- import '../debounce-4419bc2f.js';
40
- import '../ExtendedInput/index.js';
41
- import '../SuggestionList/index.js';
42
- import '../config-1053d64d.js';
43
- import '../callAfterDelay-7272faca.js';
44
- import '../Checkbox/index.js';
45
- import '../checkboxRadioSwitcher-5b69d7bd.js';
46
- import '../index-370f9acd.js';
47
- import '../Tag/index.js';
48
-
49
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .overspread-container{height:100%;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:300}[data-gene-ui-version=\"2.16.3\"] .overspread-holder{animation:overspread-reveal .5s forwards;background:var(--background);display:grid;grid-template-columns:100%;grid-template-rows:auto 1fr;height:100%;transform:translate3d(0,100%,0);width:100%}@keyframes overspread-reveal{to{transform:translateZ(0)}}[data-gene-ui-version=\"2.16.3\"] .overspread-head{border-bottom:1px solid rgba(var(--background-sc-rgb),.05);display:grid;grid-template-areas:\"left center right\";grid-template-columns:1fr auto 1fr;padding:0 1rem;position:relative;width:100%}[data-gene-ui-version=\"2.16.3\"] .overspread-head>li{align-items:center;display:flex;height:4.6rem;overflow:hidden}[data-gene-ui-version=\"2.16.3\"] .overspread-head>li.over-h-act{font:600 1.5rem/2.3rem var(--font-family);grid-area:left;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;width:100%}[data-gene-ui-version=\"2.16.3\"] .overspread-head>li.over-h-act:last-child{grid-area:right;justify-content:flex-end}[data-gene-ui-version=\"2.16.3\"] .overspread-head>li.over-h-tt{font:600 1.7rem/2.3rem var(--font-family);grid-area:center}[data-gene-ui-version=\"2.16.3\"] .overspread-head>li>*{margin:0 .5rem}[data-gene-ui-version=\"2.16.3\"] .overspread-head>li .color-hero{color:var(--hero)}[data-gene-ui-version=\"2.16.3\"] .overspread-head button{transition:opacity .4s}[data-gene-ui-version=\"2.16.3\"] .overspread-head button:disabled{opacity:.5;pointer-events:none}[data-gene-ui-version=\"2.16.3\"] .overspread-body{-webkit-overflow-scrolling:touch;overflow-y:auto;padding:1.5rem}[data-gene-ui-version=\"2.16.3\"] .overspread-search{position:relative}[data-gene-ui-version=\"2.16.3\"] .overspread-search:not(:focus-within,.show-search) input{height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}[data-gene-ui-version=\"2.16.3\"] .overspread-search:not(:focus-within,.show-search) .bc-icon-search{pointer-events:none}[data-gene-ui-version=\"2.16.3\"] .overspread-search:not(:focus-within,.show-search) .bc-icon-close{display:none}[data-gene-ui-version=\"2.16.3\"] .overspread-search.show-search,[data-gene-ui-version=\"2.16.3\"] .overspread-search:focus-within{background:var(--background);display:flex;left:0;margin:0;padding:0 1rem;position:absolute;top:50%;transform:translateY(-50%);width:100%;z-index:10}[data-gene-ui-version=\"2.16.3\"] .overspread-search.show-search>*,[data-gene-ui-version=\"2.16.3\"] .overspread-search:focus-within>*{padding:0 .5rem}[data-gene-ui-version=\"2.16.3\"] .overspread-search.show-search .bc-icon-search,[data-gene-ui-version=\"2.16.3\"] .overspread-search:focus-within .bc-icon-search{display:none}[data-gene-ui-version=\"2.16.3\"] .overspread-search.show-search input,[data-gene-ui-version=\"2.16.3\"] .overspread-search:focus-within input{font:600 1.4rem var(--font-family);height:2.4rem;width:100%}[data-gene-ui-version=\"2.16.3\"] .overspread-search.show-search input::input-placeholder,[data-gene-ui-version=\"2.16.3\"] .overspread-search:focus-within input::input-placeholder{color:rgba(var(--background-sc-rgb),.5);font-size:1.4rem;font-weight:600}[data-gene-ui-version=\"2.16.3\"] .overspread-search.show-search input:placeholder,[data-gene-ui-version=\"2.16.3\"] .overspread-search:focus-within input:placeholder{color:rgba(var(--background-sc-rgb),.5);font-size:1.4rem;font-weight:600}[data-gene-ui-version=\"2.16.3\"] .overspread-search.show-search input::placeholder,[data-gene-ui-version=\"2.16.3\"] .overspread-search:focus-within input::placeholder{color:rgba(var(--background-sc-rgb),.5);font-size:1.4rem;font-weight:600}[data-gene-ui-version=\"2.16.3\"] .overspread-search.show-search input:input-placeholder,[data-gene-ui-version=\"2.16.3\"] .overspread-search:focus-within input:input-placeholder{color:rgba(var(--background-sc-rgb),.5);font-size:1.4rem;font-weight:600}[data-gene-ui-version=\"2.16.3\"] .back-button-holder{align-items:center;cursor:pointer;display:flex}";
50
- styleInject(css_248z);
51
-
52
- function Overspread(props) {
53
- const {
54
- opened,
55
- title,
56
- hasDone,
57
- disabledDone,
58
- children,
59
- hasSearch,
60
- hasOptions,
61
- titleHasOptions,
62
- searchOutput,
63
- hasBack,
64
- doneText,
65
- backWithIcon,
66
- backText,
67
- doneWithIcon,
68
- onClose,
69
- onDone,
70
- onBack,
71
- onSelectingOption,
72
- onSelectingTitleOption,
73
- dataForOptions,
74
- dataForTitleWithOptions,
75
- defaultValueForTitleWithOptions,
76
- onAnimationEnd,
77
- ...restProps
78
- } = props;
79
- const isControlled = ('opened' in props);
80
- const [isOpen, setIsOpen] = useState(opened);
81
- const [optionsPopoverIsOpen, setOptionsPopoverIsOpen] = useState(false);
82
- const portalRef = useRef(null);
83
- useEffect(() => setIsOpen(opened), [opened]);
84
- const handleSearchOutput = useCallback(e => {
85
- searchOutput && searchOutput(e.target.value);
86
- }, [searchOutput]);
87
- const handleClose = useCallback(e => {
88
- !isControlled && setIsOpen(isOpen => !isOpen);
89
- onClose && onClose(e);
90
- }, [onClose, isControlled]);
91
- const handleDone = useCallback(e => {
92
- !isControlled && setIsOpen(isOpen => !isOpen);
93
- onDone && onDone(e);
94
- }, [onDone, isControlled]);
95
- const outsideClickHandler = useCallback(() => {
96
- setOptionsPopoverIsOpen(false);
97
- }, []);
98
- const outsideClickRef = useClickOutside(outsideClickHandler);
99
- const onAnimationEndHandler = useCallback(() => {
100
- onAnimationEnd && onAnimationEnd();
101
- }, [onAnimationEnd]);
102
- useEffect(() => {
103
- var _portalRef$current;
104
- portalRef === null || portalRef === void 0 ? void 0 : (_portalRef$current = portalRef.current) === null || _portalRef$current === void 0 ? void 0 : _portalRef$current.addEventListener('animationend', onAnimationEndHandler);
105
- }, [portalRef.current, isOpen]);
106
- const cleanup = () => {
107
- var _portalRef$current2;
108
- portalRef === null || portalRef === void 0 ? void 0 : (_portalRef$current2 = portalRef.current) === null || _portalRef$current2 === void 0 ? void 0 : _portalRef$current2.removeEventListener('animationend', onAnimationEndHandler);
109
- };
110
- useEffect(() => cleanup, []);
111
- return /*#__PURE__*/React__default.createElement(Portal, {
112
- isOpen: isOpen
113
- }, /*#__PURE__*/React__default.createElement("div", _extends({
114
- className: "overspread-container"
115
- }, restProps), /*#__PURE__*/React__default.createElement("div", {
116
- className: "overspread-holder",
117
- ref: portalRef
118
- }, /*#__PURE__*/React__default.createElement("ul", {
119
- className: "overspread-head"
120
- }, /*#__PURE__*/React__default.createElement("li", {
121
- className: "over-h-act"
122
- }, hasBack ? /*#__PURE__*/React__default.createElement("p", {
123
- onClick: onBack,
124
- className: "back-button-holder cursor-pointer"
125
- }, backWithIcon && /*#__PURE__*/React__default.createElement(Icon, {
126
- type: "bc-icon-arrow-left"
127
- }), /*#__PURE__*/React__default.createElement("span", null, backText)) : /*#__PURE__*/React__default.createElement(Icon, {
128
- type: "bc-icon-close",
129
- onClick: handleClose,
130
- className: "cursor-pointer"
131
- })), /*#__PURE__*/React__default.createElement("li", {
132
- className: "over-h-tt"
133
- }, titleHasOptions ? /*#__PURE__*/React__default.createElement(Dropdown, {
134
- hasSearch: false,
135
- value: defaultValueForTitleWithOptions.value,
136
- data: dataForTitleWithOptions,
137
- placeholder: " ",
138
- appearance: "light",
139
- onChange: onSelectingTitleOption,
140
- flexibility: "content-size"
141
- }) : /*#__PURE__*/React__default.createElement("p", {
142
- className: "ellipsis-text"
143
- }, title)), /*#__PURE__*/React__default.createElement("li", {
144
- className: "over-h-act"
145
- }, hasSearch && /*#__PURE__*/React__default.createElement("div", {
146
- className: "overspread-search cursor-pointer"
147
- }, /*#__PURE__*/React__default.createElement(Icon, {
148
- type: "bc-icon-close"
149
- }), /*#__PURE__*/React__default.createElement("input", {
150
- onChange: handleSearchOutput,
151
- placeholder: "Search"
152
- }), /*#__PURE__*/React__default.createElement(Icon, {
153
- type: "bc-icon-search"
154
- })), hasOptions && /*#__PURE__*/React__default.createElement(Popover, {
155
- isOpen: optionsPopoverIsOpen,
156
- extendTargetWidth: false,
157
- Content: /*#__PURE__*/React__default.createElement(Menu, {
158
- ref: outsideClickRef,
159
- data: dataForOptions,
160
- onSelect: function () {
161
- setOptionsPopoverIsOpen(false);
162
- onSelectingOption(...arguments);
163
- }
164
- }),
165
- align: "end"
166
- }, /*#__PURE__*/React__default.createElement(Icon, {
167
- type: "bc-icon-more-vertical",
168
- onClick: () => setOptionsPopoverIsOpen(true)
169
- })), hasDone && /*#__PURE__*/React__default.createElement("button", {
170
- disabled: disabledDone,
171
- onClick: handleDone,
172
- className: "color-hero cursor-pointer"
173
- }, doneWithIcon ? /*#__PURE__*/React__default.createElement(Icon, {
174
- type: "bc-icon-checkbox-checked"
175
- }) : doneText))), children && /*#__PURE__*/React__default.createElement("div", {
176
- className: "overspread-body"
177
- }, children))));
178
- }
179
- Overspread.propTypes = {
180
- title: PropTypes.string,
181
- /**
182
- * Enables title's dropdown,
183
- */
184
- titleHasOptions: PropTypes.bool,
185
- /**
186
- * Fires event for handling change of value/selected option
187
- * ((event: Event) => void)
188
- */
189
- onSelectingTitleOption: PropTypes.func,
190
- /**
191
- * Title's dropdown data
192
- */
193
- dataForTitleWithOptions: PropTypes.array,
194
- /**
195
- * Default value for title's dropdown
196
- */
197
- defaultValueForTitleWithOptions: PropTypes.object,
198
- /**
199
- * Enables search,
200
- */
201
- hasSearch: PropTypes.bool,
202
- /**
203
- * Fires event when user types in search field
204
- * (event: Event) => void
205
- */
206
- searchOutput: PropTypes.func,
207
- /**
208
- * Displays dropdown on the right corner,
209
- */
210
- hasOptions: PropTypes.bool,
211
- /**
212
- * Right corner dropdown's data
213
- */
214
- dataForOptions: PropTypes.array,
215
- /**
216
- * Fires event for handling change of value/selected option
217
- * ((event: Event) => void)
218
- */
219
- onSelectingOption: PropTypes.func,
220
- /** Opened state */
221
- opened: PropTypes.bool,
222
- /**
223
- * Any valid node
224
- */
225
- children: PropTypes.node,
226
- /**
227
- * Enables done button on the right corner,
228
- */
229
- hasDone: PropTypes.bool,
230
- /**
231
- * Shows done icon instead of text
232
- */
233
- doneWithIcon: PropTypes.bool,
234
- /**
235
- * Done button disabled state
236
- */
237
- disabledDone: PropTypes.bool,
238
- /**
239
- * Custom text for done button
240
- */
241
- doneText: PropTypes.string,
242
- /**
243
- * Fires event when done button is clicked
244
- * ((event: Event) => void)
245
- */
246
- onDone: PropTypes.func,
247
- /**
248
- * Enables back button on the left corner,
249
- */
250
- hasBack: PropTypes.bool,
251
- /**
252
- * Custom text for back button
253
- */
254
- backText: PropTypes.string,
255
- /**
256
- * Displays chevron icon in back button
257
- */
258
- backWithIcon: PropTypes.bool,
259
- /**
260
- * Fires event when back button is clicked
261
- * ((event: Event) => void)
262
- */
263
- onBack: PropTypes.func,
264
- /**
265
- * Fires event when close icon is clicked
266
- * ((event: Event) => void)
267
- */
268
- onClose: PropTypes.func,
269
- /**
270
- * Function calls when the animation ends.
271
- */
272
- onAnimationEnd: PropTypes.func
273
- };
274
- Overspread.defaultProps = {
275
- hasSearch: false,
276
- hasBack: false,
277
- hasOptions: false,
278
- doneText: 'Done',
279
- titleHasOptions: false,
280
- backWithIcon: false,
281
- doneWithIcon: false,
282
- hasDone: true,
283
- onDone: noop,
284
- onBack: noop,
285
- onClose: noop,
286
- onSelectingOption: noop,
287
- onSelectingTitleOption: noop,
288
- onAnimationEnd: noop
289
- };
290
-
291
- export { Overspread as default };
@@ -1,261 +0,0 @@
1
- import React__default, { useState, useCallback } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { c as classnames } from '../index-031ff73c.js';
4
- import { a as conflictPropsLog, k as keyboardHandler } from '../index-5f37f281.js';
5
- import Button from '../Button/index.js';
6
- import Divider from '../Divider/index.js';
7
- import { T as Tooltip } from '../index-65217440.js';
8
- import TextInput from '../ValidatableTextInput/index.js';
9
- import { s as styleInject } from '../style-inject.es-746bb8ed.js';
10
- import '../dateValidation-67caec66.js';
11
- import '../_commonjsHelpers-24198af3.js';
12
- import 'react-dom';
13
- import '../tslib.es6-f211516f.js';
14
- import '../Icon/index.js';
15
- import '../_rollupPluginBabelHelpers-a83240e1.js';
16
- import '../GeneUIProvider/index.js';
17
- import '../hooks/useMount.js';
18
- import '../configs-00612ce0.js';
19
- import '../ExtendedInput/index.js';
20
- import '../hooks/useDeviceType.js';
21
- import '../hooks/useWindowSize.js';
22
- import '../hooks/useDebounce.js';
23
- import '../useEllipsisDetection-c1c9ad94.js';
24
- import '../SuggestionList/index.js';
25
- import '../hooks/useKeyDown.js';
26
- import '../hooks/useClickOutside.js';
27
- import '../config-1053d64d.js';
28
- import '../Scrollbar/index.js';
29
- import '../callAfterDelay-7272faca.js';
30
-
31
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .pagination-holder{align-items:center;display:flex}[data-gene-ui-version=\"2.16.3\"] .pagination-holder .icon{cursor:pointer}[data-gene-ui-version=\"2.16.3\"] .pagination-holder .defaultCursor{cursor:default}[data-gene-ui-version=\"2.16.3\"] .pagination-holder .input-element{text-align:center}";
32
- styleInject(css_248z);
33
-
34
- const drawCount = 5;
35
- const offset = 2;
36
- const enterCode = 13;
37
- const diff = drawCount - offset;
38
- const numberRegExp = /^[1-9][0-9]*$/;
39
- function Pagination(props) {
40
- const {
41
- count: propCount,
42
- selected,
43
- onChange,
44
- errorText,
45
- defaultSelected,
46
- supportedKeyCodes,
47
- autoFocus,
48
- nextIconTooltipText,
49
- previousIconTooltipText
50
- } = props;
51
- selected && defaultSelected && conflictPropsLog('Pagination', ['selected', 'defaultSelected']);
52
- const [page, setPage] = useState(selected || defaultSelected || 1);
53
- const [isValid, setIsValid] = useState(true);
54
- const [inputValue, setInputValue] = useState('');
55
- const current = selected || page;
56
- const count = propCount === 0 ? current : propCount;
57
- const isLeftIconDisabled = current === 1;
58
- const isRightIconDisabled = current === count;
59
- const canShowDots = count > drawCount;
60
- const areLeftDotsVisible = canShowDots && current > diff;
61
- const areRightDotsVisible = canShowDots && current + diff <= count;
62
- const setSelected = useCallback(nextSelected => {
63
- if (nextSelected) {
64
- !selected && setPage(nextSelected);
65
- onChange && onChange(nextSelected);
66
- }
67
- }, [selected, onChange]);
68
-
69
- // button handlers
70
- const onClick = useCallback(e => {
71
- setSelected(Number(e.currentTarget.dataset.key));
72
- setInputValue('');
73
- setIsValid(true);
74
- }, [setSelected]);
75
- const validate = useCallback(value => {
76
- const allowedDigitsCount = String(count).length;
77
- const checkingValue = value.length > allowedDigitsCount ? value.substring(0, allowedDigitsCount) : value;
78
- const number = Number(checkingValue);
79
- if (isNaN(number)) return true;
80
- return !number || number <= count && number >= 1;
81
- }, [count]);
82
-
83
- // input handlers
84
- const onInputChange = useCallback(e => {
85
- setIsValid(validate(e.target.value));
86
- const {
87
- value = ''
88
- } = e.target;
89
- if (!value || numberRegExp.test(value) && value.length <= String(count).length) {
90
- setInputValue(value);
91
- }
92
- }, [count, validate]);
93
- const onBlur = useCallback(e => {
94
- if (isValid) {
95
- setSelected(Number(e.target.value));
96
- setInputValue('');
97
- }
98
- }, [isValid, setSelected]);
99
- const onInputKeyPress = useCallback(e => {
100
- if (isValid && keyboardHandler(e, supportedKeyCodes)) {
101
- setSelected(Number(e.target.value));
102
- setInputValue('');
103
- }
104
- }, [isValid, setSelected, supportedKeyCodes]);
105
-
106
- // icon handlers
107
- const onLeftClick = useCallback(e => {
108
- if (current > 1) {
109
- setSelected(current - 1);
110
- setInputValue('');
111
- setIsValid(true);
112
- }
113
- }, [current, setSelected]);
114
- const onRightClick = useCallback(e => {
115
- if (current < count) {
116
- setSelected(current + 1);
117
- setInputValue('');
118
- setIsValid(true);
119
- }
120
- }, [count, current, setSelected]);
121
- const leftButtons = [1];
122
- const rightButtons = count > 1 ? [count] : [];
123
- let centerButtons = [];
124
- if (count > offset) {
125
- if (count - offset > diff) {
126
- const customPage = current < diff ? diff : current + diff > count ? count - offset : current;
127
- centerButtons = [customPage - 1, customPage, customPage + 1];
128
- } else {
129
- for (let i = offset; i < count; i++) {
130
- centerButtons.push(i);
131
- }
132
- }
133
- }
134
- const dotedButton = () => /*#__PURE__*/React__default.createElement(Button, {
135
- flexibility: "content-size",
136
- color: "default",
137
- appearance: "minimal",
138
- className: "pointer-events-none"
139
- }, "...");
140
- const Input = /*#__PURE__*/React__default.createElement(Tooltip, {
141
- alwaysShow: !isValid,
142
- title: isValid ? '' : errorText,
143
- padding: 25
144
- }, /*#__PURE__*/React__default.createElement(TextInput, {
145
- min: 1,
146
- forceAllowValidation: true,
147
- autoFocus: autoFocus,
148
- max: count,
149
- type: "text",
150
- onBlur: onBlur,
151
- value: inputValue,
152
- colorBorderOnError: true,
153
- showErrorIcon: false,
154
- showNumberIcon: false,
155
- onChange: onInputChange,
156
- flexibility: "content-size",
157
- placeholder: "1-".concat(count),
158
- isValid: isValid,
159
- onKeyPress: onInputKeyPress,
160
- showClickableTooltipOnError: false,
161
- className: classnames('number-input')
162
- }));
163
- return /*#__PURE__*/React__default.createElement("div", {
164
- className: "pagination-holder"
165
- }, /*#__PURE__*/React__default.createElement(Tooltip, {
166
- title: previousIconTooltipText
167
- }, /*#__PURE__*/React__default.createElement(Button, {
168
- flexibility: "content-size",
169
- color: "default",
170
- appearance: "minimal",
171
- icon: "bc-icon-arrow-left-nav",
172
- onClick: onLeftClick,
173
- disabled: isLeftIconDisabled
174
- })), /*#__PURE__*/React__default.createElement(Divider, {
175
- type: "vertical"
176
- }), leftButtons.map(number => /*#__PURE__*/React__default.createElement(Button, {
177
- key: number,
178
- flexibility: "content-size",
179
- color: "default",
180
- appearance: "minimal",
181
- onClick: number !== current ? onClick : undefined,
182
- "data-key": number,
183
- className: classnames(number === current && 'defaultCursor'),
184
- active: number === current
185
- }, number)), areLeftDotsVisible ? areRightDotsVisible ? dotedButton() : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, dotedButton(), Input, dotedButton()) : null, centerButtons.map(number => /*#__PURE__*/React__default.createElement(Button, {
186
- key: number,
187
- flexibility: "content-size",
188
- color: "default",
189
- appearance: "minimal",
190
- onClick: number !== current ? onClick : undefined,
191
- "data-key": number,
192
- className: classnames(number === current && 'defaultCursor'),
193
- active: number === current
194
- }, number)), areRightDotsVisible && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, dotedButton(), Input, dotedButton()), rightButtons.map(number => /*#__PURE__*/React__default.createElement(Button, {
195
- key: number,
196
- flexibility: "content-size",
197
- color: "default",
198
- appearance: "minimal",
199
- onClick: number !== current ? onClick : undefined,
200
- "data-key": number,
201
- className: classnames(number === current && 'defaultCursor'),
202
- active: number === current
203
- }, number)), /*#__PURE__*/React__default.createElement(Divider, {
204
- type: "vertical"
205
- }), /*#__PURE__*/React__default.createElement(Tooltip, {
206
- title: nextIconTooltipText
207
- }, /*#__PURE__*/React__default.createElement(Button, {
208
- flexibility: "content-size",
209
- color: "default",
210
- appearance: "minimal",
211
- icon: "bc-icon-arrow-right-nav",
212
- onClick: onRightClick,
213
- disabled: isRightIconDisabled
214
- })));
215
- }
216
- Pagination.propTypes = {
217
- /**
218
- * Fires event when user changes the page
219
- * (page: Number) => void
220
- */
221
- onChange: PropTypes.func,
222
- /**
223
- * Initially selected page
224
- */
225
- selected: PropTypes.number,
226
- /**
227
- * Custom text if element will indicate error
228
- */
229
- errorText: PropTypes.string,
230
- /**
231
- * Turn on/off pagination's autofocus
232
- */
233
- autoFocus: PropTypes.bool,
234
- /**
235
- * Initially selected page
236
- */
237
- defaultSelected: PropTypes.number,
238
- /**
239
- * Total pages count
240
- */
241
- count: PropTypes.number.isRequired,
242
- /**
243
- * Text for next icon tooltip.
244
- */
245
- nextIconTooltipText: PropTypes.string,
246
- /**
247
- * Text for previous icon tooltip.
248
- */
249
- previousIconTooltipText: PropTypes.string,
250
- // TODO: bad naming
251
- supportedKeyCodes: PropTypes.arrayOf(PropTypes.number)
252
- };
253
- Pagination.defaultProps = {
254
- count: 1,
255
- errorText: 'Page does not exist',
256
- supportedKeyCodes: [enterCode],
257
- nextIconTooltipText: 'Next page',
258
- previousIconTooltipText: 'Previous page'
259
- };
260
-
261
- export { Pagination as default };
package/Paper/index.js DELETED
@@ -1,96 +0,0 @@
1
- import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
2
- import React__default, { forwardRef } from 'react';
3
- import PropTypes from 'prop-types';
4
- import { s as styleInject } from '../style-inject.es-746bb8ed.js';
5
-
6
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .paper{align-content:flex-start;display:flex;width:100%}[data-gene-ui-version=\"2.16.3\"] .paper:not(.bg-transparent){background:var(--background)}[data-gene-ui-version=\"2.16.3\"] .paper.with-shadow{box-shadow:0 .3rem .6rem 0 #0000000d}[data-gene-ui-version=\"2.16.3\"] .paper.top-radius{border-radius:2rem 2rem 0 0}[data-gene-ui-version=\"2.16.3\"] .paper.bottom-radius{border-radius:0 0 2rem 2rem}[data-gene-ui-version=\"2.16.3\"] .paper.full-radius{border-radius:2rem}[data-gene-ui-version=\"2.16.3\"] .paper.with-border{border:1px solid rgba(var(--background-sc-rgb),.1)}[data-gene-ui-version=\"2.16.3\"] .pd-row{flex-direction:row}[data-gene-ui-version=\"2.16.3\"] .pd-row-reverse{flex-direction:row-reverse}[data-gene-ui-version=\"2.16.3\"] .pd-column{flex-direction:column}[data-gene-ui-version=\"2.16.3\"] .pd-column-reverse{flex-direction:column-reverse}[data-gene-ui-version=\"2.16.3\"] .pw-nowrap{flex-wrap:nowrap}[data-gene-ui-version=\"2.16.3\"] .pw-wrap{flex-wrap:wrap}[data-gene-ui-version=\"2.16.3\"] .pw-wrap-reverse{flex-wrap:wrap-reverse}[data-gene-ui-version=\"2.16.3\"] .jc-paper-start{justify-content:flex-start}[data-gene-ui-version=\"2.16.3\"] .jc-paper-end{justify-content:flex-end}[data-gene-ui-version=\"2.16.3\"] .jc-center{justify-content:center}[data-gene-ui-version=\"2.16.3\"] .jc-start{justify-content:start}[data-gene-ui-version=\"2.16.3\"] .jc-end{justify-content:end}[data-gene-ui-version=\"2.16.3\"] .jc-left{justify-content:left}[data-gene-ui-version=\"2.16.3\"] .jc-right{justify-content:right}[data-gene-ui-version=\"2.16.3\"] .jc-normal{justify-content:normal}[data-gene-ui-version=\"2.16.3\"] .jc-space-between{justify-content:space-between}[data-gene-ui-version=\"2.16.3\"] .jc-space-around{justify-content:space-around}[data-gene-ui-version=\"2.16.3\"] .jc-space-evenly{justify-content:space-evenly}[data-gene-ui-version=\"2.16.3\"] .jc-stretch{justify-content:stretch}[data-gene-ui-version=\"2.16.3\"] .jc-inherit{justify-content:inherit}[data-gene-ui-version=\"2.16.3\"] .jc-initial{justify-content:normal}[data-gene-ui-version=\"2.16.3\"] .jc-unset{justify-content:unset}[data-gene-ui-version=\"2.16.3\"] .ai-normal{align-items:normal}[data-gene-ui-version=\"2.16.3\"] .ai-stretch{align-items:stretch}[data-gene-ui-version=\"2.16.3\"] .ai-center{align-items:center}[data-gene-ui-version=\"2.16.3\"] .ai-start{align-items:start}[data-gene-ui-version=\"2.16.3\"] .ai-end{align-items:end}[data-gene-ui-version=\"2.16.3\"] .ai-paper-start{align-items:flex-start}[data-gene-ui-version=\"2.16.3\"] .ai-paper-end{align-items:flex-end}[data-gene-ui-version=\"2.16.3\"] .ai-self-start{align-items:self-start}[data-gene-ui-version=\"2.16.3\"] .ai-self-end{align-items:self-end}[data-gene-ui-version=\"2.16.3\"] .ai-baseline{align-items:baseline}[data-gene-ui-version=\"2.16.3\"] .ai-inherit{align-items:inherit}[data-gene-ui-version=\"2.16.3\"] .ai-initial{align-items:normal}[data-gene-ui-version=\"2.16.3\"] .ai-unset{align-items:unset}";
7
- styleInject(css_248z);
8
-
9
- const paperDirections = ['row', 'row-reverse', 'column', 'column-reverse'];
10
- const paperWraps = ['nowrap', 'wrap', 'wrap-reverse'];
11
- const justifyContents = ['paper-start', 'paper-end', 'center', 'start', 'end', 'left', 'right', 'normal', 'space-between', 'space-around', 'space-evenly', 'stretch', 'inherit', 'initial', 'unset'];
12
- const alignItems = ['stretch', 'normal', 'center', 'start', 'end', 'paper-start', 'paper-end', 'self-start', 'self-end', 'baseline', 'inherit', 'initial', 'unset'];
13
- const cornersRadius = ['none', 'top-radius', 'bottom-radius', 'full-radius'];
14
- const Paper = /*#__PURE__*/forwardRef((_ref, ref) => {
15
- let {
16
- padding,
17
- children,
18
- className,
19
- paperDirection,
20
- paperWrap,
21
- justifyContent,
22
- alignItems,
23
- cornerRadius,
24
- shadow,
25
- border,
26
- isTransparent,
27
- ...restProps
28
- } = _ref;
29
- return /*#__PURE__*/React__default.createElement("div", _extends({
30
- ref: ref,
31
- className: "paper bg-".concat(isTransparent ? 'transparent' : 'color', "\n ").concat(border ? 'with-border' : '', "\n ").concat(className, "\n pd-").concat(paperDirection, "\n pw-").concat(paperWrap, "\n jc-").concat(justifyContent, "\n ai-").concat(alignItems, "\n ").concat(cornerRadius, "\n ").concat(shadow ? 'with-shadow' : ''),
32
- style: {
33
- padding: typeof padding === 'number' ? "".concat(padding / 10, "rem") : padding
34
- }
35
- }, restProps), children);
36
- });
37
- Paper.propTypes = {
38
- /**
39
- * Paper padding. Any padding value valid in css
40
- */
41
- padding: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
42
- /**
43
- * Additional className
44
- */
45
- className: PropTypes.string,
46
- /**
47
- * Wrapping with paper anything passed as child. Any valid React node
48
- */
49
- children: PropTypes.node,
50
- /**
51
- * Paper direction
52
- */
53
- paperDirection: PropTypes.oneOf(paperDirections),
54
- /**
55
- * Paper wrapping
56
- */
57
- paperWrap: PropTypes.oneOf(paperWraps),
58
- /**
59
- * Paper justify content
60
- */
61
- justifyContent: PropTypes.oneOf(justifyContents),
62
- /**
63
- * Paper align items
64
- */
65
- alignItems: PropTypes.oneOf(alignItems),
66
- /**
67
- * Paper corner radius
68
- */
69
- cornerRadius: PropTypes.oneOf(cornersRadius),
70
- /**
71
- * Will add transparency to the Paper when set to "true"
72
- */
73
- isTransparent: PropTypes.bool,
74
- /**
75
- * Will add borders to the Paper when set to "true"
76
- */
77
- border: PropTypes.bool,
78
- /**
79
- * Will add shadow to the Paper when set to "true"
80
- */
81
- shadow: PropTypes.bool
82
- };
83
- Paper.defaultProps = {
84
- padding: 0,
85
- className: '',
86
- paperDirection: paperDirections[0],
87
- paperWrap: paperWraps[0],
88
- justifyContent: justifyContents[0],
89
- alignItems: alignItems[0],
90
- cornerRadius: cornersRadius[0],
91
- shadow: false,
92
- border: false,
93
- isTransparent: false
94
- };
95
-
96
- export { alignItems, cornersRadius, Paper as default, justifyContents, paperDirections, paperWraps };