@geneui/components 2.11.2 → 2.12.2

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 (213) hide show
  1. package/{ActionableList.js → ActionableList/index.js} +83 -152
  2. package/{AdvancedSearch.js → AdvancedSearch/index.js} +290 -304
  3. package/Alert/index.js +97 -0
  4. package/Avatar/index.js +30 -0
  5. package/Badge/index.js +75 -0
  6. package/{Breadcrumb.js → Breadcrumb/index.js} +32 -31
  7. package/BusyLoader/index.js +68 -0
  8. package/Button/index.js +129 -0
  9. package/CHANGELOG.md +53 -0
  10. package/{Card.js → Card/index.js} +82 -94
  11. package/{CardList.js → CardList/index.js} +120 -165
  12. package/{CellMeasurerCache-b786dd93.js → CellMeasurerCache-3741d716.js} +2 -2
  13. package/{index-9164a86d.js → Charts/index.js} +17103 -30447
  14. package/{Checkbox.js → Checkbox/index.js} +37 -38
  15. package/{CheckboxGroup.js → CheckboxGroup/index.js} +41 -42
  16. package/{CheckboxGroupWithSearch.js → CheckboxGroupWithSearch/index.js} +64 -65
  17. package/{Collapse.js → Collapse/index.js} +28 -29
  18. package/{ColorPicker.js → ColorPicker/index.js} +16 -16
  19. package/ComboBox/index.js +525 -0
  20. package/Counter/index.js +310 -0
  21. package/{DateFilter.js → DateFilter/index.js} +45 -43
  22. package/{DatePicker.js → DatePicker/index.js} +106 -108
  23. package/{index-0199942c.js → DatePickerInput/index.js} +114 -100
  24. package/{Divider.js → Divider/index.js} +9 -10
  25. package/{Drawer.js → Drawer/index.js} +40 -41
  26. package/Dropdown/index.js +41 -0
  27. package/{Editor.js → Editor/index.js} +165 -164
  28. package/{Empty.js → Empty/index.js} +12 -13
  29. package/{ExtendedInput.js → ExtendedInput/index.js} +81 -71
  30. package/Form/index.js +83 -0
  31. package/{FormContainer.js → FormContainer/index.js} +25 -26
  32. package/FormableCheckbox/index.js +26 -0
  33. package/FormableDatePicker/index.js +41 -0
  34. package/FormableDropdown/index.js +48 -0
  35. package/FormableEditor/index.js +24 -0
  36. package/{FormableHOC-21051057.js → FormableHOC-55263162.js} +3 -3
  37. package/FormableMultiSelectDropdown/index.js +48 -0
  38. package/FormableNumberInput/index.js +32 -0
  39. package/FormableRadio/index.js +22 -0
  40. package/FormableSwitcher/index.js +22 -0
  41. package/FormableTextInput/index.js +32 -0
  42. package/FormableUploader/index.js +42 -0
  43. package/GeneUIProvider/index.js +282 -0
  44. package/{Grid.js → Grid/index.js} +27 -27
  45. package/Holder/index.js +261 -0
  46. package/{Icon.js → Icon/index.js} +9 -10
  47. package/Image/index.js +129 -0
  48. package/ImagePreview/index.js +481 -0
  49. package/{KeyValue.js → KeyValue/index.js} +11 -12
  50. package/LICENSE +21 -0
  51. package/Label/index.js +57 -0
  52. package/LinkButton/index.js +67 -0
  53. package/{Menu.js → Menu/index.js} +27 -28
  54. package/MobileNavigation/index.js +94 -0
  55. package/{MobilePopup.js → MobilePopup/index.js} +42 -41
  56. package/{Modal.js → Modal/index.js} +39 -40
  57. package/ModuleTitle/index.js +143 -0
  58. package/{NavigationMenu.js → NavigationMenu/index.js} +30 -29
  59. package/Notification/index.js +119 -0
  60. package/Option/index.js +184 -0
  61. package/Overlay/index.js +189 -0
  62. package/Overspread/index.js +289 -0
  63. package/{Pagination.js → Pagination/index.js} +35 -34
  64. package/Paper/index.js +96 -0
  65. package/{index-084588e9.js → Popover/index.js} +48 -58
  66. package/PopoverV2/index.js +18 -0
  67. package/{Portal.js → Portal/index.js} +7 -8
  68. package/{Products.js → Products/index.js} +20 -21
  69. package/Profile/index.js +585 -0
  70. package/Progress/index.js +199 -0
  71. package/{QRCode.js → QRCode/index.js} +4 -6
  72. package/{Radio.js → Radio/index.js} +25 -26
  73. package/{RadioGroup.js → RadioGroup/index.js} +17 -18
  74. package/{index-00fe8887.js → Range/index.js} +29 -32
  75. package/RichEditor/index.js +13 -0
  76. package/{RichEditor-98accead.js → RichEditor-8b0f7ccd.js} +18 -18
  77. package/{Scrollbar.js → Scrollbar/index.js} +15 -17
  78. package/{Search.js → Search/index.js} +25 -24
  79. package/SearchWithDropdown/index.js +138 -0
  80. package/Section/index.js +61 -0
  81. package/{SkeletonLoader.js → SkeletonLoader/index.js} +13 -14
  82. package/{Slider.js → Slider/index.js} +46 -43
  83. package/Status/index.js +103 -0
  84. package/Steps/index.js +313 -0
  85. package/{index-897d8240.js → SuggestionList/index.js} +15 -38
  86. package/{Switcher.js → Switcher/index.js} +30 -31
  87. package/Table/index.js +53 -0
  88. package/{TableCompositions.js → TableCompositions/index.js} +131 -168
  89. package/Tabs/index.js +235 -0
  90. package/Tag/index.js +102 -0
  91. package/{TextLink.js → TextLink/index.js} +3 -3
  92. package/{Textarea.js → Textarea/index.js} +66 -65
  93. package/{Time.js → Time/index.js} +13 -14
  94. package/TimePicker/index.js +555 -0
  95. package/Timeline/index.js +113 -0
  96. package/Title/index.js +65 -0
  97. package/{Toaster.js → Toaster/index.js} +19 -20
  98. package/{Tooltip.js → Tooltip/index.js} +27 -28
  99. package/{TransferList.js → TransferList/index.js} +44 -55
  100. package/{index-135b9d17.js → Uploader/index.js} +119 -116
  101. package/{ValidatableCheckbox.js → ValidatableCheckbox/index.js} +23 -24
  102. package/{ValidatableDatePicker.js → ValidatableDatePicker/index.js} +44 -42
  103. package/ValidatableDropdown/index.js +139 -0
  104. package/ValidatableElements/index.js +65 -0
  105. package/ValidatableMultiSelectDropdown/index.js +150 -0
  106. package/{ValidatableNumberInput.js → ValidatableNumberInput/index.js} +41 -33
  107. package/{ValidatableRadio.js → ValidatableRadio/index.js} +19 -20
  108. package/{ValidatableSwitcher.js → ValidatableSwitcher/index.js} +19 -20
  109. package/{ValidatableTextInput.js → ValidatableTextInput/index.js} +32 -31
  110. package/{ValidatableTimeInput.js → ValidatableTimeInput/index.js} +31 -30
  111. package/{ValidatableUploader.js → ValidatableUploader/index.js} +36 -34
  112. package/Widget/index.js +227 -0
  113. package/config-0ca92874.js +31 -0
  114. package/{configs-91c86664.js → configs-fed6ac34.js} +28 -1
  115. package/hooks/useBodyScroll.js +16 -0
  116. package/hooks/useClick.js +18 -0
  117. package/{useClickOutside-5183e396.js → hooks/useClickOutside.js} +1 -1
  118. package/hooks/useDebounceHook.js +16 -0
  119. package/{useDeviceType-dd51db38.js → hooks/useDeviceType.js} +4 -3
  120. package/hooks/useDidMount.js +15 -0
  121. package/{useEllipsisDetection-ef536015.js → hooks/useEllipsisDetection.js} +1 -1
  122. package/hooks/useForceUpdate.js +8 -0
  123. package/hooks/useImgDownload.js +18 -0
  124. package/{useKeyDown-38102ae7.js → hooks/useKeyDown.js} +1 -1
  125. package/hooks/useMount.js +13 -0
  126. package/hooks/useMutationObserver.js +21 -0
  127. package/hooks/usePrevious.js +10 -0
  128. package/hooks/useThrottle.js +16 -0
  129. package/hooks/useToggle.js +11 -0
  130. package/hooks/useUpdatableRef.js +14 -0
  131. package/hooks/useUpdate.js +10 -0
  132. package/{useWidth-9f4647f8.js → hooks/useWidth.js} +2 -2
  133. package/{useWindowSize-80369d76.js → hooks/useWindowSize.js} +1 -1
  134. package/{index-8c98317a.js → index-11eea761.js} +678 -752
  135. package/index-2ad83e03.js +4 -0
  136. package/index-34e47647.js +10054 -0
  137. package/index-45eafea6.js +90 -0
  138. package/{index-5e96cb4d.js → index-462461c0.js} +50 -48
  139. package/{index-ac59cb10.js → index-a0e4e333.js} +6 -6
  140. package/{index-e8776f3d.js → index-b1e429a7.js} +1 -1
  141. package/index.d.ts +115 -0
  142. package/index.js +137 -113
  143. package/index.mobile.d.ts +16 -0
  144. package/lib/atoms/Avatar/Avatar.d.ts +34 -0
  145. package/lib/atoms/Avatar/index.d.ts +1 -0
  146. package/lib/atoms/LinkButton/LinkButton.d.ts +46 -0
  147. package/lib/atoms/LinkButton/index.d.ts +1 -0
  148. package/{objectWithoutPropertiesLoose-299691d8.js → objectWithoutPropertiesLoose-d8a4a68c.js} +12 -12
  149. package/package.json +42 -22
  150. package/{rangeAndSlider-20599da4.js → rangeAndSlider-0301a458.js} +220 -375
  151. package/{react-beautiful-dnd.esm-38c37304.js → react-beautiful-dnd.esm-04c14563.js} +9 -9
  152. package/react-lifecycles-compat.es-6e1f3768.js +158 -0
  153. package/Alert.js +0 -98
  154. package/Avatar.js +0 -77
  155. package/Badge.js +0 -76
  156. package/BusyLoader.js +0 -69
  157. package/Button.js +0 -130
  158. package/Charts.js +0 -99
  159. package/ComboBox.js +0 -99
  160. package/Counter.js +0 -99
  161. package/DatePickerInput.js +0 -30
  162. package/Dropdown.js +0 -99
  163. package/Form.js +0 -116
  164. package/FormableCheckbox.js +0 -27
  165. package/FormableDatePicker.js +0 -39
  166. package/FormableDropdown.js +0 -105
  167. package/FormableEditor.js +0 -24
  168. package/FormableMultiSelectDropdown.js +0 -105
  169. package/FormableNumberInput.js +0 -31
  170. package/FormableRadio.js +0 -23
  171. package/FormableSwitcher.js +0 -23
  172. package/FormableTextInput.js +0 -31
  173. package/FormableUploader.js +0 -40
  174. package/GeneUIProvider.js +0 -256
  175. package/Holder.js +0 -99
  176. package/Image.js +0 -130
  177. package/ImagePreview.js +0 -99
  178. package/Label.js +0 -58
  179. package/LinkButton.js +0 -104
  180. package/MobileNavigation.js +0 -95
  181. package/ModuleTitle.js +0 -99
  182. package/Notification.js +0 -120
  183. package/Option.js +0 -186
  184. package/Overlay.js +0 -99
  185. package/Overspread.js +0 -343
  186. package/Paper.js +0 -97
  187. package/Popover.js +0 -20
  188. package/PopoverV2.js +0 -19
  189. package/Profile.js +0 -99
  190. package/Progress.js +0 -200
  191. package/Range.js +0 -14
  192. package/RichEditor.js +0 -13
  193. package/SearchWithDropdown.js +0 -195
  194. package/Section.js +0 -62
  195. package/Status.js +0 -104
  196. package/Steps.js +0 -312
  197. package/SuggestionList.js +0 -15
  198. package/Table.js +0 -102
  199. package/Tabs.js +0 -236
  200. package/Tag.js +0 -103
  201. package/TimePicker.js +0 -99
  202. package/Timeline.js +0 -114
  203. package/Title.js +0 -66
  204. package/Uploader.js +0 -32
  205. package/ValidatableDropdown.js +0 -99
  206. package/ValidatableElements.js +0 -99
  207. package/ValidatableMultiSelectDropdown.js +0 -99
  208. package/Widget.js +0 -99
  209. package/globalStyling-9c60a159.js +0 -4
  210. package/index-2030e31c.js +0 -4
  211. package/index-b7a33c58.js +0 -11
  212. package/index-e0af0caf.js +0 -1182
  213. package/useMount-6fef51a5.js +0 -9
@@ -79,6 +79,7 @@ const widgetConfig = {
79
79
  const customScrollbarConfig = {
80
80
  size: ['medium', 'small']
81
81
  };
82
+ const noDataConfig = ['data', 'image', 'search'];
82
83
  const timePickerConfig = {
83
84
  appearance: ['multipleInputs', 'singleInput']
84
85
  };
@@ -92,5 +93,31 @@ const optionConfig = {
92
93
  end: 'end'
93
94
  }
94
95
  };
96
+ const keyValueConfig = {
97
+ appearance: {
98
+ horizontal: {
99
+ _key: 'horizontal',
100
+ parentItemClassName: 'geneKeyValue--horizontal',
101
+ labelClassName: 'geneKeyValue__label--horizontal',
102
+ valueClassName: 'geneKeyValue__value--horizontal',
103
+ iconClassName: 'geneKeyValue__icon--horizontal'
104
+ },
105
+ vertical: {
106
+ _key: 'vertical',
107
+ parentItemClassName: '',
108
+ itemClassName: ''
109
+ }
110
+ }
111
+ };
112
+ const advancedSearchConfig = {
113
+ positions: {
114
+ right: 'right',
115
+ left: 'left'
116
+ }
117
+ };
118
+ const badgeConfig = {
119
+ color: ['danger', 'primary'],
120
+ size: ['default', 'medium', 'big', 'huge']
121
+ };
95
122
 
96
- export { clientConfigs as a, titleConfig as b, checkboxRadioSwitcherConfig as c, popoverConfig as d, popoverV2Config as e, customScrollbarConfig as f, breakPoints as g, stepsConfig as h, inputConfig as i, moduleTitleConfig as j, timePickerConfig as k, mobileScreenSize as m, optionConfig as o, positions as p, screenTypes as s, tagConfig as t, uploaderConfig as u, widgetConfig as w };
123
+ export { clientConfigs as a, badgeConfig as b, checkboxRadioSwitcherConfig as c, moduleTitleConfig as d, popoverConfig as e, tagConfig as f, popoverV2Config as g, timePickerConfig as h, inputConfig as i, advancedSearchConfig as j, keyValueConfig as k, customScrollbarConfig as l, mobileScreenSize as m, noDataConfig as n, optionConfig as o, positions as p, breakPoints as q, stepsConfig as r, screenTypes as s, titleConfig as t, uploaderConfig as u, widgetConfig as w };
@@ -0,0 +1,16 @@
1
+ import { useCallback } from 'react';
2
+
3
+ function useBodyScroll() {
4
+ const lock = useCallback(() => {
5
+ document.body.style.overflow = 'hidden';
6
+ }, []);
7
+ const unlock = useCallback(() => {
8
+ document.body.style.overflow = 'auto';
9
+ }, []);
10
+ return {
11
+ lock,
12
+ unlock
13
+ };
14
+ }
15
+
16
+ export { useBodyScroll as default };
@@ -0,0 +1,18 @@
1
+ import { useRef, useCallback, useEffect } from 'react';
2
+
3
+ function useClick(callback) {
4
+ const ref = useRef();
5
+ const handleClick = useCallback(e => {
6
+ if (ref.current && ref.current.contains(e.target)) {
7
+ callback && callback(e);
8
+ }
9
+ }, [ref.current, callback]);
10
+ useEffect(() => {
11
+ document.addEventListener('mousedown', handleClick);
12
+ return () => document.removeEventListener('mousedown', handleClick);
13
+ }, [handleClick]);
14
+ const setRef = node => ref.current = node;
15
+ return setRef;
16
+ }
17
+
18
+ export { useClick as default };
@@ -22,4 +22,4 @@ function useClickOutside(callback, relativeElements) {
22
22
  return node => ref.current = node;
23
23
  }
24
24
 
25
- export { useClickOutside as u };
25
+ export { useClickOutside as default };
@@ -0,0 +1,16 @@
1
+ import { useState, useEffect } from 'react';
2
+
3
+ const useDebounce = (value, delay) => {
4
+ const [debouncedValue, setDebouncedValue] = useState(value);
5
+ useEffect(() => {
6
+ const handler = setTimeout(() => {
7
+ setDebouncedValue(value);
8
+ }, delay);
9
+ return () => {
10
+ clearTimeout(handler);
11
+ };
12
+ }, [delay, value]);
13
+ return debouncedValue;
14
+ };
15
+
16
+ export { useDebounce as default };
@@ -1,5 +1,6 @@
1
- import { a as clientConfigs, m as mobileScreenSize } from './configs-91c86664.js';
2
- import { u as useWindowSize } from './useWindowSize-80369d76.js';
1
+ import { a as clientConfigs, m as mobileScreenSize } from '../configs-fed6ac34.js';
2
+ import useWindowSize from './useWindowSize.js';
3
+ import 'react';
3
4
 
4
5
  function useDeviceType(screenType) {
5
6
  const {
@@ -12,4 +13,4 @@ function useDeviceType(screenType) {
12
13
  };
13
14
  }
14
15
 
15
- export { useDeviceType as u };
16
+ export { useDeviceType as default };
@@ -0,0 +1,15 @@
1
+ import { useRef, useEffect } from 'react';
2
+
3
+ const useDidMount = function () {
4
+ let callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : () => {};
5
+ let deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
6
+ const _isFirstUpdate = useRef(true);
7
+ useEffect(() => {
8
+ if (!_isFirstUpdate.current) {
9
+ callback();
10
+ }
11
+ _isFirstUpdate.current = false;
12
+ }, deps);
13
+ };
14
+
15
+ export { useDidMount as default };
@@ -20,4 +20,4 @@ const useEllipsisDetection = function (ref) {
20
20
  return isTruncated;
21
21
  };
22
22
 
23
- export { useEllipsisDetection as u };
23
+ export { useEllipsisDetection as default };
@@ -0,0 +1,8 @@
1
+ import { useReducer } from 'react';
2
+
3
+ const useForceUpdate = () => {
4
+ const [ignored, forceUpdate] = useReducer(x => x + 1, 0);
5
+ return forceUpdate;
6
+ };
7
+
8
+ export { useForceUpdate as default };
@@ -0,0 +1,18 @@
1
+ import { useCallback } from 'react';
2
+
3
+ const useImgDownload = () => useCallback(function (url, name) {
4
+ let customHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
5
+ fetch(url, {
6
+ headers: {
7
+ ...customHeaders
8
+ }
9
+ }).then(response => response.blob()).then(blob => {
10
+ const blobURL = URL.createObjectURL(blob);
11
+ const a = document.createElement('a');
12
+ a.href = blobURL;
13
+ a.download = name && name.length ? name : 'download';
14
+ a.click();
15
+ }).catch(error => console.log(error));
16
+ }, []);
17
+
18
+ export { useImgDownload as default };
@@ -18,4 +18,4 @@ const useKeyDown = function (callback, deps, ref) {
18
18
  }, [handleKeyDown, ref.current]);
19
19
  };
20
20
 
21
- export { useKeyDown as u };
21
+ export { useKeyDown as default };
@@ -0,0 +1,13 @@
1
+ import { useEffect } from 'react';
2
+ import { n as noop } from '../index-a0e4e333.js';
3
+ import 'prop-types';
4
+ import '../dateValidation-67caec66.js';
5
+ import '../_commonjsHelpers-24198af3.js';
6
+ import 'react-dom';
7
+
8
+ const useMount = function () {
9
+ let onMount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;
10
+ return useEffect(onMount, []);
11
+ };
12
+
13
+ export { useMount as default };
@@ -0,0 +1,21 @@
1
+ import { useEffect } from 'react';
2
+
3
+ const defaultOptions = {
4
+ attributes: true,
5
+ childList: true,
6
+ subtree: true
7
+ };
8
+ const useMutationObserver = function (ref, callback) {
9
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultOptions;
10
+ useEffect(() => {
11
+ if (ref.current) {
12
+ const observer = new MutationObserver(callback);
13
+ observer.observe(ref.current, options);
14
+ return () => {
15
+ observer.disconnect();
16
+ };
17
+ }
18
+ }, [callback, options]);
19
+ };
20
+
21
+ export { useMutationObserver as default };
@@ -0,0 +1,10 @@
1
+ import { useRef, useMemo } from 'react';
2
+
3
+ const usePrevious = (callback, deps) => {
4
+ const previous = useRef();
5
+ const value = useMemo(() => callback(previous.current), deps);
6
+ previous.current = value;
7
+ return value;
8
+ };
9
+
10
+ export { usePrevious as default };
@@ -0,0 +1,16 @@
1
+ import { useRef, useCallback } from 'react';
2
+
3
+ const useThrottle = (callback, delay) => {
4
+ const ref = useRef(null);
5
+ return useCallback(function () {
6
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
7
+ args[_key] = arguments[_key];
8
+ }
9
+ clearTimeout(ref.current);
10
+ ref.current = setTimeout(() => {
11
+ callback(...args);
12
+ }, delay);
13
+ }, [callback, delay]);
14
+ };
15
+
16
+ export { useThrottle as default };
@@ -0,0 +1,11 @@
1
+ import { useState, useCallback } from 'react';
2
+
3
+ function useToggle(defaultValue) {
4
+ const [state, setState] = useState(!!defaultValue);
5
+ const toggle = useCallback(value => {
6
+ setState(prev => typeof value === 'undefined' ? !prev : !!value);
7
+ }, []);
8
+ return [state, toggle];
9
+ }
10
+
11
+ export { useToggle as default };
@@ -0,0 +1,14 @@
1
+ import { useRef, useCallback } from 'react';
2
+ import useForceUpdate from './useForceUpdate.js';
3
+
4
+ const useUpdatableRef = initial => {
5
+ const ref = useRef(initial);
6
+ const forceUpdate = useForceUpdate();
7
+ const update = useCallback(value => {
8
+ if (ref.current !== value) forceUpdate();
9
+ ref.current = value;
10
+ }, []);
11
+ return [ref, update];
12
+ };
13
+
14
+ export { useUpdatableRef as default };
@@ -0,0 +1,10 @@
1
+ import { useRef, useEffect } from 'react';
2
+
3
+ function useUpdate(callback, dependencies) {
4
+ const initial = useRef(true);
5
+ useEffect(initial.current ? () => {
6
+ initial.current = false;
7
+ } : callback, dependencies);
8
+ }
9
+
10
+ export { useUpdate as default };
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect } from 'react';
2
- import { u as useWindowSize } from './useWindowSize-80369d76.js';
2
+ import useWindowSize from './useWindowSize.js';
3
3
 
4
4
  function useWidth(ref) {
5
5
  const [width, setWidth] = useState(null);
@@ -12,4 +12,4 @@ function useWidth(ref) {
12
12
  return width;
13
13
  }
14
14
 
15
- export { useWidth as u };
15
+ export { useWidth as default };
@@ -30,4 +30,4 @@ function useWindowSize() {
30
30
  };
31
31
  }
32
32
 
33
- export { useWindowSize as u };
33
+ export { useWindowSize as default };