@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.
- package/{ActionableList.js → ActionableList/index.js} +83 -152
- package/{AdvancedSearch.js → AdvancedSearch/index.js} +290 -304
- package/Alert/index.js +97 -0
- package/Avatar/index.js +30 -0
- package/Badge/index.js +75 -0
- package/{Breadcrumb.js → Breadcrumb/index.js} +32 -31
- package/BusyLoader/index.js +68 -0
- package/Button/index.js +129 -0
- package/CHANGELOG.md +53 -0
- package/{Card.js → Card/index.js} +82 -94
- package/{CardList.js → CardList/index.js} +120 -165
- package/{CellMeasurerCache-b786dd93.js → CellMeasurerCache-3741d716.js} +2 -2
- package/{index-9164a86d.js → Charts/index.js} +17103 -30447
- package/{Checkbox.js → Checkbox/index.js} +37 -38
- package/{CheckboxGroup.js → CheckboxGroup/index.js} +41 -42
- package/{CheckboxGroupWithSearch.js → CheckboxGroupWithSearch/index.js} +64 -65
- package/{Collapse.js → Collapse/index.js} +28 -29
- package/{ColorPicker.js → ColorPicker/index.js} +16 -16
- package/ComboBox/index.js +525 -0
- package/Counter/index.js +310 -0
- package/{DateFilter.js → DateFilter/index.js} +45 -43
- package/{DatePicker.js → DatePicker/index.js} +106 -108
- package/{index-0199942c.js → DatePickerInput/index.js} +114 -100
- package/{Divider.js → Divider/index.js} +9 -10
- package/{Drawer.js → Drawer/index.js} +40 -41
- package/Dropdown/index.js +41 -0
- package/{Editor.js → Editor/index.js} +165 -164
- package/{Empty.js → Empty/index.js} +12 -13
- package/{ExtendedInput.js → ExtendedInput/index.js} +81 -71
- package/Form/index.js +83 -0
- package/{FormContainer.js → FormContainer/index.js} +25 -26
- package/FormableCheckbox/index.js +26 -0
- package/FormableDatePicker/index.js +41 -0
- package/FormableDropdown/index.js +48 -0
- package/FormableEditor/index.js +24 -0
- package/{FormableHOC-21051057.js → FormableHOC-55263162.js} +3 -3
- package/FormableMultiSelectDropdown/index.js +48 -0
- package/FormableNumberInput/index.js +32 -0
- package/FormableRadio/index.js +22 -0
- package/FormableSwitcher/index.js +22 -0
- package/FormableTextInput/index.js +32 -0
- package/FormableUploader/index.js +42 -0
- package/GeneUIProvider/index.js +282 -0
- package/{Grid.js → Grid/index.js} +27 -27
- package/Holder/index.js +261 -0
- package/{Icon.js → Icon/index.js} +9 -10
- package/Image/index.js +129 -0
- package/ImagePreview/index.js +481 -0
- package/{KeyValue.js → KeyValue/index.js} +11 -12
- package/LICENSE +21 -0
- package/Label/index.js +57 -0
- package/LinkButton/index.js +67 -0
- package/{Menu.js → Menu/index.js} +27 -28
- package/MobileNavigation/index.js +94 -0
- package/{MobilePopup.js → MobilePopup/index.js} +42 -41
- package/{Modal.js → Modal/index.js} +39 -40
- package/ModuleTitle/index.js +143 -0
- package/{NavigationMenu.js → NavigationMenu/index.js} +30 -29
- package/Notification/index.js +119 -0
- package/Option/index.js +184 -0
- package/Overlay/index.js +189 -0
- package/Overspread/index.js +289 -0
- package/{Pagination.js → Pagination/index.js} +35 -34
- package/Paper/index.js +96 -0
- package/{index-084588e9.js → Popover/index.js} +48 -58
- package/PopoverV2/index.js +18 -0
- package/{Portal.js → Portal/index.js} +7 -8
- package/{Products.js → Products/index.js} +20 -21
- package/Profile/index.js +585 -0
- package/Progress/index.js +199 -0
- package/{QRCode.js → QRCode/index.js} +4 -6
- package/{Radio.js → Radio/index.js} +25 -26
- package/{RadioGroup.js → RadioGroup/index.js} +17 -18
- package/{index-00fe8887.js → Range/index.js} +29 -32
- package/RichEditor/index.js +13 -0
- package/{RichEditor-98accead.js → RichEditor-8b0f7ccd.js} +18 -18
- package/{Scrollbar.js → Scrollbar/index.js} +15 -17
- package/{Search.js → Search/index.js} +25 -24
- package/SearchWithDropdown/index.js +138 -0
- package/Section/index.js +61 -0
- package/{SkeletonLoader.js → SkeletonLoader/index.js} +13 -14
- package/{Slider.js → Slider/index.js} +46 -43
- package/Status/index.js +103 -0
- package/Steps/index.js +313 -0
- package/{index-897d8240.js → SuggestionList/index.js} +15 -38
- package/{Switcher.js → Switcher/index.js} +30 -31
- package/Table/index.js +53 -0
- package/{TableCompositions.js → TableCompositions/index.js} +131 -168
- package/Tabs/index.js +235 -0
- package/Tag/index.js +102 -0
- package/{TextLink.js → TextLink/index.js} +3 -3
- package/{Textarea.js → Textarea/index.js} +66 -65
- package/{Time.js → Time/index.js} +13 -14
- package/TimePicker/index.js +555 -0
- package/Timeline/index.js +113 -0
- package/Title/index.js +65 -0
- package/{Toaster.js → Toaster/index.js} +19 -20
- package/{Tooltip.js → Tooltip/index.js} +27 -28
- package/{TransferList.js → TransferList/index.js} +44 -55
- package/{index-135b9d17.js → Uploader/index.js} +119 -116
- package/{ValidatableCheckbox.js → ValidatableCheckbox/index.js} +23 -24
- package/{ValidatableDatePicker.js → ValidatableDatePicker/index.js} +44 -42
- package/ValidatableDropdown/index.js +139 -0
- package/ValidatableElements/index.js +65 -0
- package/ValidatableMultiSelectDropdown/index.js +150 -0
- package/{ValidatableNumberInput.js → ValidatableNumberInput/index.js} +41 -33
- package/{ValidatableRadio.js → ValidatableRadio/index.js} +19 -20
- package/{ValidatableSwitcher.js → ValidatableSwitcher/index.js} +19 -20
- package/{ValidatableTextInput.js → ValidatableTextInput/index.js} +32 -31
- package/{ValidatableTimeInput.js → ValidatableTimeInput/index.js} +31 -30
- package/{ValidatableUploader.js → ValidatableUploader/index.js} +36 -34
- package/Widget/index.js +227 -0
- package/config-0ca92874.js +31 -0
- package/{configs-91c86664.js → configs-fed6ac34.js} +28 -1
- package/hooks/useBodyScroll.js +16 -0
- package/hooks/useClick.js +18 -0
- package/{useClickOutside-5183e396.js → hooks/useClickOutside.js} +1 -1
- package/hooks/useDebounceHook.js +16 -0
- package/{useDeviceType-dd51db38.js → hooks/useDeviceType.js} +4 -3
- package/hooks/useDidMount.js +15 -0
- package/{useEllipsisDetection-ef536015.js → hooks/useEllipsisDetection.js} +1 -1
- package/hooks/useForceUpdate.js +8 -0
- package/hooks/useImgDownload.js +18 -0
- package/{useKeyDown-38102ae7.js → hooks/useKeyDown.js} +1 -1
- package/hooks/useMount.js +13 -0
- package/hooks/useMutationObserver.js +21 -0
- package/hooks/usePrevious.js +10 -0
- package/hooks/useThrottle.js +16 -0
- package/hooks/useToggle.js +11 -0
- package/hooks/useUpdatableRef.js +14 -0
- package/hooks/useUpdate.js +10 -0
- package/{useWidth-9f4647f8.js → hooks/useWidth.js} +2 -2
- package/{useWindowSize-80369d76.js → hooks/useWindowSize.js} +1 -1
- package/{index-8c98317a.js → index-11eea761.js} +678 -752
- package/index-2ad83e03.js +4 -0
- package/index-34e47647.js +10054 -0
- package/index-45eafea6.js +90 -0
- package/{index-5e96cb4d.js → index-462461c0.js} +50 -48
- package/{index-ac59cb10.js → index-a0e4e333.js} +6 -6
- package/{index-e8776f3d.js → index-b1e429a7.js} +1 -1
- package/index.d.ts +115 -0
- package/index.js +137 -113
- package/index.mobile.d.ts +16 -0
- package/lib/atoms/Avatar/Avatar.d.ts +34 -0
- package/lib/atoms/Avatar/index.d.ts +1 -0
- package/lib/atoms/LinkButton/LinkButton.d.ts +46 -0
- package/lib/atoms/LinkButton/index.d.ts +1 -0
- package/{objectWithoutPropertiesLoose-299691d8.js → objectWithoutPropertiesLoose-d8a4a68c.js} +12 -12
- package/package.json +42 -22
- package/{rangeAndSlider-20599da4.js → rangeAndSlider-0301a458.js} +220 -375
- package/{react-beautiful-dnd.esm-38c37304.js → react-beautiful-dnd.esm-04c14563.js} +9 -9
- package/react-lifecycles-compat.es-6e1f3768.js +158 -0
- package/Alert.js +0 -98
- package/Avatar.js +0 -77
- package/Badge.js +0 -76
- package/BusyLoader.js +0 -69
- package/Button.js +0 -130
- package/Charts.js +0 -99
- package/ComboBox.js +0 -99
- package/Counter.js +0 -99
- package/DatePickerInput.js +0 -30
- package/Dropdown.js +0 -99
- package/Form.js +0 -116
- package/FormableCheckbox.js +0 -27
- package/FormableDatePicker.js +0 -39
- package/FormableDropdown.js +0 -105
- package/FormableEditor.js +0 -24
- package/FormableMultiSelectDropdown.js +0 -105
- package/FormableNumberInput.js +0 -31
- package/FormableRadio.js +0 -23
- package/FormableSwitcher.js +0 -23
- package/FormableTextInput.js +0 -31
- package/FormableUploader.js +0 -40
- package/GeneUIProvider.js +0 -256
- package/Holder.js +0 -99
- package/Image.js +0 -130
- package/ImagePreview.js +0 -99
- package/Label.js +0 -58
- package/LinkButton.js +0 -104
- package/MobileNavigation.js +0 -95
- package/ModuleTitle.js +0 -99
- package/Notification.js +0 -120
- package/Option.js +0 -186
- package/Overlay.js +0 -99
- package/Overspread.js +0 -343
- package/Paper.js +0 -97
- package/Popover.js +0 -20
- package/PopoverV2.js +0 -19
- package/Profile.js +0 -99
- package/Progress.js +0 -200
- package/Range.js +0 -14
- package/RichEditor.js +0 -13
- package/SearchWithDropdown.js +0 -195
- package/Section.js +0 -62
- package/Status.js +0 -104
- package/Steps.js +0 -312
- package/SuggestionList.js +0 -15
- package/Table.js +0 -102
- package/Tabs.js +0 -236
- package/Tag.js +0 -103
- package/TimePicker.js +0 -99
- package/Timeline.js +0 -114
- package/Title.js +0 -66
- package/Uploader.js +0 -32
- package/ValidatableDropdown.js +0 -99
- package/ValidatableElements.js +0 -99
- package/ValidatableMultiSelectDropdown.js +0 -99
- package/Widget.js +0 -99
- package/globalStyling-9c60a159.js +0 -4
- package/index-2030e31c.js +0 -4
- package/index-b7a33c58.js +0 -11
- package/index-e0af0caf.js +0 -1182
- package/useMount-6fef51a5.js +0 -9
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { _ as _extends } from '
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
2
|
import React__default, { forwardRef, useState, useCallback, useEffect } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import { n as noop } from '
|
|
5
|
-
import
|
|
6
|
-
import '
|
|
7
|
-
import RadioGroup from '
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { n as noop } from '../index-a0e4e333.js';
|
|
5
|
+
import useMount from '../hooks/useMount.js';
|
|
6
|
+
import '../configs-fed6ac34.js';
|
|
7
|
+
import RadioGroup from '../RadioGroup/index.js';
|
|
8
|
+
import '../dateValidation-67caec66.js';
|
|
9
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
10
10
|
import 'react-dom';
|
|
11
|
-
import '
|
|
12
|
-
import '
|
|
13
|
-
import '
|
|
14
|
-
import '
|
|
15
|
-
import '
|
|
16
|
-
import './guid-8ddf77b3.js';
|
|
11
|
+
import '../index-6ff23041.js';
|
|
12
|
+
import '../Radio/index.js';
|
|
13
|
+
import '../checkboxRadioSwitcher-5b69d7bd.js';
|
|
14
|
+
import '../style-inject.es-746bb8ed.js';
|
|
15
|
+
import '../guid-8ddf77b3.js';
|
|
17
16
|
|
|
18
17
|
function checkValidation(required, isValid) {
|
|
19
18
|
let value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
@@ -86,27 +85,27 @@ Radio.propTypes = {
|
|
|
86
85
|
/**
|
|
87
86
|
* Value for radio field
|
|
88
87
|
*/
|
|
89
|
-
value:
|
|
88
|
+
value: PropTypes.string,
|
|
90
89
|
/**
|
|
91
90
|
* Callback fires when radio field changes
|
|
92
91
|
*/
|
|
93
|
-
onChange:
|
|
92
|
+
onChange: PropTypes.func,
|
|
94
93
|
/**
|
|
95
94
|
* Define is field required or no.
|
|
96
95
|
*/
|
|
97
|
-
required:
|
|
96
|
+
required: PropTypes.bool,
|
|
98
97
|
/**
|
|
99
98
|
* Callback fires when field validation state changes
|
|
100
99
|
*/
|
|
101
|
-
isFieldValid:
|
|
100
|
+
isFieldValid: PropTypes.func,
|
|
102
101
|
/**
|
|
103
102
|
* Additional validation state
|
|
104
103
|
*/
|
|
105
|
-
isValid:
|
|
104
|
+
isValid: PropTypes.bool,
|
|
106
105
|
/**
|
|
107
106
|
* Allow validation without onBlur, validate field when mount
|
|
108
107
|
*/
|
|
109
|
-
forceAllowValidation:
|
|
108
|
+
forceAllowValidation: PropTypes.bool
|
|
110
109
|
};
|
|
111
110
|
Radio.defaultProps = {
|
|
112
111
|
isValid: true,
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { _ as _extends } from '
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
2
|
import React__default, { forwardRef, useState, useCallback, useEffect } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import { n as noop } from '
|
|
5
|
-
import
|
|
6
|
-
import '
|
|
7
|
-
import Switcher from '
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { n as noop } from '../index-a0e4e333.js';
|
|
5
|
+
import useMount from '../hooks/useMount.js';
|
|
6
|
+
import '../configs-fed6ac34.js';
|
|
7
|
+
import Switcher from '../Switcher/index.js';
|
|
8
|
+
import '../dateValidation-67caec66.js';
|
|
9
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
10
10
|
import 'react-dom';
|
|
11
|
-
import '
|
|
12
|
-
import '
|
|
13
|
-
import '
|
|
14
|
-
import '
|
|
15
|
-
import '
|
|
16
|
-
import './guid-8ddf77b3.js';
|
|
11
|
+
import '../index-6ff23041.js';
|
|
12
|
+
import '../hooks/useKeyDown.js';
|
|
13
|
+
import '../checkboxRadioSwitcher-5b69d7bd.js';
|
|
14
|
+
import '../style-inject.es-746bb8ed.js';
|
|
15
|
+
import '../guid-8ddf77b3.js';
|
|
17
16
|
|
|
18
17
|
function checkValidation(value, required, isValid) {
|
|
19
18
|
if (required && !value) return {
|
|
@@ -78,12 +77,12 @@ const SwitcherElement = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
78
77
|
}, restProps));
|
|
79
78
|
});
|
|
80
79
|
SwitcherElement.propTypes = {
|
|
81
|
-
onChange:
|
|
82
|
-
required:
|
|
83
|
-
checked:
|
|
84
|
-
isFieldValid:
|
|
85
|
-
isValid:
|
|
86
|
-
forceAllowValidation:
|
|
80
|
+
onChange: PropTypes.func,
|
|
81
|
+
required: PropTypes.bool,
|
|
82
|
+
checked: PropTypes.bool,
|
|
83
|
+
isFieldValid: PropTypes.func,
|
|
84
|
+
isValid: PropTypes.bool,
|
|
85
|
+
forceAllowValidation: PropTypes.bool
|
|
87
86
|
};
|
|
88
87
|
SwitcherElement.defaultProps = {
|
|
89
88
|
isValid: true,
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { _ as _extends } from '
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
2
|
import React__default, { forwardRef, useState, useCallback, useEffect } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import { n as noop } from '
|
|
5
|
-
import
|
|
6
|
-
import '
|
|
7
|
-
import ExtendedInput from '
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { n as noop } from '../index-a0e4e333.js';
|
|
5
|
+
import useMount from '../hooks/useMount.js';
|
|
6
|
+
import '../configs-fed6ac34.js';
|
|
7
|
+
import ExtendedInput from '../ExtendedInput/index.js';
|
|
8
|
+
import '../dateValidation-67caec66.js';
|
|
9
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
10
10
|
import 'react-dom';
|
|
11
|
-
import '
|
|
12
|
-
import '
|
|
13
|
-
import '
|
|
14
|
-
import '
|
|
15
|
-
import '
|
|
16
|
-
import '
|
|
17
|
-
import '
|
|
18
|
-
import '
|
|
19
|
-
import '
|
|
20
|
-
import '
|
|
21
|
-
import '
|
|
22
|
-
import '
|
|
23
|
-
import '
|
|
11
|
+
import '../index-6ff23041.js';
|
|
12
|
+
import '../hooks/useDeviceType.js';
|
|
13
|
+
import '../hooks/useWindowSize.js';
|
|
14
|
+
import '../hooks/useEllipsisDetection.js';
|
|
15
|
+
import '../Icon/index.js';
|
|
16
|
+
import '../style-inject.es-746bb8ed.js';
|
|
17
|
+
import '../SuggestionList/index.js';
|
|
18
|
+
import '../hooks/useKeyDown.js';
|
|
19
|
+
import '../hooks/useClickOutside.js';
|
|
20
|
+
import '../config-0ca92874.js';
|
|
21
|
+
import '../Scrollbar/index.js';
|
|
22
|
+
import '../Tooltip/index.js';
|
|
23
|
+
import '../Popover-f4d1cac0.js';
|
|
24
|
+
import '../GeneUIProvider/index.js';
|
|
24
25
|
|
|
25
26
|
const emailRegExp = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
26
27
|
function checkValidation(required, isValid, maxLength, minLength, isEmail) {
|
|
@@ -117,43 +118,43 @@ TextInput.propTypes = {
|
|
|
117
118
|
/**
|
|
118
119
|
* Value for text input
|
|
119
120
|
*/
|
|
120
|
-
value:
|
|
121
|
+
value: PropTypes.string,
|
|
121
122
|
/**
|
|
122
123
|
* Callback fires when field changes
|
|
123
124
|
*/
|
|
124
|
-
onChange:
|
|
125
|
+
onChange: PropTypes.func,
|
|
125
126
|
/**
|
|
126
127
|
* Callback fires when field blured
|
|
127
128
|
*/
|
|
128
|
-
onBlur:
|
|
129
|
+
onBlur: PropTypes.func,
|
|
129
130
|
/**
|
|
130
131
|
* Define is field required or no.
|
|
131
132
|
*/
|
|
132
|
-
required:
|
|
133
|
+
required: PropTypes.bool,
|
|
133
134
|
/**
|
|
134
135
|
* Is field accept only email or no
|
|
135
136
|
*/
|
|
136
|
-
isEmail:
|
|
137
|
+
isEmail: PropTypes.bool,
|
|
137
138
|
/**
|
|
138
139
|
* Maximum length of value
|
|
139
140
|
*/
|
|
140
|
-
maxLength:
|
|
141
|
+
maxLength: PropTypes.number,
|
|
141
142
|
/**
|
|
142
143
|
* Minimum length of value
|
|
143
144
|
*/
|
|
144
|
-
minLength:
|
|
145
|
+
minLength: PropTypes.number,
|
|
145
146
|
/**
|
|
146
147
|
* Callback fires when field validation state changes
|
|
147
148
|
*/
|
|
148
|
-
isFieldValid:
|
|
149
|
+
isFieldValid: PropTypes.func,
|
|
149
150
|
/**
|
|
150
151
|
* Additional validation state
|
|
151
152
|
*/
|
|
152
|
-
isValid:
|
|
153
|
+
isValid: PropTypes.bool,
|
|
153
154
|
/**
|
|
154
155
|
* Allow validation without onBlur, validate field when mount
|
|
155
156
|
*/
|
|
156
|
-
forceAllowValidation:
|
|
157
|
+
forceAllowValidation: PropTypes.bool
|
|
157
158
|
};
|
|
158
159
|
TextInput.defaultProps = {
|
|
159
160
|
isValid: true,
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { _ as _extends } from '
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
2
|
import React__default, { forwardRef, useState, useCallback, useEffect } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import { d as dayjsWithPlugins } from '
|
|
5
|
-
import { g as getBrowserDateFormat } from '
|
|
6
|
-
import { c as checkTimeValidation } from '
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { d as dayjsWithPlugins } from '../dateValidation-67caec66.js';
|
|
5
|
+
import { g as getBrowserDateFormat } from '../localization-4ba17032.js';
|
|
6
|
+
import { c as checkTimeValidation } from '../checkTimeValidation-e56771be.js';
|
|
7
7
|
import 'react-dom';
|
|
8
|
-
import ExtendedInput from '
|
|
9
|
-
import '
|
|
10
|
-
import '
|
|
11
|
-
import '
|
|
12
|
-
import '
|
|
13
|
-
import '
|
|
14
|
-
import '
|
|
15
|
-
import '
|
|
16
|
-
import '
|
|
17
|
-
import '
|
|
18
|
-
import '
|
|
19
|
-
import '
|
|
20
|
-
import '
|
|
21
|
-
import '
|
|
22
|
-
import '
|
|
23
|
-
import '
|
|
24
|
-
import '
|
|
8
|
+
import ExtendedInput from '../ExtendedInput/index.js';
|
|
9
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
10
|
+
import '../index-6ff23041.js';
|
|
11
|
+
import '../configs-fed6ac34.js';
|
|
12
|
+
import '../index-a0e4e333.js';
|
|
13
|
+
import '../hooks/useDeviceType.js';
|
|
14
|
+
import '../hooks/useWindowSize.js';
|
|
15
|
+
import '../hooks/useEllipsisDetection.js';
|
|
16
|
+
import '../Icon/index.js';
|
|
17
|
+
import '../style-inject.es-746bb8ed.js';
|
|
18
|
+
import '../SuggestionList/index.js';
|
|
19
|
+
import '../hooks/useKeyDown.js';
|
|
20
|
+
import '../hooks/useClickOutside.js';
|
|
21
|
+
import '../config-0ca92874.js';
|
|
22
|
+
import '../Scrollbar/index.js';
|
|
23
|
+
import '../Tooltip/index.js';
|
|
24
|
+
import '../Popover-f4d1cac0.js';
|
|
25
|
+
import '../GeneUIProvider/index.js';
|
|
25
26
|
|
|
26
27
|
const nonLettersRegex = /[\W_]+/g;
|
|
27
28
|
const getFormatSeparator = format => format[format.search(nonLettersRegex)];
|
|
@@ -155,14 +156,14 @@ const DateInput = /*#__PURE__*/forwardRef((_ref6, ref) => {
|
|
|
155
156
|
}, restProps));
|
|
156
157
|
});
|
|
157
158
|
DateInput.propTypes = {
|
|
158
|
-
value:
|
|
159
|
-
onChange:
|
|
160
|
-
required:
|
|
161
|
-
getInitialState:
|
|
162
|
-
customValidation:
|
|
163
|
-
min:
|
|
164
|
-
max:
|
|
165
|
-
format:
|
|
159
|
+
value: PropTypes.string,
|
|
160
|
+
onChange: PropTypes.func,
|
|
161
|
+
required: PropTypes.bool,
|
|
162
|
+
getInitialState: PropTypes.func,
|
|
163
|
+
customValidation: PropTypes.func,
|
|
164
|
+
min: PropTypes.string,
|
|
165
|
+
max: PropTypes.string,
|
|
166
|
+
format: PropTypes.string
|
|
166
167
|
};
|
|
167
168
|
DateInput.defaultProps = {
|
|
168
169
|
format: getBrowserDateFormat()
|
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
import { _ as _extends } from '
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
2
|
import React__default, { forwardRef, useState, useCallback, useEffect } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import '
|
|
6
|
-
import
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import useMount from '../hooks/useMount.js';
|
|
5
|
+
import '../configs-fed6ac34.js';
|
|
6
|
+
import Uploader from '../Uploader/index.js';
|
|
7
|
+
import '../index-a0e4e333.js';
|
|
8
|
+
import '../dateValidation-67caec66.js';
|
|
9
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
10
10
|
import 'react-dom';
|
|
11
|
-
import '
|
|
12
|
-
import '
|
|
13
|
-
import '
|
|
14
|
-
import '
|
|
15
|
-
import '
|
|
16
|
-
import '
|
|
17
|
-
import '
|
|
18
|
-
import '
|
|
19
|
-
import '
|
|
20
|
-
import '
|
|
21
|
-
import '
|
|
22
|
-
import '
|
|
23
|
-
import '
|
|
24
|
-
import '
|
|
25
|
-
import '
|
|
26
|
-
import '
|
|
27
|
-
import '
|
|
28
|
-
import '
|
|
29
|
-
import '
|
|
30
|
-
import '
|
|
31
|
-
import '
|
|
32
|
-
import '
|
|
33
|
-
import '
|
|
11
|
+
import '../index-6ff23041.js';
|
|
12
|
+
import '../Button/index.js';
|
|
13
|
+
import '../Icon/index.js';
|
|
14
|
+
import '../style-inject.es-746bb8ed.js';
|
|
15
|
+
import '../ExtendedInput/index.js';
|
|
16
|
+
import '../hooks/useDeviceType.js';
|
|
17
|
+
import '../hooks/useWindowSize.js';
|
|
18
|
+
import '../hooks/useEllipsisDetection.js';
|
|
19
|
+
import '../SuggestionList/index.js';
|
|
20
|
+
import '../hooks/useKeyDown.js';
|
|
21
|
+
import '../hooks/useClickOutside.js';
|
|
22
|
+
import '../config-0ca92874.js';
|
|
23
|
+
import '../Scrollbar/index.js';
|
|
24
|
+
import '../Tooltip/index.js';
|
|
25
|
+
import '../Popover-f4d1cac0.js';
|
|
26
|
+
import '../GeneUIProvider/index.js';
|
|
27
|
+
import '../Grid/index.js';
|
|
28
|
+
import '../hooks/useWidth.js';
|
|
29
|
+
import '../hooks/useImgDownload.js';
|
|
30
|
+
import '../BusyLoader/index.js';
|
|
31
|
+
import '../Image/index.js';
|
|
32
|
+
import '../Empty/index.js';
|
|
33
|
+
import '../Checkbox/index.js';
|
|
34
|
+
import '../checkboxRadioSwitcher-5b69d7bd.js';
|
|
35
|
+
import '../guid-8ddf77b3.js';
|
|
34
36
|
|
|
35
37
|
function checkValidation(required, isValid) {
|
|
36
38
|
let value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
@@ -83,12 +85,12 @@ const UploaderField = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
83
85
|
}, restProps));
|
|
84
86
|
});
|
|
85
87
|
UploaderField.propTypes = {
|
|
86
|
-
onChange:
|
|
87
|
-
customValidation:
|
|
88
|
+
onChange: PropTypes.func,
|
|
89
|
+
customValidation: PropTypes.func,
|
|
88
90
|
/**
|
|
89
91
|
* Additional validation state
|
|
90
92
|
*/
|
|
91
|
-
isValid:
|
|
93
|
+
isValid: PropTypes.bool
|
|
92
94
|
};
|
|
93
95
|
|
|
94
96
|
export { UploaderField as default };
|
package/Widget/index.js
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
|
+
import React__default, { useMemo } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { c as classnames } from '../index-6ff23041.js';
|
|
5
|
+
import { w as widgetConfig } from '../configs-fed6ac34.js';
|
|
6
|
+
import Icon from '../Icon/index.js';
|
|
7
|
+
import KeyValue from '../KeyValue/index.js';
|
|
8
|
+
import ModuleTitle from '../ModuleTitle/index.js';
|
|
9
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
10
|
+
import '../index-a0e4e333.js';
|
|
11
|
+
import '../dateValidation-67caec66.js';
|
|
12
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
13
|
+
import 'react-dom';
|
|
14
|
+
import '../Tooltip/index.js';
|
|
15
|
+
import '../Popover-f4d1cac0.js';
|
|
16
|
+
import '../hooks/useDeviceType.js';
|
|
17
|
+
import '../hooks/useWindowSize.js';
|
|
18
|
+
import '../GeneUIProvider/index.js';
|
|
19
|
+
|
|
20
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .widget-holder{background:var(--background);border-radius:2rem;height:6rem;width:100%}[data-gene-ui-version=\"2.12.2\"] .widget-holder.s-small{--font-size:1.6rem;border-radius:1rem}[data-gene-ui-version=\"2.12.2\"] .widget-holder.s-medium{border-radius:1rem;height:8rem}[data-gene-ui-version=\"2.12.2\"] .widget-holder.s-big{height:11rem}[data-gene-ui-version=\"2.12.2\"] .widget-holder .no-data{opacity:.5}[data-gene-ui-version=\"2.12.2\"] .widget-holder.shadow{box-shadow:0 .3rem .6rem 0 #0000000d}[data-gene-ui-version=\"2.12.2\"] .widget-holder.border{border:1px solid rgba(var(--background-sc-rgb),.05)}[data-gene-ui-version=\"2.12.2\"] .widget-holder .module-title{text-transform:uppercase}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid{display:grid;grid-template-areas:\"image head\" \"image text\";grid-template-columns:auto 1fr;grid-template-rows:1fr 1fr}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-default{padding-inline:2rem}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-default .module-title{font-size:1.2rem}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-default .module-header{padding:0}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-default .image{padding-inline-end:3.5rem}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-default .image img{height:5rem;width:5rem}[data-gene-ui-version=\"2.12.2\"] .s-small.widget-holder.widget-grid.t-default .image{padding-inline-end:1.5rem}[data-gene-ui-version=\"2.12.2\"] .s-small.widget-holder.widget-grid.t-default .image img{height:3.4rem;width:3.4rem}[data-gene-ui-version=\"2.12.2\"] .s-medium.widget-holder.widget-grid.t-default .image{padding-inline-end:2rem}[data-gene-ui-version=\"2.12.2\"] .s-medium.widget-holder.widget-grid.t-default .image img{height:4.8rem;width:4.8rem}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-compact .text.key-values,[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-default .text.key-values{display:grid;gap:1.6rem;grid-template-columns:.5fr .4fr 1fr}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-compact .text .widget-timeline-holder,[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-default .text .widget-timeline-holder{align-items:center;border-left:1px solid rgba(var(--background-sc-rgb),.05);display:flex;justify-content:space-between;text-align:center}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-compact{grid-template-areas:\"head head\" \"image text\";grid-template-rows:auto 1fr}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-compact .image{padding-inline-end:1.5rem}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-compact .image img{height:4.8rem;width:4.8rem}[data-gene-ui-version=\"2.12.2\"] .s-small.widget-holder.widget-grid.t-compact .image{display:none}[data-gene-ui-version=\"2.12.2\"] .s-medium.widget-holder.widget-grid.t-compact .image{padding-inline:2rem}[data-gene-ui-version=\"2.12.2\"] .s-medium.widget-holder.widget-grid.t-compact .image img{height:3rem;width:3rem}[data-gene-ui-version=\"2.12.2\"] .s-big.widget-holder.widget-grid.t-compact .image{padding-inline:2rem}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-compact .text{padding:0 2rem}[data-gene-ui-version=\"2.12.2\"] .widget-holder.widget-grid.t-compact .text:not(.bobol)>p{text-align:end}[data-gene-ui-version=\"2.12.2\"] .widget-holder>li{align-items:center;display:flex}[data-gene-ui-version=\"2.12.2\"] .widget-holder>li.image{grid-area:image;justify-content:center}[data-gene-ui-version=\"2.12.2\"] .widget-holder>li.head{grid-area:head;overflow:hidden;padding:0 0 1px}[data-gene-ui-version=\"2.12.2\"] .widget-holder>li.text{grid-area:text;overflow:hidden}[data-gene-ui-version=\"2.12.2\"] .widget-holder>li.text>p{flex:auto;font:700 var(--font-size,1.8rem)/3rem var(--font-family)}[data-gene-ui-version=\"2.12.2\"] .widget-holder>li.text .icon{flex-shrink:0}[data-gene-ui-version=\"2.12.2\"] .widget-holder.t-minimal{align-items:center;border-radius:1rem;display:flex;flex-direction:column;justify-content:center;padding:0 .8rem;text-align:center}[data-gene-ui-version=\"2.12.2\"] .widget-holder.t-minimal.shadow{box-shadow:0 .2rem .4rem 0 #0000000d}[data-gene-ui-version=\"2.12.2\"] .widget-holder.t-minimal>li{justify-content:center;width:100%}[data-gene-ui-version=\"2.12.2\"] .widget-holder.t-minimal>li:first-child{color:rgba(var(--background-sc-rgb),.61);font:600 1.2rem/1.6rem var(--font-family)}[data-gene-ui-version=\"2.12.2\"] .widget-holder.t-minimal>li:nth-child(2){font-weight:600;margin:1rem 0 0}[data-gene-ui-version=\"2.12.2\"] .widget-holder.t-minimal>li>i{border-radius:100%;display:block;flex-shrink:0;height:.8rem;width:.8rem}html:not([dir=rtl]) .widget-holder.t-minimal>li>i{margin-right:.8rem}html[dir=rtl] .widget-holder.t-minimal>li>i{margin-left:.8rem}[data-gene-ui-version=\"2.12.2\"] .widget-holder.t-colorful{border:1px solid var(--hero);display:block;max-width:100%;min-width:14rem;padding:1rem 1.4rem .8rem;position:relative;width:auto}[data-gene-ui-version=\"2.12.2\"] .widget-holder.t-colorful:before{background:var(--hero);border-radius:inherit;content:\"\";display:block;height:100%;left:0;opacity:.03;position:absolute;top:0;width:100%}[data-gene-ui-version=\"2.12.2\"] .widget-holder.t-colorful>li{position:relative}[data-gene-ui-version=\"2.12.2\"] .widget-holder.t-colorful .widget-c-title{font:600 1.2rem/1.6rem var(--font-family);margin:0 0 .4rem;opacity:.8}[data-gene-ui-version=\"2.12.2\"] .widget-holder.t-colorful .widget-c-text{font:700 1.6rem/2.2rem var(--font-family)}[data-gene-ui-version=\"2.12.2\"] .comparison-icons-holder{--status-color:inherit;align-items:center;color:var(--status-color);display:flex;flex-shrink:0;font:700 1.4rem/1.8rem var(--font-family);margin-inline-start:.6rem;transition:color .4s}[data-gene-ui-version=\"2.12.2\"] .comparison-icons-holder.cs-up{--status-color:#51cf78}[data-gene-ui-version=\"2.12.2\"] .comparison-icons-holder.cs-up .bc-icon-comparison-down{color:rgba(var(--background-sc-rgb),.1)}[data-gene-ui-version=\"2.12.2\"] .comparison-icons-holder.cs-down{--status-color:#e84855}[data-gene-ui-version=\"2.12.2\"] .comparison-icons-holder.cs-down .bc-icon-comparison-up{color:rgba(var(--background-sc-rgb),.1)}[data-gene-ui-version=\"2.12.2\"] .comparison-icons-holder .icon+.icon{left:0;position:absolute;top:0}[data-gene-ui-version=\"2.12.2\"] .comparison-icons{position:relative}";
|
|
21
|
+
styleInject(css_248z);
|
|
22
|
+
|
|
23
|
+
function Widget(_ref) {
|
|
24
|
+
let {
|
|
25
|
+
type,
|
|
26
|
+
img,
|
|
27
|
+
title,
|
|
28
|
+
text,
|
|
29
|
+
color,
|
|
30
|
+
headerActions,
|
|
31
|
+
noDataText,
|
|
32
|
+
noData,
|
|
33
|
+
className,
|
|
34
|
+
withShadow,
|
|
35
|
+
withBorder,
|
|
36
|
+
titleIcon,
|
|
37
|
+
showComparisonIcons,
|
|
38
|
+
comparisonText,
|
|
39
|
+
comparisonStatus,
|
|
40
|
+
size,
|
|
41
|
+
titleProps,
|
|
42
|
+
keyValues,
|
|
43
|
+
...restProps
|
|
44
|
+
} = _ref;
|
|
45
|
+
const showKeyValues = useMemo(() => !!keyValues.length && size === widgetConfig.size[2], [size, keyValues]);
|
|
46
|
+
return /*#__PURE__*/React__default.createElement("ul", _extends({}, restProps, {
|
|
47
|
+
className: classnames(className, 'widget-holder', "t-".concat(type), "s-".concat(size), {
|
|
48
|
+
'widget-grid': type !== widgetConfig.type[2] && type !== widgetConfig.type[3],
|
|
49
|
+
shadow: withShadow,
|
|
50
|
+
border: withBorder
|
|
51
|
+
}),
|
|
52
|
+
style: {
|
|
53
|
+
'--hero': color
|
|
54
|
+
}
|
|
55
|
+
}), type === widgetConfig.type[2] ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement("i", {
|
|
56
|
+
style: {
|
|
57
|
+
background: color
|
|
58
|
+
}
|
|
59
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
|
60
|
+
className: "ellipsis-text"
|
|
61
|
+
}, title)), /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement("span", {
|
|
62
|
+
className: classnames('ellipsis-text', {
|
|
63
|
+
'no-data': noData
|
|
64
|
+
})
|
|
65
|
+
}, noData ? noDataText : text), !noData && (showComparisonIcons || comparisonText) && /*#__PURE__*/React__default.createElement("div", {
|
|
66
|
+
className: classnames('comparison-icons-holder', "cs-".concat(comparisonStatus))
|
|
67
|
+
}, comparisonText && /*#__PURE__*/React__default.createElement("div", {
|
|
68
|
+
className: "comparison-text"
|
|
69
|
+
}, comparisonText), showComparisonIcons && /*#__PURE__*/React__default.createElement("div", {
|
|
70
|
+
className: "comparison-icons"
|
|
71
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
72
|
+
type: "bc-icon-comparison-up"
|
|
73
|
+
}), /*#__PURE__*/React__default.createElement(Icon, {
|
|
74
|
+
type: "bc-icon-comparison-down"
|
|
75
|
+
}))))) : type === widgetConfig.type[3] ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("li", {
|
|
76
|
+
className: "widget-c-title"
|
|
77
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
78
|
+
className: "ellipsis-text"
|
|
79
|
+
}, title)), /*#__PURE__*/React__default.createElement("li", {
|
|
80
|
+
className: "widget-c-text"
|
|
81
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
82
|
+
className: classnames('ellipsis-text', {
|
|
83
|
+
'no-data': noData
|
|
84
|
+
})
|
|
85
|
+
}, noData ? noDataText : text))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, img && /*#__PURE__*/React__default.createElement("li", {
|
|
86
|
+
className: "image"
|
|
87
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
88
|
+
src: img,
|
|
89
|
+
alt: ""
|
|
90
|
+
})), /*#__PURE__*/React__default.createElement("li", {
|
|
91
|
+
className: "head"
|
|
92
|
+
}, /*#__PURE__*/React__default.createElement(ModuleTitle, _extends({
|
|
93
|
+
title: title,
|
|
94
|
+
color: color,
|
|
95
|
+
size: size,
|
|
96
|
+
cornerRadius: "position-radius",
|
|
97
|
+
titleIcon: titleIcon
|
|
98
|
+
}, titleProps), headerActions)), /*#__PURE__*/React__default.createElement("li", {
|
|
99
|
+
className: classnames('text', {
|
|
100
|
+
'key-values': showKeyValues
|
|
101
|
+
})
|
|
102
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
103
|
+
className: classnames('ellipsis-text', {
|
|
104
|
+
'no-data': noData
|
|
105
|
+
})
|
|
106
|
+
}, noData ? noDataText : text), !noData && (showComparisonIcons || comparisonText) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
107
|
+
className: classnames('comparison-icons-holder', "cs-".concat(comparisonStatus))
|
|
108
|
+
}, comparisonText && /*#__PURE__*/React__default.createElement("div", {
|
|
109
|
+
className: "comparison-text"
|
|
110
|
+
}, comparisonText), showComparisonIcons && /*#__PURE__*/React__default.createElement("div", {
|
|
111
|
+
className: "comparison-icons"
|
|
112
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
113
|
+
type: "bc-icon-comparison-up"
|
|
114
|
+
}), /*#__PURE__*/React__default.createElement(Icon, {
|
|
115
|
+
type: "bc-icon-comparison-down"
|
|
116
|
+
}))), showKeyValues && /*#__PURE__*/React__default.createElement("div", {
|
|
117
|
+
className: "widget-timeline-holder"
|
|
118
|
+
}, keyValues.map((_ref2, index) => {
|
|
119
|
+
let {
|
|
120
|
+
label,
|
|
121
|
+
value,
|
|
122
|
+
className,
|
|
123
|
+
...rest
|
|
124
|
+
} = _ref2;
|
|
125
|
+
return /*#__PURE__*/React__default.createElement(KeyValue, _extends({
|
|
126
|
+
key: index,
|
|
127
|
+
label: label,
|
|
128
|
+
value: value,
|
|
129
|
+
className: className
|
|
130
|
+
}, rest));
|
|
131
|
+
}))))));
|
|
132
|
+
}
|
|
133
|
+
Widget.propTypes = {
|
|
134
|
+
/**
|
|
135
|
+
* Switching to different types of widget's view, can be
|
|
136
|
+
* default, minimal, compact
|
|
137
|
+
*/
|
|
138
|
+
type: PropTypes.oneOf(widgetConfig.type),
|
|
139
|
+
/**
|
|
140
|
+
* Setting image to widget
|
|
141
|
+
*/
|
|
142
|
+
img: PropTypes.string,
|
|
143
|
+
/**
|
|
144
|
+
* Title for widget
|
|
145
|
+
*/
|
|
146
|
+
title: PropTypes.node.isRequired,
|
|
147
|
+
/**
|
|
148
|
+
* Main text for widget
|
|
149
|
+
*/
|
|
150
|
+
text: PropTypes.node,
|
|
151
|
+
/**
|
|
152
|
+
* Theme color for widget
|
|
153
|
+
*/
|
|
154
|
+
color: PropTypes.string,
|
|
155
|
+
/**
|
|
156
|
+
* The prop allows you to specify actions for the widget's header.
|
|
157
|
+
* It works only for types `default` and `compact`
|
|
158
|
+
*/
|
|
159
|
+
headerActions: PropTypes.node,
|
|
160
|
+
/**
|
|
161
|
+
* Text for No data state
|
|
162
|
+
*/
|
|
163
|
+
noDataText: PropTypes.string,
|
|
164
|
+
/**
|
|
165
|
+
* Show/hide No data state
|
|
166
|
+
*/
|
|
167
|
+
noData: PropTypes.bool,
|
|
168
|
+
/**
|
|
169
|
+
* Additional className
|
|
170
|
+
*/
|
|
171
|
+
className: PropTypes.string,
|
|
172
|
+
/**
|
|
173
|
+
* Show/Hide shadow effect for widget
|
|
174
|
+
*/
|
|
175
|
+
withShadow: PropTypes.bool,
|
|
176
|
+
/**
|
|
177
|
+
* Show/Hide bordered effect
|
|
178
|
+
*/
|
|
179
|
+
withBorder: PropTypes.bool,
|
|
180
|
+
/**
|
|
181
|
+
* Title can have icon, defining with this prop
|
|
182
|
+
*/
|
|
183
|
+
titleIcon: PropTypes.string,
|
|
184
|
+
/**
|
|
185
|
+
* Show/Hide comparison icons
|
|
186
|
+
*/
|
|
187
|
+
showComparisonIcons: PropTypes.bool,
|
|
188
|
+
/**
|
|
189
|
+
* Props for title component
|
|
190
|
+
*/
|
|
191
|
+
titleProps: PropTypes.object,
|
|
192
|
+
/**
|
|
193
|
+
* Comparison text
|
|
194
|
+
*/
|
|
195
|
+
comparisonText: PropTypes.string,
|
|
196
|
+
/**
|
|
197
|
+
* Defining status/state of comparison icon
|
|
198
|
+
* can be one of `'initial','up','down'`
|
|
199
|
+
*/
|
|
200
|
+
comparisonStatus: PropTypes.oneOf(widgetConfig.comparisonStatus),
|
|
201
|
+
/**
|
|
202
|
+
* Widget size
|
|
203
|
+
* `small, big, medium`
|
|
204
|
+
*/
|
|
205
|
+
size: PropTypes.oneOf(widgetConfig.size),
|
|
206
|
+
/**
|
|
207
|
+
* Widget keyValues is an array of keyValue
|
|
208
|
+
* it will appear when the size is big
|
|
209
|
+
*/
|
|
210
|
+
keyValues: PropTypes.arrayOf(PropTypes.shape({
|
|
211
|
+
...KeyValue.propTypes
|
|
212
|
+
}))
|
|
213
|
+
};
|
|
214
|
+
Widget.defaultProps = {
|
|
215
|
+
type: widgetConfig.type[0],
|
|
216
|
+
noDataText: 'No Data',
|
|
217
|
+
noData: false,
|
|
218
|
+
titleProps: {},
|
|
219
|
+
withShadow: true,
|
|
220
|
+
withBorder: false,
|
|
221
|
+
showComparisonIcons: false,
|
|
222
|
+
comparisonStatus: widgetConfig.comparisonStatus[0],
|
|
223
|
+
size: widgetConfig.size[1],
|
|
224
|
+
keyValues: []
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export { Widget as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import ReactDOM__default from 'react-dom';
|
|
2
|
+
|
|
3
|
+
const callAfterDelay = (callBack, time) => {
|
|
4
|
+
const timerId = setTimeout(() => {
|
|
5
|
+
clearTimeout(timerId);
|
|
6
|
+
ReactDOM__default.unstable_batchedUpdates(() => {
|
|
7
|
+
callBack();
|
|
8
|
+
});
|
|
9
|
+
}, time);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const actionTypes = {
|
|
13
|
+
add: 'add',
|
|
14
|
+
edit: 'edit',
|
|
15
|
+
delete: 'delete'
|
|
16
|
+
};
|
|
17
|
+
const keyDownKeys = {
|
|
18
|
+
space: ' ',
|
|
19
|
+
enter: 'Enter',
|
|
20
|
+
escape: 'Escape',
|
|
21
|
+
arrowDown: 'ArrowDown',
|
|
22
|
+
arrowUp: 'ArrowUp',
|
|
23
|
+
arrowLeft: 'ArrowLeft',
|
|
24
|
+
arrowRight: 'ArrowRight',
|
|
25
|
+
backspace: 'Backspace',
|
|
26
|
+
delete: 'Delete',
|
|
27
|
+
tab: 'Tab'
|
|
28
|
+
};
|
|
29
|
+
const SPACE_HEIGHT = 8;
|
|
30
|
+
|
|
31
|
+
export { SPACE_HEIGHT as S, actionTypes as a, callAfterDelay as c, keyDownKeys as k };
|