@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
package/Modal/index.js DELETED
@@ -1,251 +0,0 @@
1
- import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
2
- import React__default, { useRef, useState, useCallback } from 'react';
3
- import { c as classnames } from '../index-031ff73c.js';
4
- import PropTypes from 'prop-types';
5
- import { n as noop } from '../index-5f37f281.js';
6
- import useKeyDown from '../hooks/useKeyDown.js';
7
- import '../configs-00612ce0.js';
8
- import Button from '../Button/index.js';
9
- import Portal from '../Portal/index.js';
10
- import { s as styleInject } from '../style-inject.es-746bb8ed.js';
11
- import '../dateValidation-67caec66.js';
12
- import '../_commonjsHelpers-24198af3.js';
13
- import 'react-dom';
14
- import '../tslib.es6-f211516f.js';
15
- import '../Icon/index.js';
16
- import '../GeneUIProvider/index.js';
17
-
18
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .modal-splash{animation:modal-splash .3s forwards;display:flex;height:calc(100% - var(--header-height, 0px));left:0;opacity:0;overflow-y:auto;padding:2.8rem;position:fixed;top:var(--header-height,0);width:100%;z-index:300}@keyframes modal-splash{to{opacity:1}}[data-gene-ui-version=\"2.16.3\"] .modal-splash.p-top{padding-top:0}[data-gene-ui-version=\"2.16.3\"] .modal-splash.p-bottom{padding-bottom:0}[data-gene-ui-version=\"2.16.3\"] .modal-splash.light-background{background:#fff9}[data-gene-ui-version=\"2.16.3\"] .modal-splash.dark-background{background:#0006}[data-gene-ui-version=\"2.16.3\"] .modal-content{animation:modal-content .4s .1s forwards;background:var(--background);border:1px solid rgba(var(--background-sc-rgb),.1);border-radius:2rem;box-shadow:0 .2rem .4rem 0 #0000001a;display:flex;flex-direction:column;margin:auto;max-width:100%;opacity:0;position:relative}@keyframes modal-content{to{opacity:1}}[data-gene-ui-version=\"2.16.3\"] .modal-content.s-default{width:35rem}[data-gene-ui-version=\"2.16.3\"] .modal-content .modal-close{position:absolute;top:.5rem}html:not([dir=rtl]) .modal-content .modal-close{right:1.6rem}html[dir=rtl] .modal-content .modal-close{left:1.6rem}[data-gene-ui-version=\"2.16.3\"] .modal-splash.p-top .modal-content{align-self:flex-start;border-top-left-radius:0;border-top-right-radius:0;margin:0 auto}[data-gene-ui-version=\"2.16.3\"] .modal-splash.p-bottom .modal-content{align-self:flex-end;border-bottom-left-radius:0;border-bottom-right-radius:0;box-shadow:0 -.2rem .4rem 0 #0000001a;margin:0 auto}[data-gene-ui-version=\"2.16.3\"] .modal-head{align-items:center;border-bottom:1px solid rgba(var(--background-sc-rgb),.1);display:flex;font:700 1.4rem/1.8rem var(--font-family);justify-content:center;min-height:4rem;padding:0 5.4rem;position:relative;text-align:center;width:100%}[data-gene-ui-version=\"2.16.3\"] .modal-head .modal-close{top:50%;transform:translateY(-50%)}[data-gene-ui-version=\"2.16.3\"] .a-compact .modal-head{border-bottom:0;line-height:1.6rem;margin:2.6rem 0 .6rem;min-height:inherit}[data-gene-ui-version=\"2.16.3\"] .modal-body{color:rgba(var(--background-sc-rgb),.62);font:600 1.2rem/1.42 var(--font-family);padding:2rem;width:100%}[data-gene-ui-version=\"2.16.3\"] .modal-footer{border-top:1px solid rgba(var(--background-sc-rgb),.1);display:flex;justify-content:center;padding:1.5rem 2.5rem;width:100%}[data-gene-ui-version=\"2.16.3\"] .modal-footer>*{margin:0 .5rem}";
19
- styleInject(css_248z);
20
-
21
- const sizes = ['default', 'content-size'];
22
- const backgrounds = ['transparent', 'light-background', 'dark-background'];
23
- const appearances = ['default', 'compact'];
24
- const positions = ['center', 'top', 'bottom'];
25
- const KEYBOARD_ENTER_KEY = 13;
26
- const KEYBOARD_ESC_KEY = 27;
27
- function Modal(_ref) {
28
- let {
29
- visible,
30
- size,
31
- background,
32
- appearance,
33
- withPortal,
34
- portalContainer,
35
- customActions,
36
- position,
37
- closable,
38
- cancelText,
39
- okText,
40
- title,
41
- width,
42
- zIndex,
43
- children,
44
- onOK,
45
- onCancel,
46
- footer,
47
- isOkActive,
48
- className,
49
- disableFooter,
50
- needEnter,
51
- closeOnClickOutside,
52
- onClose,
53
- isOkButtonLoading,
54
- ...rest
55
- } = _ref;
56
- const modalSplashRef = useRef(null);
57
- const [mouseDown, setMouseDown] = useState(false);
58
-
59
- // We need this 2 functions, because must be closed only when
60
- // mouseDown and mouseUp are outside of modal
61
- const handleMouseDown = useCallback(e => e.target === modalSplashRef.current && setMouseDown(true), [modalSplashRef.current]);
62
- const handleMouseUp = useCallback(e => {
63
- if (mouseDown && e.target === modalSplashRef.current) {
64
- closeOnClickOutside && onCancel(e);
65
- setMouseDown(false);
66
- } else if (e.target !== modalSplashRef.current) {
67
- setMouseDown(false);
68
- }
69
- }, [closeOnClickOutside, onCancel, modalSplashRef.current, mouseDown]);
70
- useKeyDown(e => {
71
- if (visible) {
72
- e.keyCode === KEYBOARD_ESC_KEY && onCancel(e);
73
- e.keyCode === KEYBOARD_ENTER_KEY && isOkActive && needEnter && onOK(e);
74
- }
75
- }, [visible, isOkActive, onCancel, onOK], {
76
- current: window
77
- }, ['Escape', 'Enter']);
78
- const Content = /*#__PURE__*/React__default.createElement("div", _extends({
79
- className: classnames('modal-splash', "".concat(background), "a-".concat(appearance), "p-".concat(position), className),
80
- onMouseDown: handleMouseDown,
81
- onMouseUp: handleMouseUp,
82
- style: {
83
- zIndex
84
- },
85
- ref: modalSplashRef
86
- }, rest), /*#__PURE__*/React__default.createElement("div", {
87
- className: classnames('modal-content', "s-".concat(size)),
88
- style: {
89
- width
90
- }
91
- }, closable && !title && /*#__PURE__*/React__default.createElement(Button, {
92
- icon: "bc-icon-close",
93
- size: "medium",
94
- className: "modal-close",
95
- appearance: "minimal",
96
- color: "default",
97
- onClick: onClose || onCancel
98
- }), (title || customActions) && /*#__PURE__*/React__default.createElement("div", {
99
- className: "modal-head"
100
- }, /*#__PURE__*/React__default.createElement("div", {
101
- className: "ellipsis-text"
102
- }, title), closable && /*#__PURE__*/React__default.createElement(Button, {
103
- icon: "bc-icon-close",
104
- size: "medium",
105
- className: "modal-close",
106
- appearance: "minimal",
107
- color: "default",
108
- onClick: onClose || onCancel
109
- }), customActions), children && /*#__PURE__*/React__default.createElement("div", {
110
- className: "modal-body"
111
- }, children), !disableFooter && /*#__PURE__*/React__default.createElement("div", {
112
- className: "modal-footer"
113
- }, footer || /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Button, {
114
- appearance: "minimal",
115
- size: "medium",
116
- color: "default",
117
- onClick: onCancel
118
- }, cancelText), /*#__PURE__*/React__default.createElement(Button, {
119
- disabled: !isOkActive || isOkButtonLoading,
120
- size: "medium",
121
- onClick: onOK,
122
- loading: isOkButtonLoading
123
- }, okText)))));
124
- const portalWrapper = withPortal ? /*#__PURE__*/React__default.createElement(Portal, {
125
- isOpen: visible,
126
- container: portalContainer
127
- }, Content) : Content;
128
- return visible && portalWrapper;
129
- }
130
- Modal.propTypes = {
131
- /**
132
- * Displays modal if [true]
133
- */
134
- visible: PropTypes.bool,
135
- /**
136
- * Controls modal size
137
- */
138
- size: PropTypes.oneOf(sizes),
139
- /**
140
- * Controls background color of modal
141
- */
142
- background: PropTypes.oneOf(backgrounds),
143
- /**
144
- * Controls divider between modal's header and body
145
- */
146
- appearance: PropTypes.oneOf(appearances),
147
- /**
148
- * Controls modal position on screen
149
- */
150
- position: PropTypes.oneOf(positions),
151
- /**
152
- * Displays close button on modal,
153
- * Fires onCancel function when clicked
154
- */
155
- closable: PropTypes.bool,
156
- /**
157
- * Disables footer in modal
158
- */
159
- disableFooter: PropTypes.bool,
160
- /**
161
- * Enables footers Ok button in modal
162
- */
163
- isOkActive: PropTypes.bool,
164
- /**
165
- * Custom text for cancel button
166
- */
167
- cancelText: PropTypes.string,
168
- /**
169
- * Custom text for ok button
170
- */
171
- okText: PropTypes.string,
172
- /**
173
- * Custom title for modal
174
- */
175
- title: PropTypes.any,
176
- /**
177
- * Wraps component with Portal component if [true]
178
- */
179
- withPortal: PropTypes.bool,
180
- portalContainer: PropTypes.any,
181
- /**
182
- * Custom value to override default css value
183
- */
184
- width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
185
- /**
186
- * Custom zIndex value to overRide default css value
187
- */
188
- zIndex: PropTypes.number,
189
- /**
190
- * Valid React elements for modal body
191
- */
192
- children: PropTypes.node,
193
- /**
194
- * Additional classname
195
- */
196
- className: PropTypes.string,
197
- /**
198
- * Fires event when user clicks on ok button
199
- * (event: Event) => void
200
- */
201
- onOK: PropTypes.func,
202
- /**
203
- * Fires event when user clicks on Cancel button
204
- * (event: Event) => void
205
- */
206
- onCancel: PropTypes.func,
207
- /**
208
- * Custom footer element for modal
209
- */
210
- footer: PropTypes.element,
211
- /**
212
- * Pass [true] if you need to hide a modal when people click outside of it's content
213
- */
214
- closeOnClickOutside: PropTypes.bool,
215
- /**
216
- * Custom action elements for modal's header
217
- */
218
- customActions: PropTypes.node,
219
- /**
220
- * Enable keyboard Enter
221
- */
222
- needEnter: PropTypes.bool,
223
- /**
224
- * Fires event when user clicks on Close icon
225
- * (event: Event) => void
226
- */
227
- onClose: PropTypes.func,
228
- /**
229
- * Loader for ok button
230
- */
231
- isOkButtonLoading: PropTypes.bool
232
- };
233
- Modal.defaultProps = {
234
- visible: false,
235
- size: sizes[0],
236
- onOK: noop,
237
- onCancel: noop,
238
- background: backgrounds[2],
239
- appearance: appearances[0],
240
- position: positions[0],
241
- closable: true,
242
- cancelText: 'Cancel',
243
- okText: 'OK',
244
- closeOnClickOutside: true,
245
- isOkActive: true,
246
- disableFooter: false,
247
- needEnter: true,
248
- isOkButtonLoading: false
249
- };
250
-
251
- export { Modal as default };
@@ -1,141 +0,0 @@
1
- import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
2
- import React__default from 'react';
3
- import PropTypes from 'prop-types';
4
- import { c as classnames } from '../index-031ff73c.js';
5
- import { b as moduleTitleConfig } from '../configs-00612ce0.js';
6
- import { n as noop } from '../index-5f37f281.js';
7
- import Icon from '../Icon/index.js';
8
- import { T as Tooltip } from '../index-65217440.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 '../GeneUIProvider/index.js';
15
-
16
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .module-header{background:var(--background);display:flex;flex-shrink:0;height:5rem;padding:0 .5rem 0 2rem;width:100%}html[dir=rtl] .module-header{padding:0 2rem 0 .5rem}[data-gene-ui-version=\"2.16.3\"] .module-header.headerBorder.p-top{border-bottom:1px solid rgba(var(--background-sc-rgb),.1)}[data-gene-ui-version=\"2.16.3\"] .module-header.headerBorder.p-top.cr-position-radius{border-radius:2rem 2rem 0 0}[data-gene-ui-version=\"2.16.3\"] .module-header.headerBorder.p-bottom{border-top:1px solid rgba(var(--background-sc-rgb),.1)}[data-gene-ui-version=\"2.16.3\"] .module-header.headerBorder.p-bottom.cr-position-radius{border-radius:0 0 2rem 2rem}[data-gene-ui-version=\"2.16.3\"] .module-header.cr-full-radius{border-radius:2rem}[data-gene-ui-version=\"2.16.3\"] .module-header>li{align-items:center;display:flex}[data-gene-ui-version=\"2.16.3\"] .module-header>li.left-content{flex:auto;overflow:hidden;position:relative}[data-gene-ui-version=\"2.16.3\"] .module-header>li.left-content .left-inner{max-width:100%}[data-gene-ui-version=\"2.16.3\"] .module-header>li.left-content .left-inner:nth-last-child(2){max-width:calc(100% - 3.2rem)}[data-gene-ui-version=\"2.16.3\"] .module-header>li.left-content .left-inner-icon{margin-inline-start:.8rem}[data-gene-ui-version=\"2.16.3\"] .module-header>li.right-content{flex-shrink:0}[data-gene-ui-version=\"2.16.3\"] .module-header.s-small{height:3rem}[data-gene-ui-version=\"2.16.3\"] .module-header.s-small .module-description-title .m-title,[data-gene-ui-version=\"2.16.3\"] .module-header.s-small .module-title{font-size:1.2rem;line-height:normal}[data-gene-ui-version=\"2.16.3\"] .module-header.s-medium{height:4rem}[data-gene-ui-version=\"2.16.3\"] .module-header.s-extra-big{height:6rem}[data-gene-ui-version=\"2.16.3\"] .module-title{font:600 1.4rem/1.8rem var(--font-family)}[data-gene-ui-version=\"2.16.3\"] .module-title:before{background:var(--hero);content:\"\";display:block;height:.3rem;position:absolute;width:3.4rem}html:not([dir=rtl]) .module-title:before{left:0}html[dir=rtl] .module-title:before{right:0}[data-gene-ui-version=\"2.16.3\"] .p-top .module-title:before{bottom:0}[data-gene-ui-version=\"2.16.3\"] .p-bottom .module-title:before{top:0}[data-gene-ui-version=\"2.16.3\"] .module-title-without-border{font:600 1.4rem/1.8rem var(--font-family)}[data-gene-ui-version=\"2.16.3\"] .module-description-title{width:100%}[data-gene-ui-version=\"2.16.3\"] .module-description-title .m-description{font:600 1.2rem/1.6rem var(--font-family)}[data-gene-ui-version=\"2.16.3\"] .module-description-title .m-title{font:600 1.6rem/2.8rem var(--font-family)}";
17
- styleInject(css_248z);
18
-
19
- function IconWithTooltip(_ref) {
20
- let {
21
- toolTip,
22
- children
23
- } = _ref;
24
- return toolTip ? /*#__PURE__*/React__default.createElement(Tooltip, {
25
- title: toolTip
26
- }, children) : children;
27
- }
28
- function ModuleTitle(_ref2) {
29
- let {
30
- size,
31
- title,
32
- color,
33
- hideBeforeBorder,
34
- position,
35
- children,
36
- className,
37
- description,
38
- cornerRadius,
39
- headerBorder,
40
- titleIcon,
41
- titleIconTooltip,
42
- onTitleIconClick,
43
- ...restProps
44
- } = _ref2;
45
- return /*#__PURE__*/React__default.createElement("ul", _extends({
46
- className: classnames('module-header', "cr-".concat(cornerRadius), "p-".concat(position), "s-".concat(size), className, {
47
- headerBorder
48
- })
49
- }, restProps), /*#__PURE__*/React__default.createElement("li", {
50
- className: "left-content",
51
- style: {
52
- '--hero': color || ''
53
- }
54
- }, /*#__PURE__*/React__default.createElement("div", {
55
- className: "left-inner"
56
- }, description ? /*#__PURE__*/React__default.createElement("div", {
57
- className: "module-description-title"
58
- }, /*#__PURE__*/React__default.createElement("div", {
59
- className: "m-description ellipsis-text"
60
- }, description), /*#__PURE__*/React__default.createElement("div", {
61
- className: "m-title ellipsis-text"
62
- }, title)) : title && /*#__PURE__*/React__default.createElement("div", {
63
- className: classnames('ellipsis-text', {
64
- 'module-title-without-border': hideBeforeBorder,
65
- 'module-title': !hideBeforeBorder
66
- }),
67
- title: typeof title === 'string' ? title : ''
68
- }, title)), titleIcon && /*#__PURE__*/React__default.createElement(IconWithTooltip, {
69
- toolTip: titleIconTooltip
70
- }, /*#__PURE__*/React__default.createElement("div", {
71
- className: "left-inner-icon"
72
- }, /*#__PURE__*/React__default.createElement(Icon, {
73
- type: titleIcon,
74
- onClick: onTitleIconClick
75
- })))), /*#__PURE__*/React__default.createElement("li", {
76
- className: "right-content"
77
- }, children));
78
- }
79
- ModuleTitle.propTypes = {
80
- /**
81
- * Title property. Any valid React node.
82
- */
83
- title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
84
- /**
85
- * Additonal description. Any valid React node
86
- */
87
- description: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
88
- /**
89
- * ModuleTitle sizing
90
- */
91
- size: PropTypes.oneOf(moduleTitleConfig.size),
92
- /**
93
- * Addional className
94
- */
95
- className: PropTypes.string,
96
- /**
97
- * Hide border after title
98
- */
99
- hideBeforeBorder: PropTypes.bool,
100
- /**
101
- * Hide header main border
102
- */
103
- headerBorder: PropTypes.bool,
104
- /**
105
- * ModuleTitle positioning
106
- */
107
- position: PropTypes.oneOf(moduleTitleConfig.position),
108
- /**
109
- * ModuleTitle corner radius
110
- */
111
- cornerRadius: PropTypes.oneOf(moduleTitleConfig.cornerRadius),
112
- /**
113
- * Module title content can be passed as child. Any valid React node.
114
- */
115
- children: PropTypes.node,
116
- /**
117
- * Use this prop to override ModuleTitle's underline color. Will not work when "descroiption" prop is specified
118
- */
119
- color: PropTypes.string,
120
- /**
121
- * Will add an "Icon" atom to the left side of ModuleTitle. Valid values are the same as "type" prop for "Icon" atom
122
- */
123
- titleIcon: PropTypes.string,
124
- /**
125
- * Tooltip for icon
126
- */
127
- titleIconTooltip: PropTypes.string,
128
- /**
129
- * Title Icon onClick event
130
- */
131
- onTitleIconClick: PropTypes.func
132
- };
133
- ModuleTitle.defaultProps = {
134
- onTitleIconClick: noop,
135
- headerBorder: true,
136
- size: moduleTitleConfig.size[2],
137
- position: moduleTitleConfig.position[0],
138
- cornerRadius: moduleTitleConfig.cornerRadius[0]
139
- };
140
-
141
- export { ModuleTitle as default };
@@ -1,222 +0,0 @@
1
- import React__default, { memo, useState, useRef, useMemo, useCallback, useEffect } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { n as noop } from '../index-5f37f281.js';
4
- import useDeviceType from '../hooks/useDeviceType.js';
5
- import Icon from '../Icon/index.js';
6
- import Option from '../Option/index.js';
7
- import Popover from '../Popover/index.js';
8
- import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
9
- import '../dateValidation-67caec66.js';
10
- import { d as debounce } from '../debounce-4419bc2f.js';
11
- import 'react-dom';
12
- import Menu from '../Menu/index.js';
13
- import { s as styleInject } from '../style-inject.es-746bb8ed.js';
14
- import '../configs-00612ce0.js';
15
- import '../hooks/useWindowSize.js';
16
- import '../hooks/useDebounce.js';
17
- import '../index-031ff73c.js';
18
- import '../useEllipsisDetection-c1c9ad94.js';
19
- import '../index-65217440.js';
20
- import '../tslib.es6-f211516f.js';
21
- import '../GeneUIProvider/index.js';
22
- import '../_commonjsHelpers-24198af3.js';
23
- import '../index-122432cd.js';
24
- import '../hooks/useUpdatableRef.js';
25
- import '../hooks/useForceUpdate.js';
26
- import '../Portal/index.js';
27
- import '../Scrollbar/index.js';
28
- import '../guid-8ddf77b3.js';
29
-
30
- const getTitle = (id, data) => {
31
- if (data) {
32
- const matchedDatum = data.find(datum => datum.id === id);
33
- return matchedDatum && matchedDatum.title ? matchedDatum : data.map(datum => getTitle(id, datum.data)).filter(Boolean)[0];
34
- }
35
- };
36
- const getTitlesArray = (ids, data) => ids.map(id => getTitle(id, data)).filter(Boolean);
37
- const navigationOptionsToMenu = (navigationOptions, optionId) => navigationOptions.map(_ref => {
38
- let {
39
- data,
40
- ...rest
41
- } = _ref;
42
- return {
43
- ...rest,
44
- active: (optionId === null || optionId === void 0 ? void 0 : optionId.toString()) === rest.id.toString(),
45
- ...(data ? {
46
- children: navigationOptionsToMenu(data, optionId)
47
- } : {})
48
- };
49
- });
50
- const indexStackFromItems = (stack, items, selectedItemId) => {
51
- if (!(items !== null && items !== void 0 && items.length)) {
52
- return [];
53
- }
54
- for (const itemIndex in items) {
55
- const item = items[itemIndex];
56
- if (item.id === selectedItemId) {
57
- return stack;
58
- }
59
- if (item.children) {
60
- const currentIndexStack = indexStackFromItems([...stack, Number(itemIndex)], item.children, selectedItemId);
61
- if (currentIndexStack.length) {
62
- return currentIndexStack;
63
- }
64
- }
65
- }
66
- return [];
67
- };
68
-
69
- function NavigationMenuContent(_ref) {
70
- let {
71
- depth,
72
- path,
73
- options,
74
- onChange,
75
- splitedValue
76
- } = _ref;
77
- const [activeItem, setActiveItem] = useState();
78
- const navigationRef = useRef(null);
79
- const isHovered = useRef(true);
80
- const optionId = useMemo(() => splitedValue === null || splitedValue === void 0 ? void 0 : splitedValue[depth], [depth, splitedValue]);
81
- const isActiveItem = useMemo(() => (activeItem === null || activeItem === void 0 ? void 0 : activeItem.id) && optionId === activeItem.id, [activeItem, optionId]);
82
- const mobileOptions = useMemo(() => options ? navigationOptionsToMenu(options, optionId) : undefined, [options, optionId]);
83
- const initialIndexStack = useMemo(() => indexStackFromItems([], mobileOptions, optionId), [mobileOptions, activeItem]);
84
- const {
85
- isMobile
86
- } = useDeviceType();
87
- const onMouseEnterHandler = useCallback(debounce(_ref2 => {
88
- let {
89
- isColaps,
90
- item
91
- } = _ref2;
92
- if (!isHovered.current) return;
93
- isColaps ? setActiveItem(item) : setActiveItem(null);
94
- }, 200), [isHovered, setActiveItem]);
95
- useEffect(() => {
96
- if (optionId && options !== null && options !== void 0 && options.length) {
97
- const item = options.find(item => item.id === optionId);
98
- item && setActiveItem(item);
99
- }
100
- }, [optionId, options]);
101
- const onItemClick = item => {
102
- onChange(path ? "".concat(path, "/").concat(item.id) : item.id, item);
103
- setActiveItem(item);
104
- };
105
- if (isMobile) {
106
- return /*#__PURE__*/React__default.createElement(Menu, {
107
- data: mobileOptions,
108
- onSelect: (_, item) => onItemClick(item),
109
- selectedItem: activeItem,
110
- initialIndexStack: initialIndexStack
111
- });
112
- }
113
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, (options === null || options === void 0 ? void 0 : options.length) > 0 && /*#__PURE__*/React__default.createElement("div", {
114
- className: "bc-navigation-menu_content-menu",
115
- ref: navigationRef,
116
- onMouseEnter: () => isHovered.current = true,
117
- onMouseLeave: () => isHovered.current = false
118
- }, options.map(item => {
119
- const isColaps = !!(item.data && item.data.length);
120
- return item.isHidden !== true && /*#__PURE__*/React__default.createElement(Option, _extends({}, item, {
121
- key: item.id,
122
- active: optionId === item.id,
123
- forwardMark: isColaps,
124
- onClick: () => !isColaps && onItemClick(item),
125
- onMouseEnter: () => onMouseEnterHandler({
126
- isColaps,
127
- item
128
- })
129
- }));
130
- })), activeItem && /*#__PURE__*/React__default.createElement(NavigationMenuContent, {
131
- depth: depth + 1,
132
- path: path ? "".concat(path, "/").concat(activeItem.id) : activeItem.id,
133
- options: activeItem.data,
134
- onChange: onChange,
135
- splitedValue: isActiveItem && splitedValue
136
- }));
137
- }
138
- NavigationMenuContent.defaultProps = {
139
- depth: 0
140
- };
141
- var NavigationMenuContent$1 = /*#__PURE__*/memo(NavigationMenuContent);
142
-
143
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu{--size:3.6rem;align-items:center;border:1px solid #0000;border-radius:var(--button-external-size,var(--size));color:#fff;cursor:pointer;display:flex;font:600 1.4rem/2rem var(--font-family);justify-content:center;min-height:var(--button-external-size,var(--size));min-width:var(--button-external-size,var(--size));padding:0 1rem;position:relative;transition:color .3s,background .3s,opacity .2s;-webkit-user-select:none;user-select:none}@media (hover:hover){[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu:hover{background:#ffffff1a}}[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu.active{background:#ffffff1a}[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu:disabled{opacity:.5;pointer-events:none}[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu_head{align-items:center;display:flex;justify-content:center;pointer-events:none}[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu_layer{align-items:center;display:flex;margin:0 .8rem;opacity:.7}[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu_layer.active,[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu_layer:last-child{opacity:1}[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu_content{display:flex;padding:1rem 0}[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu_content-menu{width:25.8rem}[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu_content-menu:not(.bc-navigation-menu_content-menu:last-child){border-right:1px solid #0000001a}[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu_title-wrapper{align-items:center;display:flex;justify-content:center}[data-gene-ui-version=\"2.16.3\"] .bc-navigation-menu_title-wrapper:not(.bc-navigation-menu_title-wrapper:last-child):after{background-color:#fff;content:\"\";display:block;height:2.3rem;margin-inline:.6rem;transform:rotate(15deg);width:1px}";
144
- styleInject(css_248z);
145
-
146
- function NavigationMenu(_ref) {
147
- let {
148
- data,
149
- value,
150
- onChange,
151
- disabled
152
- } = _ref;
153
- const [isOpen, setIsOpen] = useState(false);
154
- const {
155
- isMobile
156
- } = useDeviceType();
157
- const splitedValue = useMemo(() => value && value.split('/').filter(Boolean), [value]);
158
- const title = useMemo(() => getTitlesArray(splitedValue, data), [splitedValue, data]);
159
- const handleChange = useCallback(function () {
160
- setIsOpen(false);
161
- onChange(...arguments);
162
- }, [onChange]);
163
- const handleToggle = useCallback(() => setIsOpen(prev => !prev), []);
164
- return /*#__PURE__*/React__default.createElement(Popover, {
165
- isOpen: isOpen,
166
- extendTargetWidth: false,
167
- toggleHandler: handleToggle,
168
- fullHeight: true,
169
- children: /*#__PURE__*/React__default.createElement("button", {
170
- className: "bc-navigation-menu",
171
- disabled: disabled
172
- }, /*#__PURE__*/React__default.createElement("div", {
173
- className: "bc-navigation-menu_head"
174
- }, title.map((item, index) => /*#__PURE__*/React__default.createElement("div", {
175
- className: "bc-navigation-menu_title-wrapper"
176
- }, (item === null || item === void 0 ? void 0 : item.icon) && isMobile && /*#__PURE__*/React__default.createElement(Icon, {
177
- type: item.icon
178
- }), /*#__PURE__*/React__default.createElement("span", {
179
- key: index,
180
- className: "bc-navigation-menu_layer"
181
- }, item.title)))), /*#__PURE__*/React__default.createElement(Icon, {
182
- type: "bc-icon-arrow-down"
183
- })),
184
- Content: /*#__PURE__*/React__default.createElement("div", {
185
- className: "bc-navigation-menu_content"
186
- }, /*#__PURE__*/React__default.createElement(NavigationMenuContent$1, {
187
- options: data,
188
- onChange: handleChange,
189
- splitedValue: splitedValue
190
- }))
191
- });
192
- }
193
- NavigationMenu.propTypes = {
194
- /**
195
- * This is where you send data (options) for the menu, if you need to send
196
- * nested options, send the date to the option in the same structure as the options.
197
- * example => data={[{ id: 'item_1', title: 'Item 1', isHidden: false, data: [ { id: 'item_1_1', title: 'Item 1.1', isHidden: false } ]}]}
198
- */
199
- data: PropTypes.arrayOf(PropTypes.shape(Option.propTypes)).isRequired,
200
- /**
201
- * For value you need to send id selectable options id,
202
- * and if you select the nested option, then you need to send the id to the hierarchy.
203
- * example => 'item_1/item_1_1'
204
- */
205
- value: PropTypes.string.isRequired,
206
- /**
207
- * onChange handler is called by clicking on the option
208
- * This callback gives you the option you clicked on and its id and
209
- * if it is nested then the give and parent option id are associated with a forward slash.
210
- * (id: NavigationMenu.value, item: Option) => void
211
- */
212
- onChange: PropTypes.func,
213
- /**
214
- * Disabled status for the navigation menu button
215
- */
216
- disabled: PropTypes.bool
217
- };
218
- NavigationMenu.defaultProps = {
219
- onChange: noop
220
- };
221
-
222
- export { NavigationMenu as default };