@geneui/components 3.0.0-next-06dadf3-29102024 → 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.
- package/Avatar.js +63 -0
- package/Divider.js +23 -0
- package/{GeneUIProvider/index.js → GeneUIProvider.js} +51 -64
- package/HelperText.js +69 -0
- package/Info.js +64 -0
- package/Label.js +38 -0
- package/Loader.js +21 -0
- package/Pill.js +64 -0
- package/TextLink.js +20 -0
- package/{index-c7646e48.js → Tooltip.js} +101 -79
- package/{lib → components}/atoms/Avatar/Avatar.d.ts +7 -6
- package/components/atoms/Avatar/index.d.ts +1 -0
- package/{lib → components}/atoms/Divider/Divider.d.ts +5 -5
- package/components/atoms/Divider/index.d.ts +1 -0
- package/{lib → components}/atoms/HelperText/HelperText.d.ts +6 -5
- package/components/atoms/HelperText/index.d.ts +1 -0
- package/{lib → components}/atoms/Info/Info.d.ts +5 -5
- package/components/atoms/Info/index.d.ts +1 -0
- package/{lib → components}/atoms/Label/Label.d.ts +3 -3
- package/components/atoms/Label/index.d.ts +1 -0
- package/{lib → components}/atoms/Loader/Loader.d.ts +5 -5
- package/components/atoms/Loader/index.d.ts +1 -0
- package/{lib → components}/atoms/Pill/Pill.d.ts +7 -6
- package/components/atoms/Pill/index.d.ts +1 -0
- package/{lib → components}/atoms/TextLink/TextLink.d.ts +5 -5
- package/components/atoms/TextLink/index.d.ts +1 -0
- package/{lib → components}/molecules/Tooltip/Tooltip.d.ts +26 -21
- package/components/molecules/Tooltip/index.d.ts +1 -0
- package/components/providers/GeneUIProvider/GeneUIProvider.d.ts +30 -0
- package/components/providers/GeneUIProvider/index.d.ts +1 -0
- package/hooks/index.d.ts +2 -20
- package/hooks/useDebounceCallback/index.d.ts +1 -0
- package/hooks/useDebounceCallback/useDebounceCallback.d.ts +2 -0
- package/hooks/useEllipsisDetection/index.d.ts +1 -1
- package/hooks/useEllipsisDetection/useEllipsisDetection.d.ts +2 -2
- package/{index-031ff73c.js → index-ce02421b.js} +4 -4
- package/index.d.ts +11 -121
- package/index.js +12 -159
- package/package.json +24 -43
- package/tokens-0abb4e1b.js +6 -0
- package/types/index.d.ts +0 -3
- package/useEllipsisDetection-46d712b6.js +34 -0
- package/ActionableList/index.js +0 -1694
- package/AdvancedSearch/index.js +0 -892
- package/Alert/index.js +0 -98
- package/Avatar/index.js +0 -58
- package/Badge/index.js +0 -29
- package/Breadcrumb/index.js +0 -130
- package/BusyLoader/index.js +0 -31
- package/Button/index.js +0 -30
- package/Card/index.js +0 -502
- package/CardList/index.js +0 -662
- package/CellMeasurerCache-26f3693c.js +0 -229
- package/Charts/index.js +0 -17662
- package/Checkbox/index.js +0 -229
- package/CheckboxGroup/index.js +0 -203
- package/CheckboxGroupWithSearch/index.js +0 -280
- package/Collapse/index.js +0 -195
- package/ColorPicker/index.js +0 -210
- package/ComboBox/index.js +0 -524
- package/Copy/index.js +0 -56
- package/Counter/index.js +0 -312
- package/DateFilter/index.js +0 -183
- package/DatePicker/index.js +0 -1229
- package/DatePickerInput/index.js +0 -883
- package/Divider/index.js +0 -23
- package/Drawer/index.js +0 -261
- package/Dropdown/index.js +0 -43
- package/Editor/index.js +0 -22975
- package/Empty/index.js +0 -76
- package/ExtendedInput/index.js +0 -590
- package/Form/index.js +0 -85
- package/FormContainer/index.js +0 -189
- package/FormableCheckbox/index.js +0 -24
- package/FormableDatePicker/index.js +0 -43
- package/FormableDropdown/index.js +0 -50
- package/FormableEditor/index.js +0 -26
- package/FormableHOC-85f89a81.js +0 -83
- package/FormableMultiSelectDropdown/index.js +0 -50
- package/FormableNumberInput/index.js +0 -34
- package/FormableRadio/index.js +0 -22
- package/FormableSwitcher/index.js +0 -22
- package/FormableTextInput/index.js +0 -34
- package/FormableUploader/index.js +0 -44
- package/Grid/index.js +0 -167
- package/HelperText/index.js +0 -86
- package/Holder/index.js +0 -261
- package/Icon/index.js +0 -62
- package/Image/index.js +0 -45
- package/ImagePreview/index.js +0 -217
- package/Info/index.js +0 -41
- package/InfoOutline-dd2e89d9.js +0 -29
- package/InteractiveWidget/index.js +0 -78
- package/KeyValue/index.js +0 -22
- package/Label/index.js +0 -48
- package/LinkButton/index.js +0 -34
- package/Loader/index.js +0 -23
- package/Menu/index.js +0 -281
- package/MobileNavigation/index.js +0 -94
- package/MobilePopup/index.js +0 -182
- package/Modal/index.js +0 -251
- package/ModuleTitle/index.js +0 -141
- package/NavigationMenu/index.js +0 -222
- package/Notification/index.js +0 -120
- package/Option/index.js +0 -184
- package/Overlay/index.js +0 -187
- package/Overspread/index.js +0 -291
- package/Pagination/index.js +0 -261
- package/Paper/index.js +0 -96
- package/Pill/index.js +0 -67
- package/Popover/index.js +0 -725
- package/PopoverV2/index.js +0 -19
- package/Portal/index.js +0 -58
- package/Products/index.js +0 -115
- package/Profile/index.js +0 -589
- package/Progress/index.js +0 -200
- package/QRCode/index.js +0 -814
- package/Radio/index.js +0 -151
- package/RadioGroup/index.js +0 -104
- package/Range/index.js +0 -191
- package/Rating/index.js +0 -174
- package/RichEditor/index.js +0 -13
- package/RichEditor-6ca8346f.js +0 -228
- package/Scrollbar/index.js +0 -1585
- package/Search/index.js +0 -75
- package/SearchWithDropdown/index.js +0 -140
- package/Section/index.js +0 -61
- package/SkeletonLoader/index.js +0 -81
- package/Slider/index.js +0 -261
- package/Status/index.js +0 -97
- package/Steps/index.js +0 -314
- package/SuggestionList/index.js +0 -385
- package/Switcher/index.js +0 -193
- package/Table/index.js +0 -57
- package/TableCompositions/index.js +0 -16995
- package/Tabs/index.js +0 -235
- package/Tag/index.js +0 -102
- package/TextLink/index.js +0 -20
- package/Textarea/index.js +0 -242
- package/Time/index.js +0 -62
- package/TimePicker/index.js +0 -575
- package/Timeline/index.js +0 -113
- package/Title/index.js +0 -65
- package/Toaster/index.js +0 -116
- package/Tooltip/index.js +0 -6
- package/TransferList/index.js +0 -493
- package/Uploader/index.js +0 -992
- package/ValidatableCheckbox/index.js +0 -123
- package/ValidatableDatePicker/index.js +0 -316
- package/ValidatableDropdown/index.js +0 -141
- package/ValidatableElements/index.js +0 -67
- package/ValidatableMultiSelectDropdown/index.js +0 -152
- package/ValidatableNumberInput/index.js +0 -204
- package/ValidatableRadio/index.js +0 -116
- package/ValidatableSwitcher/index.js +0 -93
- package/ValidatableTextInput/index.js +0 -167
- package/ValidatableTimeInput/index.js +0 -174
- package/ValidatableUploader/index.js +0 -98
- package/Widget/index.js +0 -225
- package/_commonjsHelpers-24198af3.js +0 -35
- package/_rollupPluginBabelHelpers-a83240e1.js +0 -11
- package/callAfterDelay-7272faca.js +0 -12
- package/checkTimeValidation-e56771be.js +0 -16
- package/checkboxRadioSwitcher-5b69d7bd.js +0 -4
- package/clsx.m-2bb6df4b.js +0 -3
- package/config-1053d64d.js +0 -20
- package/configs-00612ce0.js +0 -103
- package/configs.js +0 -111
- package/dateValidation-67caec66.js +0 -225
- package/debounce-4419bc2f.js +0 -17
- package/guid-8ddf77b3.js +0 -16
- package/hooks/useBodyScroll.js +0 -16
- package/hooks/useClick.js +0 -18
- package/hooks/useClickOutside.js +0 -25
- package/hooks/useDebounce.js +0 -28
- package/hooks/useDeviceType.js +0 -17
- package/hooks/useDidMount.js +0 -15
- package/hooks/useForceUpdate.js +0 -8
- package/hooks/useHover.js +0 -20
- package/hooks/useImgDownload.js +0 -18
- package/hooks/useKeyDown.js +0 -21
- package/hooks/useMount.js +0 -13
- package/hooks/useMutationObserver.js +0 -21
- package/hooks/usePrevious.js +0 -10
- package/hooks/useThrottle.js +0 -16
- package/hooks/useToggle.js +0 -11
- package/hooks/useUpdatableRef.js +0 -14
- package/hooks/useUpdate.js +0 -10
- package/hooks/useWidth.js +0 -16
- package/hooks/useWindowSize.js +0 -40
- package/index-122432cd.js +0 -270
- package/index-262edd7a.js +0 -77
- package/index-3188e46e.js +0 -1940
- package/index-45eafea6.js +0 -90
- package/index-5f37f281.js +0 -168
- package/index-ce12e4a9.js +0 -10032
- package/index-d0ecb950.js +0 -6483
- package/index-fcbae78d.js +0 -4
- package/index.mobile.d.ts +0 -14
- package/lib/atoms/Avatar/index.d.ts +0 -1
- package/lib/atoms/Badge/Badge.d.ts +0 -36
- package/lib/atoms/Badge/index.d.ts +0 -1
- package/lib/atoms/BusyLoader/BusyLoader.d.ts +0 -32
- package/lib/atoms/BusyLoader/BusyLoaderHolderHOC.d.ts +0 -8
- package/lib/atoms/BusyLoader/index.d.ts +0 -1
- package/lib/atoms/Button/Button.d.ts +0 -70
- package/lib/atoms/Button/index.d.ts +0 -1
- package/lib/atoms/Divider/index.d.ts +0 -1
- package/lib/atoms/Empty/Empty.d.ts +0 -39
- package/lib/atoms/Empty/index.d.ts +0 -1
- package/lib/atoms/Empty/utils.d.ts +0 -9
- package/lib/atoms/HelperText/index.d.ts +0 -1
- package/lib/atoms/Image/Image.d.ts +0 -51
- package/lib/atoms/Image/index.d.ts +0 -1
- package/lib/atoms/ImagePreview/ImagePreview.d.ts +0 -56
- package/lib/atoms/ImagePreview/ImagePreviewHOC.d.ts +0 -4
- package/lib/atoms/ImagePreview/Magnifier.d.ts +0 -40
- package/lib/atoms/ImagePreview/index.d.ts +0 -1
- package/lib/atoms/Info/index.d.ts +0 -1
- package/lib/atoms/KeyValue/KeyValue.d.ts +0 -29
- package/lib/atoms/KeyValue/index.d.ts +0 -1
- package/lib/atoms/Label/index.d.ts +0 -1
- package/lib/atoms/LinkButton/LinkButton.d.ts +0 -46
- package/lib/atoms/LinkButton/index.d.ts +0 -1
- package/lib/atoms/Loader/index.d.ts +0 -1
- package/lib/atoms/Pill/index.d.ts +0 -1
- package/lib/atoms/Rating/DefaultSvg.d.ts +0 -3
- package/lib/atoms/Rating/Rating.d.ts +0 -49
- package/lib/atoms/Rating/index.d.ts +0 -1
- package/lib/atoms/TextLink/index.d.ts +0 -1
- package/lib/molecules/Copy/Copy.d.ts +0 -38
- package/lib/molecules/Copy/index.d.ts +0 -1
- package/lib/molecules/InteractiveWidget/InteractiveWidget.d.ts +0 -70
- package/lib/molecules/InteractiveWidget/InteractiveWidgetIcon.d.ts +0 -8
- package/lib/molecules/InteractiveWidget/index.d.ts +0 -1
- package/lib/molecules/Tooltip/index.d.ts +0 -1
- package/lib/providers/GeneUIProvider/GeneUIProvider.d.ts +0 -30
- package/lib/providers/GeneUIProvider/index.d.ts +0 -1
- package/localization-4ba17032.js +0 -46
- package/objectWithoutPropertiesLoose-e1596bdb.js +0 -62
- package/rangeAndSlider-740a236c.js +0 -8676
- package/react-beautiful-dnd.esm-8c7b5a83.js +0 -10116
- package/react-lifecycles-compat.es-6e1f3768.js +0 -158
- package/redux-e591c1b8.js +0 -536
- package/tokens-8ab1179c.js +0 -6
- package/tslib.es6-f211516f.js +0 -35
- package/useEllipsisDetection-c1c9ad94.js +0 -38
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
|
|
2
|
-
import React__default, { useRef, useState, useCallback, useEffect } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { c as classnames } from '../index-031ff73c.js';
|
|
5
|
-
import { n as noop } from '../index-5f37f281.js';
|
|
6
|
-
import useKeyDown from '../hooks/useKeyDown.js';
|
|
7
|
-
import { c as checkboxRadioSwitcherConfig, n as noDataConfig } from '../configs-00612ce0.js';
|
|
8
|
-
import CustomScrollbar from '../Scrollbar/index.js';
|
|
9
|
-
import Button from '../Button/index.js';
|
|
10
|
-
import Empty from '../Empty/index.js';
|
|
11
|
-
import ExtendedInput from '../ExtendedInput/index.js';
|
|
12
|
-
import CheckboxGroup from '../CheckboxGroup/index.js';
|
|
13
|
-
import '../index-fcbae78d.js';
|
|
14
|
-
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
15
|
-
import '../dateValidation-67caec66.js';
|
|
16
|
-
import '../_commonjsHelpers-24198af3.js';
|
|
17
|
-
import 'react-dom';
|
|
18
|
-
import '../tslib.es6-f211516f.js';
|
|
19
|
-
import '../Icon/index.js';
|
|
20
|
-
import '../hooks/useDeviceType.js';
|
|
21
|
-
import '../hooks/useWindowSize.js';
|
|
22
|
-
import '../hooks/useDebounce.js';
|
|
23
|
-
import '../useEllipsisDetection-c1c9ad94.js';
|
|
24
|
-
import '../SuggestionList/index.js';
|
|
25
|
-
import '../hooks/useClickOutside.js';
|
|
26
|
-
import '../config-1053d64d.js';
|
|
27
|
-
import '../callAfterDelay-7272faca.js';
|
|
28
|
-
import '../index-c7646e48.js';
|
|
29
|
-
import '../GeneUIProvider/index.js';
|
|
30
|
-
import '../Checkbox/index.js';
|
|
31
|
-
import '../checkboxRadioSwitcher-5b69d7bd.js';
|
|
32
|
-
import '../guid-8ddf77b3.js';
|
|
33
|
-
|
|
34
|
-
var css_248z = "[data-gene-ui-version=\"2.16.4\"] .checkbox-group-with-search-holder{background:var(--background);width:100%}[data-gene-ui-version=\"2.16.4\"] .empty-data-holder{align-items:center;display:flex;height:19rem;justify-content:center;width:100%}[data-gene-ui-version=\"2.16.4\"] .c-g-w-s-content{background:rgba(var(--background-sc-rgb),.01);display:flex;flex-direction:column;width:100%}[data-gene-ui-version=\"2.16.4\"] .c-g-w-s-content>li{display:flex;width:100%}[data-gene-ui-version=\"2.16.4\"] .c-g-w-s-head{border-bottom:1px solid rgba(var(--background-sc-rgb),.1);padding:1.5rem}[data-gene-ui-version=\"2.16.4\"] .c-g-w-s-footer{border-top:1px solid rgba(var(--background-sc-rgb),.1);display:flex;justify-content:center;padding:1.5rem 0}[data-gene-ui-version=\"2.16.4\"] .c-g-w-s-footer>*+*{margin-inline-start:1rem}[data-gene-ui-version=\"2.16.4\"] .c-g-w-s-body-content{max-height:31rem;padding:1.5rem 0;width:100%}[data-gene-ui-version=\"2.16.4\"] .grouped-checkbox-with-search{flex-direction:column}[data-gene-ui-version=\"2.16.4\"] .grouped-checkbox-with-search>div{padding:1rem!important}@media (hover:hover){[data-gene-ui-version=\"2.16.4\"] .checkbox-group-with-search-holder .crs-holder.active{background:rgba(var(--background-sc-rgb),.05)}}";
|
|
35
|
-
styleInject(css_248z);
|
|
36
|
-
|
|
37
|
-
function CheckboxGroupWithSearch(_ref) {
|
|
38
|
-
let {
|
|
39
|
-
className,
|
|
40
|
-
onSave,
|
|
41
|
-
onCancel,
|
|
42
|
-
saveText,
|
|
43
|
-
cancelText,
|
|
44
|
-
onSearch,
|
|
45
|
-
value,
|
|
46
|
-
defaultSelected,
|
|
47
|
-
onChange,
|
|
48
|
-
data: options,
|
|
49
|
-
noDataText,
|
|
50
|
-
noDataWithImage,
|
|
51
|
-
noDataTypes,
|
|
52
|
-
disableSave,
|
|
53
|
-
autofocusSearchField,
|
|
54
|
-
isSaveButtonLoading,
|
|
55
|
-
...rest
|
|
56
|
-
} = _ref;
|
|
57
|
-
const parentRef = useRef(null);
|
|
58
|
-
const scrollbarRef = useRef(null);
|
|
59
|
-
const [query, setQuery] = useState('');
|
|
60
|
-
const [data, setData] = useState(options);
|
|
61
|
-
const [values, setValues] = useState(defaultSelected);
|
|
62
|
-
const [hoveredState, setHoveredState] = useState(-1);
|
|
63
|
-
const handleSearchChange = useCallback(e => {
|
|
64
|
-
const {
|
|
65
|
-
value
|
|
66
|
-
} = e.target;
|
|
67
|
-
onSearch ? onSearch(e) : setData(() => options.filter(item => !value || item.label.toLowerCase().includes(value.toLowerCase())));
|
|
68
|
-
setQuery(value);
|
|
69
|
-
}, [onSearch, options]);
|
|
70
|
-
const handleChange = useCallback(e => {
|
|
71
|
-
setValues(e);
|
|
72
|
-
onChange(e);
|
|
73
|
-
}, [onChange]);
|
|
74
|
-
function scroll(type, index) {
|
|
75
|
-
let newIndex = index;
|
|
76
|
-
if (type === 'prev' && data.length - 1 > index) {
|
|
77
|
-
newIndex++;
|
|
78
|
-
} else if (type === 'next' && index !== 0) {
|
|
79
|
-
newIndex--;
|
|
80
|
-
}
|
|
81
|
-
scrollbarRef.current.scrollTop(newIndex * Math.round(scrollbarRef.current.getScrollHeight() / data.length));
|
|
82
|
-
return newIndex;
|
|
83
|
-
}
|
|
84
|
-
useKeyDown(e => {
|
|
85
|
-
if (e.key === 'ArrowDown') {
|
|
86
|
-
setHoveredState(index => scroll('prev', index));
|
|
87
|
-
}
|
|
88
|
-
if (e.key === 'ArrowUp') {
|
|
89
|
-
setHoveredState(index => scroll('next', index));
|
|
90
|
-
}
|
|
91
|
-
if (e.key === 'Enter') {
|
|
92
|
-
onChange(e, hoveredState);
|
|
93
|
-
if (!value && data.length && hoveredState >= 0) {
|
|
94
|
-
setValues(v => {
|
|
95
|
-
const index = v.indexOf(data[hoveredState].value);
|
|
96
|
-
const newValues = [...v];
|
|
97
|
-
index > -1 ? newValues.splice(index, 1) : newValues.push(data[hoveredState].value);
|
|
98
|
-
return newValues;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}, [data, hoveredState, onChange], parentRef, ['ArrowUp', 'ArrowDown', 'Enter']);
|
|
103
|
-
useEffect(() => {
|
|
104
|
-
setData(options);
|
|
105
|
-
}, [options]);
|
|
106
|
-
useEffect(() => {
|
|
107
|
-
value && setValues(value);
|
|
108
|
-
}, [value]);
|
|
109
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
110
|
-
ref: parentRef,
|
|
111
|
-
className: classnames('checkbox-group-with-search-holder', className)
|
|
112
|
-
}, /*#__PURE__*/React__default.createElement("ul", {
|
|
113
|
-
className: "c-g-w-s-content"
|
|
114
|
-
}, /*#__PURE__*/React__default.createElement("li", {
|
|
115
|
-
className: "c-g-w-s-head"
|
|
116
|
-
}, /*#__PURE__*/React__default.createElement(ExtendedInput, {
|
|
117
|
-
autoFocus: autofocusSearchField,
|
|
118
|
-
value: query,
|
|
119
|
-
type: "search",
|
|
120
|
-
onChange: handleSearchChange,
|
|
121
|
-
icon: "bc-icon-search"
|
|
122
|
-
})), /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement(CustomScrollbar, {
|
|
123
|
-
ref: scrollbarRef,
|
|
124
|
-
autoHeight: true
|
|
125
|
-
}, data.length ? /*#__PURE__*/React__default.createElement("div", {
|
|
126
|
-
className: "c-g-w-s-body-content"
|
|
127
|
-
}, /*#__PURE__*/React__default.createElement(CheckboxGroup, _extends({
|
|
128
|
-
hoveredState: hoveredState,
|
|
129
|
-
className: "grouped-checkbox-with-search",
|
|
130
|
-
data: data,
|
|
131
|
-
value: values,
|
|
132
|
-
onChange: handleChange
|
|
133
|
-
}, rest))) : /*#__PURE__*/React__default.createElement("div", {
|
|
134
|
-
className: "empty-data-holder"
|
|
135
|
-
}, /*#__PURE__*/React__default.createElement(Empty, {
|
|
136
|
-
title: noDataText,
|
|
137
|
-
appearance: "greyscale",
|
|
138
|
-
withImage: noDataWithImage,
|
|
139
|
-
className: "absolute",
|
|
140
|
-
type: noDataTypes,
|
|
141
|
-
size: "small"
|
|
142
|
-
})))), /*#__PURE__*/React__default.createElement("li", {
|
|
143
|
-
className: "c-g-w-s-footer"
|
|
144
|
-
}, onCancel && /*#__PURE__*/React__default.createElement(Button, {
|
|
145
|
-
appearance: "minimal",
|
|
146
|
-
color: "default",
|
|
147
|
-
onClick: onCancel
|
|
148
|
-
}, cancelText), onSave && /*#__PURE__*/React__default.createElement(Button, {
|
|
149
|
-
disabled: disableSave || isSaveButtonLoading,
|
|
150
|
-
onClick: onSave,
|
|
151
|
-
loading: isSaveButtonLoading
|
|
152
|
-
}, saveText))));
|
|
153
|
-
}
|
|
154
|
-
CheckboxGroupWithSearch.propTypes = {
|
|
155
|
-
/** Text for save button * */
|
|
156
|
-
saveText: PropTypes.string,
|
|
157
|
-
/** Text for cancel button * */
|
|
158
|
-
cancelText: PropTypes.string,
|
|
159
|
-
/** Save button click callback * */
|
|
160
|
-
onSave: PropTypes.func,
|
|
161
|
-
/** Cancel button click callback * */
|
|
162
|
-
onCancel: PropTypes.func,
|
|
163
|
-
/** Search input on change callback * */
|
|
164
|
-
onSearch: PropTypes.func,
|
|
165
|
-
/** Initially selected value */
|
|
166
|
-
defaultSelected: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number])),
|
|
167
|
-
/**
|
|
168
|
-
* Disables events
|
|
169
|
-
*/
|
|
170
|
-
disabled: PropTypes.bool,
|
|
171
|
-
/**
|
|
172
|
-
* Disables save button
|
|
173
|
-
*/
|
|
174
|
-
disableSave: PropTypes.bool,
|
|
175
|
-
/**
|
|
176
|
-
* If data item is typeof string than value will apply both as checkbox label and value,
|
|
177
|
-
* Label: The text of the associated element.
|
|
178
|
-
* Value: The input value
|
|
179
|
-
* Disabled: A checkbox can appear disabled and be unable to change states
|
|
180
|
-
* readOnly: A checkbox can be read-only and unable to change states.
|
|
181
|
-
* required: If true, the input element will be required.
|
|
182
|
-
* isValid: Check validity of input value
|
|
183
|
-
* errorText: Displays custom error text when input value is not valid
|
|
184
|
-
*/
|
|
185
|
-
data: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
186
|
-
label: PropTypes.node,
|
|
187
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number]),
|
|
188
|
-
disabled: PropTypes.bool,
|
|
189
|
-
description: PropTypes.string,
|
|
190
|
-
readOnly: PropTypes.bool,
|
|
191
|
-
required: PropTypes.bool,
|
|
192
|
-
isValid: PropTypes.bool,
|
|
193
|
-
errorText: PropTypes.string
|
|
194
|
-
})])),
|
|
195
|
-
/**
|
|
196
|
-
* Custom text for checkAll checkbox
|
|
197
|
-
*/
|
|
198
|
-
checkAllText: PropTypes.string,
|
|
199
|
-
/**
|
|
200
|
-
* Displays select all checkbox
|
|
201
|
-
*/
|
|
202
|
-
showSelectAll: PropTypes.bool,
|
|
203
|
-
/**
|
|
204
|
-
* Array of values of the input elements
|
|
205
|
-
*/
|
|
206
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number]),
|
|
207
|
-
/**
|
|
208
|
-
* Fires an event when Checkbox is clicked or "enter" key is pressed
|
|
209
|
-
* (event: SyntheticEvent) => void
|
|
210
|
-
*/
|
|
211
|
-
onChange: PropTypes.func,
|
|
212
|
-
/**
|
|
213
|
-
* Additional className which applies to group holder div element
|
|
214
|
-
*/
|
|
215
|
-
className: PropTypes.string,
|
|
216
|
-
/**
|
|
217
|
-
* Accepts same values as Checkbox component(check in Checkbox component(molecules) propTable)
|
|
218
|
-
*/
|
|
219
|
-
size: PropTypes.oneOf(checkboxRadioSwitcherConfig.size),
|
|
220
|
-
/**
|
|
221
|
-
* Specify "label" position
|
|
222
|
-
*/
|
|
223
|
-
labelPosition: PropTypes.oneOf(checkboxRadioSwitcherConfig.labelPosition),
|
|
224
|
-
/**
|
|
225
|
-
* Specify "label" alignment
|
|
226
|
-
*/
|
|
227
|
-
labelAlignment: PropTypes.oneOf(checkboxRadioSwitcherConfig.labelAlignment),
|
|
228
|
-
/**
|
|
229
|
-
* Description for checkboxes
|
|
230
|
-
*/
|
|
231
|
-
description: PropTypes.string,
|
|
232
|
-
/**
|
|
233
|
-
* Define is field read only or no.
|
|
234
|
-
*/
|
|
235
|
-
readOnly: PropTypes.bool,
|
|
236
|
-
/**
|
|
237
|
-
* Define is field required or no.
|
|
238
|
-
*/
|
|
239
|
-
required: PropTypes.bool,
|
|
240
|
-
/**
|
|
241
|
-
* Additional state for field validation
|
|
242
|
-
*/
|
|
243
|
-
isValid: PropTypes.bool,
|
|
244
|
-
/**
|
|
245
|
-
* Text that will be shown id field is invalid
|
|
246
|
-
*/
|
|
247
|
-
errorText: PropTypes.string,
|
|
248
|
-
/**
|
|
249
|
-
* Different types/views for no data view
|
|
250
|
-
*/
|
|
251
|
-
noDataTypes: PropTypes.oneOf(noDataConfig),
|
|
252
|
-
/**
|
|
253
|
-
* Showing no data with image
|
|
254
|
-
*/
|
|
255
|
-
noDataWithImage: PropTypes.bool,
|
|
256
|
-
/**
|
|
257
|
-
* Custom No data text
|
|
258
|
-
*/
|
|
259
|
-
noDataText: PropTypes.string,
|
|
260
|
-
/*
|
|
261
|
-
* When rendering a component, the search field will automatically focused
|
|
262
|
-
*/
|
|
263
|
-
autofocusSearchField: PropTypes.bool,
|
|
264
|
-
/*
|
|
265
|
-
* Loader for save button
|
|
266
|
-
*/
|
|
267
|
-
isSaveButtonLoading: PropTypes.bool
|
|
268
|
-
};
|
|
269
|
-
CheckboxGroupWithSearch.defaultProps = {
|
|
270
|
-
onSave: noop,
|
|
271
|
-
onCancel: noop,
|
|
272
|
-
saveText: 'Save',
|
|
273
|
-
cancelText: 'Cancel',
|
|
274
|
-
noDataText: 'No data found',
|
|
275
|
-
noDataWithImage: true,
|
|
276
|
-
noDataTypes: 'image',
|
|
277
|
-
autofocusSearchField: false
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
export { CheckboxGroupWithSearch as default };
|
package/Collapse/index.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import React__default, { useMemo, useState, useEffect } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { a as conflictPropsLog } from '../index-5f37f281.js';
|
|
4
|
-
import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
|
|
5
|
-
import { c as classnames } from '../index-031ff73c.js';
|
|
6
|
-
import Icon from '../Icon/index.js';
|
|
7
|
-
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
8
|
-
import '../dateValidation-67caec66.js';
|
|
9
|
-
import '../_commonjsHelpers-24198af3.js';
|
|
10
|
-
import 'react-dom';
|
|
11
|
-
|
|
12
|
-
var css_248z = "[data-gene-ui-version=\"2.16.4\"] .accordion-holder{overflow:hidden;width:100%}[data-gene-ui-version=\"2.16.4\"] .accordion-holder.a-minimal:not(.active)+.a-minimal{margin:1.5rem 0 0}[data-gene-ui-version=\"2.16.4\"] .accordion-holder.a-minimal.active .accordion-head-arrow{transform:rotate(180deg)}[data-gene-ui-version=\"2.16.4\"] .accordion-holder.a-minimal .a-minimal:not(.active) .accordion-head-arrow{transform:rotate(-90deg)}html[dir=rtl] .accordion-holder.a-minimal .a-minimal:not(.active) .accordion-head-arrow{transform:rotate(90deg)}[data-gene-ui-version=\"2.16.4\"] .accordion-holder.a-default{border:1px solid rgba(var(--background-sc-rgb),.05)}[data-gene-ui-version=\"2.16.4\"] .accordion-holder.a-default+.a-default{margin:.5rem 0 0}[data-gene-ui-version=\"2.16.4\"] .accordion-holder.a-default:first-of-type{border-top-left-radius:1rem;border-top-right-radius:1rem}[data-gene-ui-version=\"2.16.4\"] .accordion-holder.a-default:last-of-type{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}[data-gene-ui-version=\"2.16.4\"] .accordion-holder.a-default:not(.active) .accordion-head-arrow{transform:rotate(-90deg)}html[dir=rtl] .accordion-holder.a-default:not(.active) .accordion-head-arrow{transform:rotate(90deg)}[data-gene-ui-version=\"2.16.4\"] .accordion-holder.disabled{opacity:.5;pointer-events:none}[data-gene-ui-version=\"2.16.4\"] .accordion-head{align-items:center;cursor:pointer;display:flex;font:600 1.4rem/2.4rem var(--font-family);-webkit-user-select:none;user-select:none}[data-gene-ui-version=\"2.16.4\"] .a-default>.accordion-head{background:rgba(var(--background-sc-rgb),.02);height:4rem;padding:0 1.2rem}[data-gene-ui-version=\"2.16.4\"] .a-default>.accordion-head>li{flex-shrink:0}[data-gene-ui-version=\"2.16.4\"] .a-default>.accordion-head>li+li{margin:0 0 0 1.8rem}html[dir=rtl] .a-default>.accordion-head>li+li{margin:0 1.8rem 0 0}[data-gene-ui-version=\"2.16.4\"] .a-default>.accordion-head>li.ellipsis-text{flex:auto}[data-gene-ui-version=\"2.16.4\"] .a-minimal>.accordion-head>li{flex-shrink:0}[data-gene-ui-version=\"2.16.4\"] .a-minimal>.accordion-head>li.ellipsis-text{margin:0 1rem 0 .4rem}html[dir=rtl] .a-minimal>.accordion-head>li.ellipsis-text{margin:0 .4rem 0 1rem}[data-gene-ui-version=\"2.16.4\"] .a-minimal>.accordion-head>li.line{flex:auto}[data-gene-ui-version=\"2.16.4\"] .a-minimal>.accordion-head .line{background:rgba(var(--background-sc-rgb),.1);height:1px}[data-gene-ui-version=\"2.16.4\"] .accordion-head .accordion-head-arrow{transition:transform .3s}[data-gene-ui-version=\"2.16.4\"] .accordion-body{font:1.2rem/1.33 var(--font-family)}[data-gene-ui-version=\"2.16.4\"] .a-default .accordion-body{padding:1rem 2rem}[data-gene-ui-version=\"2.16.4\"] .a-minimal .accordion-body{padding:1rem 0 1rem 2.8rem}html[dir=rtl] .a-minimal .accordion-body{padding:1rem 2.8rem 1rem 0}";
|
|
13
|
-
styleInject(css_248z);
|
|
14
|
-
|
|
15
|
-
const appearances$1 = ['default', 'minimal'];
|
|
16
|
-
function Panel(props) {
|
|
17
|
-
const {
|
|
18
|
-
appearance,
|
|
19
|
-
disabled,
|
|
20
|
-
opened,
|
|
21
|
-
title,
|
|
22
|
-
children,
|
|
23
|
-
onClick,
|
|
24
|
-
expandIcon,
|
|
25
|
-
showIcon,
|
|
26
|
-
className,
|
|
27
|
-
rightAction,
|
|
28
|
-
...restProps
|
|
29
|
-
} = props;
|
|
30
|
-
return /*#__PURE__*/React__default.createElement("div", _extends({}, restProps, {
|
|
31
|
-
className: classnames('accordion-holder', className, "a-".concat(appearance), {
|
|
32
|
-
disabled,
|
|
33
|
-
active: opened
|
|
34
|
-
})
|
|
35
|
-
}), /*#__PURE__*/React__default.createElement("ul", {
|
|
36
|
-
className: "accordion-head",
|
|
37
|
-
onClick: onClick
|
|
38
|
-
}, showIcon && /*#__PURE__*/React__default.createElement("li", null, expandIcon ? expandIcon(opened, props) : /*#__PURE__*/React__default.createElement(Icon, {
|
|
39
|
-
type: "bc-icon-arrow-down",
|
|
40
|
-
className: "accordion-head-arrow"
|
|
41
|
-
})), /*#__PURE__*/React__default.createElement("li", {
|
|
42
|
-
className: "ellipsis-text"
|
|
43
|
-
}, title), /*#__PURE__*/React__default.createElement("li", {
|
|
44
|
-
className: "line"
|
|
45
|
-
}), /*#__PURE__*/React__default.createElement("li", null, rightAction)), opened && /*#__PURE__*/React__default.createElement("div", {
|
|
46
|
-
className: "accordion-body"
|
|
47
|
-
}, children));
|
|
48
|
-
}
|
|
49
|
-
Panel.propTypes = {
|
|
50
|
-
/**
|
|
51
|
-
* Same as "Collapse" appearance. Note that you must not specify this prop in Panel itself
|
|
52
|
-
*/
|
|
53
|
-
appearance: PropTypes.oneOf(appearances$1),
|
|
54
|
-
/**
|
|
55
|
-
* Disabled state of Panel. Note it will set css "pointer-events" to "none" when set to "true"
|
|
56
|
-
*/
|
|
57
|
-
disabled: PropTypes.bool,
|
|
58
|
-
/**
|
|
59
|
-
* Panel is opened when set to "true". Note that you must not specify this prop in Panel itself
|
|
60
|
-
*/
|
|
61
|
-
opened: PropTypes.bool,
|
|
62
|
-
/**
|
|
63
|
-
* Use this prop to specify Panel's title. Any valid React node
|
|
64
|
-
*/
|
|
65
|
-
title: PropTypes.node,
|
|
66
|
-
/**
|
|
67
|
-
* Use this prop to specify Panel's content. Any valid React node
|
|
68
|
-
*/
|
|
69
|
-
children: PropTypes.node,
|
|
70
|
-
/**
|
|
71
|
-
* Fires an event on Panel click((event: Event) => void)
|
|
72
|
-
*/
|
|
73
|
-
onClick: PropTypes.func,
|
|
74
|
-
/**
|
|
75
|
-
* Same as Collapse. Note that you must not specify this prop in Panel itself
|
|
76
|
-
*/
|
|
77
|
-
expandIcon: PropTypes.func,
|
|
78
|
-
/**
|
|
79
|
-
* Hides the Panel icon when set to "false"
|
|
80
|
-
*/
|
|
81
|
-
showIcon: PropTypes.bool,
|
|
82
|
-
/**
|
|
83
|
-
* Additional className
|
|
84
|
-
*/
|
|
85
|
-
className: PropTypes.string,
|
|
86
|
-
/**
|
|
87
|
-
* Right action bar. Any valid React node
|
|
88
|
-
*/
|
|
89
|
-
rightAction: PropTypes.node
|
|
90
|
-
};
|
|
91
|
-
Panel.defaultProps = {
|
|
92
|
-
disabled: false,
|
|
93
|
-
showIcon: true
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const deepCheck = children => {
|
|
97
|
-
Array.from(children).every(child => {
|
|
98
|
-
Array.isArray(child) && deepCheck(child);
|
|
99
|
-
return PropTypes.shape({
|
|
100
|
-
type: PropTypes.instanceOf(Panel)
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const appearances = ['default', 'minimal'];
|
|
106
|
-
const getActiveKeys = (activeKeys, key, accordion, isControlled) => !isControlled && accordion ? activeKeys[0] === key ? [] : [key] : activeKeys.includes(key) ? activeKeys.filter(item => item !== key) : [...activeKeys, key];
|
|
107
|
-
function Collapse(props) {
|
|
108
|
-
const {
|
|
109
|
-
children,
|
|
110
|
-
defaultActiveKeys,
|
|
111
|
-
onChange,
|
|
112
|
-
appearance,
|
|
113
|
-
accordion,
|
|
114
|
-
expandIcon,
|
|
115
|
-
allActive
|
|
116
|
-
} = props;
|
|
117
|
-
const allKeys = useMemo(() => React__default.Children.map(children, _ref => {
|
|
118
|
-
let {
|
|
119
|
-
key
|
|
120
|
-
} = _ref;
|
|
121
|
-
return key;
|
|
122
|
-
}), [children]);
|
|
123
|
-
const isControlled = ('activeKeys' in props);
|
|
124
|
-
const [activeKeysState, setActiveKeysState] = useState(() => allActive ? allKeys : defaultActiveKeys);
|
|
125
|
-
const activeKeys = isControlled ? props.activeKeys : activeKeysState;
|
|
126
|
-
isControlled && accordion && conflictPropsLog('Collapse', ['activeKeys', 'accordion'], true);
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
accordion && setActiveKeysState(prev => [prev[0]]);
|
|
129
|
-
}, [accordion]);
|
|
130
|
-
useEffect(() => {
|
|
131
|
-
allActive && setActiveKeysState(allKeys);
|
|
132
|
-
}, [allActive, allKeys]);
|
|
133
|
-
return React__default.Children.map(children, (child, index) => {
|
|
134
|
-
var _childProps$opened;
|
|
135
|
-
const {
|
|
136
|
-
key,
|
|
137
|
-
props: childProps
|
|
138
|
-
} = child;
|
|
139
|
-
const handleClick = e => {
|
|
140
|
-
const newActiveKeys = getActiveKeys(activeKeys, key, accordion, isControlled);
|
|
141
|
-
!isControlled && setActiveKeysState(newActiveKeys);
|
|
142
|
-
onChange && onChange(newActiveKeys);
|
|
143
|
-
childProps.onClick && childProps.onClick(e, childProps, index);
|
|
144
|
-
};
|
|
145
|
-
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
146
|
-
opened: (_childProps$opened = childProps.opened) !== null && _childProps$opened !== void 0 ? _childProps$opened : activeKeys.includes(key),
|
|
147
|
-
onClick: handleClick,
|
|
148
|
-
appearance,
|
|
149
|
-
expandIcon
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
Collapse.propTypes = {
|
|
154
|
-
/**
|
|
155
|
-
* The child or children of Collapse molecule is "Panel"
|
|
156
|
-
*/
|
|
157
|
-
children: (props, propName, componentName) => deepCheck(props.children),
|
|
158
|
-
/**
|
|
159
|
-
* Keys provided in array must correspond the keys which are set on child "Panel"'s. Also they will be opened.
|
|
160
|
-
* Using this prop means that you are controlling Collapse molecule
|
|
161
|
-
*/
|
|
162
|
-
activeKeys: PropTypes.arrayOf(PropTypes.string),
|
|
163
|
-
/**
|
|
164
|
-
* Provide default state of opened "Panel"-s. Note that using this key does not mean to control Collapse
|
|
165
|
-
*/
|
|
166
|
-
defaultActiveKeys: PropTypes.arrayOf(PropTypes.string),
|
|
167
|
-
/**
|
|
168
|
-
* Fires an event on Panel click((arrayOfKeys: string[]) => void)
|
|
169
|
-
*/
|
|
170
|
-
onChange: PropTypes.func,
|
|
171
|
-
/**
|
|
172
|
-
* Collapse appearance
|
|
173
|
-
*/
|
|
174
|
-
appearance: PropTypes.oneOf(appearances),
|
|
175
|
-
/**
|
|
176
|
-
* Only one "Panel" can be opened at a time when set to "true"
|
|
177
|
-
*/
|
|
178
|
-
accordion: PropTypes.bool,
|
|
179
|
-
/**
|
|
180
|
-
* Use this prop to override default icons of "Panel"(opened: boolean) => ReactElement
|
|
181
|
-
*/
|
|
182
|
-
expandIcon: PropTypes.func,
|
|
183
|
-
/**
|
|
184
|
-
* All 'Panel'-s are open/close by this prop
|
|
185
|
-
*/
|
|
186
|
-
allActive: PropTypes.bool
|
|
187
|
-
};
|
|
188
|
-
Collapse.defaultProps = {
|
|
189
|
-
appearance: appearances[1],
|
|
190
|
-
accordion: false,
|
|
191
|
-
defaultActiveKeys: [],
|
|
192
|
-
allActive: false
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
export { Collapse, Panel };
|