@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
@@ -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-ce12e4a9.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-c7646e48.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-3188e46e.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-fcbae78d.js';
47
- import '../Tag/index.js';
48
-
49
- var css_248z = "[data-gene-ui-version=\"2.16.4\"] .overspread-container{height:100%;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:300}[data-gene-ui-version=\"2.16.4\"] .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.4\"] .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.4\"] .overspread-head>li{align-items:center;display:flex;height:4.6rem;overflow:hidden}[data-gene-ui-version=\"2.16.4\"] .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.4\"] .overspread-head>li.over-h-act:last-child{grid-area:right;justify-content:flex-end}[data-gene-ui-version=\"2.16.4\"] .overspread-head>li.over-h-tt{font:600 1.7rem/2.3rem var(--font-family);grid-area:center}[data-gene-ui-version=\"2.16.4\"] .overspread-head>li>*{margin:0 .5rem}[data-gene-ui-version=\"2.16.4\"] .overspread-head>li .color-hero{color:var(--hero)}[data-gene-ui-version=\"2.16.4\"] .overspread-head button{transition:opacity .4s}[data-gene-ui-version=\"2.16.4\"] .overspread-head button:disabled{opacity:.5;pointer-events:none}[data-gene-ui-version=\"2.16.4\"] .overspread-body{-webkit-overflow-scrolling:touch;overflow-y:auto;padding:1.5rem}[data-gene-ui-version=\"2.16.4\"] .overspread-search{position:relative}[data-gene-ui-version=\"2.16.4\"] .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.4\"] .overspread-search:not(:focus-within,.show-search) .bc-icon-search{pointer-events:none}[data-gene-ui-version=\"2.16.4\"] .overspread-search:not(:focus-within,.show-search) .bc-icon-close{display:none}[data-gene-ui-version=\"2.16.4\"] .overspread-search.show-search,[data-gene-ui-version=\"2.16.4\"] .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.4\"] .overspread-search.show-search>*,[data-gene-ui-version=\"2.16.4\"] .overspread-search:focus-within>*{padding:0 .5rem}[data-gene-ui-version=\"2.16.4\"] .overspread-search.show-search .bc-icon-search,[data-gene-ui-version=\"2.16.4\"] .overspread-search:focus-within .bc-icon-search{display:none}[data-gene-ui-version=\"2.16.4\"] .overspread-search.show-search input,[data-gene-ui-version=\"2.16.4\"] .overspread-search:focus-within input{font:600 1.4rem var(--font-family);height:2.4rem;width:100%}[data-gene-ui-version=\"2.16.4\"] .overspread-search.show-search input::input-placeholder,[data-gene-ui-version=\"2.16.4\"] .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.4\"] .overspread-search.show-search input:placeholder,[data-gene-ui-version=\"2.16.4\"] .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.4\"] .overspread-search.show-search input::placeholder,[data-gene-ui-version=\"2.16.4\"] .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.4\"] .overspread-search.show-search input:input-placeholder,[data-gene-ui-version=\"2.16.4\"] .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.4\"] .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-c7646e48.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.4\"] .pagination-holder{align-items:center;display:flex}[data-gene-ui-version=\"2.16.4\"] .pagination-holder .icon{cursor:pointer}[data-gene-ui-version=\"2.16.4\"] .pagination-holder .defaultCursor{cursor:default}[data-gene-ui-version=\"2.16.4\"] .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.4\"] .paper{align-content:flex-start;display:flex;width:100%}[data-gene-ui-version=\"2.16.4\"] .paper:not(.bg-transparent){background:var(--background)}[data-gene-ui-version=\"2.16.4\"] .paper.with-shadow{box-shadow:0 .3rem .6rem 0 #0000000d}[data-gene-ui-version=\"2.16.4\"] .paper.top-radius{border-radius:2rem 2rem 0 0}[data-gene-ui-version=\"2.16.4\"] .paper.bottom-radius{border-radius:0 0 2rem 2rem}[data-gene-ui-version=\"2.16.4\"] .paper.full-radius{border-radius:2rem}[data-gene-ui-version=\"2.16.4\"] .paper.with-border{border:1px solid rgba(var(--background-sc-rgb),.1)}[data-gene-ui-version=\"2.16.4\"] .pd-row{flex-direction:row}[data-gene-ui-version=\"2.16.4\"] .pd-row-reverse{flex-direction:row-reverse}[data-gene-ui-version=\"2.16.4\"] .pd-column{flex-direction:column}[data-gene-ui-version=\"2.16.4\"] .pd-column-reverse{flex-direction:column-reverse}[data-gene-ui-version=\"2.16.4\"] .pw-nowrap{flex-wrap:nowrap}[data-gene-ui-version=\"2.16.4\"] .pw-wrap{flex-wrap:wrap}[data-gene-ui-version=\"2.16.4\"] .pw-wrap-reverse{flex-wrap:wrap-reverse}[data-gene-ui-version=\"2.16.4\"] .jc-paper-start{justify-content:flex-start}[data-gene-ui-version=\"2.16.4\"] .jc-paper-end{justify-content:flex-end}[data-gene-ui-version=\"2.16.4\"] .jc-center{justify-content:center}[data-gene-ui-version=\"2.16.4\"] .jc-start{justify-content:start}[data-gene-ui-version=\"2.16.4\"] .jc-end{justify-content:end}[data-gene-ui-version=\"2.16.4\"] .jc-left{justify-content:left}[data-gene-ui-version=\"2.16.4\"] .jc-right{justify-content:right}[data-gene-ui-version=\"2.16.4\"] .jc-normal{justify-content:normal}[data-gene-ui-version=\"2.16.4\"] .jc-space-between{justify-content:space-between}[data-gene-ui-version=\"2.16.4\"] .jc-space-around{justify-content:space-around}[data-gene-ui-version=\"2.16.4\"] .jc-space-evenly{justify-content:space-evenly}[data-gene-ui-version=\"2.16.4\"] .jc-stretch{justify-content:stretch}[data-gene-ui-version=\"2.16.4\"] .jc-inherit{justify-content:inherit}[data-gene-ui-version=\"2.16.4\"] .jc-initial{justify-content:normal}[data-gene-ui-version=\"2.16.4\"] .jc-unset{justify-content:unset}[data-gene-ui-version=\"2.16.4\"] .ai-normal{align-items:normal}[data-gene-ui-version=\"2.16.4\"] .ai-stretch{align-items:stretch}[data-gene-ui-version=\"2.16.4\"] .ai-center{align-items:center}[data-gene-ui-version=\"2.16.4\"] .ai-start{align-items:start}[data-gene-ui-version=\"2.16.4\"] .ai-end{align-items:end}[data-gene-ui-version=\"2.16.4\"] .ai-paper-start{align-items:flex-start}[data-gene-ui-version=\"2.16.4\"] .ai-paper-end{align-items:flex-end}[data-gene-ui-version=\"2.16.4\"] .ai-self-start{align-items:self-start}[data-gene-ui-version=\"2.16.4\"] .ai-self-end{align-items:self-end}[data-gene-ui-version=\"2.16.4\"] .ai-baseline{align-items:baseline}[data-gene-ui-version=\"2.16.4\"] .ai-inherit{align-items:inherit}[data-gene-ui-version=\"2.16.4\"] .ai-initial{align-items:normal}[data-gene-ui-version=\"2.16.4\"] .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 };