@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
package/Tabs/index.js
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
|
+
import React__default, { useRef, useEffect, useState, useCallback, useMemo } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { c as classnames } from '../index-6ff23041.js';
|
|
5
|
+
import Icon from '../Icon/index.js';
|
|
6
|
+
import { c as childrenOf } from '../index-a0e4e333.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
|
+
function Tab(props) {
|
|
13
|
+
const {
|
|
14
|
+
title,
|
|
15
|
+
icon,
|
|
16
|
+
active,
|
|
17
|
+
onClose,
|
|
18
|
+
disabled,
|
|
19
|
+
activeKey,
|
|
20
|
+
closeTitleText,
|
|
21
|
+
defaultActiveKey,
|
|
22
|
+
...restProps
|
|
23
|
+
} = props;
|
|
24
|
+
const ref = useRef(null);
|
|
25
|
+
const isCloseable = props.hasOwnProperty('onClose') && typeof onClose === 'function';
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (active && activeKey && defaultActiveKey !== activeKey && (defaultActiveKey || defaultActiveKey === 0)) {
|
|
28
|
+
ref.current.scrollIntoView({
|
|
29
|
+
behavior: 'smooth',
|
|
30
|
+
inline: 'nearest',
|
|
31
|
+
block: 'start'
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}, [active, activeKey, defaultActiveKey]);
|
|
35
|
+
return /*#__PURE__*/React__default.createElement("li", _extends({
|
|
36
|
+
ref: ref,
|
|
37
|
+
className: classnames({
|
|
38
|
+
active,
|
|
39
|
+
disabled
|
|
40
|
+
})
|
|
41
|
+
}, restProps), icon && /*#__PURE__*/React__default.createElement(Icon, {
|
|
42
|
+
type: icon,
|
|
43
|
+
className: "tab-icon"
|
|
44
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
45
|
+
className: "ellipsis-text"
|
|
46
|
+
}, title), isCloseable && /*#__PURE__*/React__default.createElement("button", {
|
|
47
|
+
onClick: e => {
|
|
48
|
+
e.stopPropagation();
|
|
49
|
+
onClose();
|
|
50
|
+
},
|
|
51
|
+
className: "tab-close-button",
|
|
52
|
+
title: closeTitleText
|
|
53
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
54
|
+
type: "bc-icon-close"
|
|
55
|
+
})));
|
|
56
|
+
}
|
|
57
|
+
Tab.propTypes = {
|
|
58
|
+
/**
|
|
59
|
+
* Title for 'Tab'.
|
|
60
|
+
*/
|
|
61
|
+
title: PropTypes.node,
|
|
62
|
+
/**
|
|
63
|
+
* Active/Passive state of 'Tab'
|
|
64
|
+
*/
|
|
65
|
+
active: PropTypes.bool,
|
|
66
|
+
/**
|
|
67
|
+
* Disabled state of 'Tab'
|
|
68
|
+
*/
|
|
69
|
+
disabled: PropTypes.bool,
|
|
70
|
+
/**
|
|
71
|
+
* Icon of 'Tab'
|
|
72
|
+
*/
|
|
73
|
+
icon: PropTypes.string,
|
|
74
|
+
/**
|
|
75
|
+
* Content padding for specific 'Tab'
|
|
76
|
+
*/
|
|
77
|
+
contentPadding: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
78
|
+
/**
|
|
79
|
+
* Prop for specifying which tab is active
|
|
80
|
+
*/
|
|
81
|
+
activeKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
82
|
+
/**
|
|
83
|
+
* Prop for default active tab
|
|
84
|
+
*/
|
|
85
|
+
defaultActiveKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
86
|
+
/**
|
|
87
|
+
* Shows close button and triggers function onClick
|
|
88
|
+
*/
|
|
89
|
+
onClose: PropTypes.func,
|
|
90
|
+
/**
|
|
91
|
+
* Shows title hovering the close button
|
|
92
|
+
*/
|
|
93
|
+
closeTitleText: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
|
|
94
|
+
};
|
|
95
|
+
Tab.defaultProps = {
|
|
96
|
+
disabled: false
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .tabs-holder{align-items:flex-start;display:flex;width:100%}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.reversed{flex-direction:row-reverse}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.horizontal{flex-direction:column}[data-gene-ui-version=\"2.12.2\"] .tabs-head{display:flex;flex-shrink:0;-webkit-user-select:none;user-select:none}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.horizontal>.tabs-head{width:100%}[data-gene-ui-version=\"2.12.2\"] .tabs-head>.tabs-wrapper{flex:auto}[data-gene-ui-version=\"2.12.2\"] .tabs-head>.tabs-actions{align-items:center;box-shadow:inset 0 -1px 0 0 rgba(var(--background-sc-rgb),.06);color:var(--hero);display:flex;flex-shrink:0}[data-gene-ui-version=\"2.12.2\"] .tabs-head>.tabs-actions>*{margin-inline-end:2rem}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.horizontal>.tabs-head>.tabs-wrapper{overflow-x:auto;width:100%}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.horizontal>.tabs-head>.tabs-wrapper::-webkit-scrollbar{display:none;height:0;width:0}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.horizontal>.tabs-head>.tabs-wrapper>.tabs-content.equal-tabs,[data-gene-ui-version=\"2.12.2\"] .tabs-holder.horizontal>.tabs-head>.tabs-wrapper>.tabs-content.type-basic{min-width:100%}[data-gene-ui-version=\"2.12.2\"] .tabs-content{display:inline-flex;font-weight:600;line-height:4.2rem;text-align:center;vertical-align:top}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content{flex-direction:column;text-align:start}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content .tab-icon{display:none}[data-gene-ui-version=\"2.12.2\"] .tabs-content>li{align-items:center;cursor:pointer;display:flex;justify-content:center;padding:0 2rem;position:relative;transition:color .3s,box-shadow .3s,border-color .3s,background-color,.3s}[data-gene-ui-version=\"2.12.2\"] .tabs-content>li .tab-icon{flex-shrink:0;margin-inline-end:1.4rem;margin-inline-start:-.4rem}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content>li{justify-content:flex-start;padding:0 3rem 0 2rem}html[dir=rtl] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content>li{padding:0 2rem 0 3rem}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical:not(.reversed)>.tabs-head>.tabs-wrapper>.type-basic.tabs-content>li{justify-content:flex-end}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.reversed>.tabs-head>.tabs-wrapper>.tabs-content>li{padding:0 2rem 0 3rem}html[dir=rtl] .tabs-holder.reversed>.tabs-head>.tabs-wrapper>.tabs-content>li{padding:0 3rem 0 2rem}[data-gene-ui-version=\"2.12.2\"] .tabs-content>li.disabled{opacity:.5}[data-gene-ui-version=\"2.12.2\"] .tabs-content>li.active,[data-gene-ui-version=\"2.12.2\"] .tabs-content>li.disabled{pointer-events:none}[data-gene-ui-version=\"2.12.2\"] .tabs-content>li .tab-close-button{align-items:center;background:rgba(var(--background-sc-rgb),.07);border-radius:100%;color:var(--background-sc);cursor:pointer;display:flex;height:1.6rem;justify-content:center;margin-inline-end:-1.6rem;margin-inline-start:.8rem;pointer-events:auto;transition:color .3s,background-color .3s;width:1.6rem}[data-gene-ui-version=\"2.12.2\"] .tabs-content>li .tab-close-button .icon{font-size:1.2rem}@media (hover:hover){[data-gene-ui-version=\"2.12.2\"] .tabs-content>li .tab-close-button:hover{background:var(--hero);color:var(--hero-sc)}}[data-gene-ui-version=\"2.12.2\"] .tabs-content.active .tab-close-button{background:rgba(var(--hero-rgb),.1);color:var(--hero)}@media (hover:hover){[data-gene-ui-version=\"2.12.2\"] .tabs-content.active .tab-close-button:hover{background:var(--hero);color:var(--hero-sc)}}[data-gene-ui-version=\"2.12.2\"] .tabs-content.equal-tabs>li{flex:1;min-width:12rem}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.equal-tabs>li{width:13rem}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.equal-tabs.type-text>li{width:12rem}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-basic{box-shadow:inset 0 -1px 0 0 rgba(var(--background-sc-rgb),.06);line-height:4.6rem;padding:0 2rem}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-basic{box-shadow:inset -1px 0 0 rgba(var(--background-sc-rgb),.06);padding:2rem 0;text-align:end}html[dir=rtl] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-basic{box-shadow:inset 1px 0 0 rgba(var(--background-sc-rgb),.06)}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.reversed>.tabs-head>.tabs-wrapper>.tabs-content.type-basic{box-shadow:inset 1px 0 0 rgba(var(--background-sc-rgb),.06);text-align:start}html[dir=rtl] .tabs-holder.reversed>.tabs-head>.tabs-wrapper>.tabs-content.type-basic{box-shadow:inset -1px 0 0 rgba(var(--background-sc-rgb),.06)}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-basic>li{box-shadow:inset 0 0 0 var(--hero);flex:inherit}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-basic>li.active{box-shadow:inset 0 -.4rem 0 0 var(--hero)}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-basic>li.active{box-shadow:inset -.3rem 0 0 var(--hero)}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.reversed>.tabs-head>.tabs-wrapper>.tabs-content.type-basic>li.active,html[dir=rtl] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-basic>li.active{box-shadow:inset .3rem 0 0 var(--hero)}html[dir=rtl] .tabs-holder.reversed>.tabs-head>.tabs-wrapper>.tabs-content.type-basic>li.active{box-shadow:inset -.3rem 0 0 var(--hero)}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-box>li{border:1px solid #0000;border-radius:1rem 1rem 0 0;line-height:4.1rem}[data-gene-ui-version=\"2.12.2\"] .tabs-holder:not(.vertical)>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li+*{margin:0 0 0 .2rem}html[dir=rtl] .tabs-holder:not(.vertical)>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li+*{margin:0 .2rem 0 0}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li{border-radius:1rem 0 0 1rem}html[dir=rtl] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li{border-radius:0 1rem 1rem 0}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li+*{margin:.2rem 0 0}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical.reversed>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li{border-radius:0 1rem 1rem 0}html[dir=rtl] .tabs-holder.vertical.reversed>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li{border-radius:1rem 0 0 1rem}@media (hover:hover){[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-box>li:hover{border-color:rgba(var(--background-sc-rgb),.1)}}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-box>li.active{border-color:rgba(var(--background-sc-rgb),.1)}@media (hover:hover){html:not([dir=rtl]) .tabs-holder.vertical:not(.reversed)>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li:hover{border-right-color:#0000}html:not([dir=rtl]) .tabs-holder.vertical.reversed>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li:hover,html[dir=rtl] .tabs-holder.vertical:not(.reversed)>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li:hover{border-left-color:#0000}html[dir=rtl] .tabs-holder.vertical.reversed>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li:hover{border-right-color:#0000}}[data-gene-ui-version=\"2.12.2\"] .tabs-holder:not(.vertical)>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li.active{border-bottom-color:var(--background)}html:not([dir=rtl]) .tabs-holder.vertical:not(.reversed)>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li.active{border-right-color:var(--background)}html:not([dir=rtl]) .tabs-holder.reversed.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li.active,html[dir=rtl] .tabs-holder.vertical:not(.reversed)>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li.active{border-left-color:var(--background)}html[dir=rtl] .tabs-holder.reversed.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-box>li.active{border-right-color:var(--background)}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-button{box-shadow:inset 0 0 0 1px rgba(var(--background-sc-rgb),.1)}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-button:not(.equal-tabs)>li{padding:0 2rem}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-button>li{box-shadow:inset 0 0 0 0 var(--hero)}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-button>li.active{box-shadow:inset 0 0 0 1px var(--hero)}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-text.equal-tabs>li{min-width:10rem}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-text.equal-tabs>li{min-width:12rem}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-text>li{line-height:2.8rem;padding:0 1.5rem}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-text>li{padding:0 2rem}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-head>.tabs-wrapper>.tabs-content.type-text>li+*{margin:1rem 0 0}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-text>li.active{background:var(--hero);color:var(--hero-sc)}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-box>li.active,[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-button>li.active{color:var(--hero)}[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-button,[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-button>li,[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-text,[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-text>li{border-radius:2rem}@media (hover:hover){[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-button>li:not(.active):hover,[data-gene-ui-version=\"2.12.2\"] .tabs-content.type-text>li:not(.active):hover{color:var(--hero)}}[data-gene-ui-version=\"2.12.2\"] .tabs-content-holder{width:100%}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-content-holder{flex:auto}[data-gene-ui-version=\"2.12.2\"] .tabs-content-holder.c-type-box{align-self:stretch;border:1px solid rgba(var(--background-sc-rgb),.1);border-radius:0 0 1rem 1rem;margin:-1px 0 0}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical>.tabs-content-holder.c-type-box{border-radius:1rem}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical:not(.reversed)>.tabs-content-holder.c-type-box{border-radius:0 1rem 1rem 0;margin:0 0 0 -1px}[data-gene-ui-version=\"2.12.2\"] .tabs-holder.vertical.reversed>.tabs-content-holder.c-type-box,html[dir=rtl] .tabs-holder.vertical:not(.reversed)>.tabs-content-holder.c-type-box{border-radius:1rem 0 0 1rem;margin:0 -1px 0 0}html[dir=rtl] .tabs-holder.vertical.reversed>.tabs-content-holder.c-type-box{border-radius:0 1rem 1rem 0;margin:0 0 0 -1px}[data-gene-ui-version=\"2.12.2\"] .external-link{align-items:center;display:flex;font-weight:600}[data-gene-ui-version=\"2.12.2\"] .external-link>*+*{margin-inline-start:.2rem}";
|
|
100
|
+
styleInject(css_248z);
|
|
101
|
+
|
|
102
|
+
function Tabs(props) {
|
|
103
|
+
const {
|
|
104
|
+
type,
|
|
105
|
+
actions,
|
|
106
|
+
position,
|
|
107
|
+
children,
|
|
108
|
+
fixedSize,
|
|
109
|
+
onChange,
|
|
110
|
+
className,
|
|
111
|
+
defaultActiveKey,
|
|
112
|
+
contentClassName,
|
|
113
|
+
contentPadding
|
|
114
|
+
} = props;
|
|
115
|
+
const holderRef = useRef(null);
|
|
116
|
+
const isControlled = ('activeKey' in props);
|
|
117
|
+
const [active, setActive] = useState(() => defaultActiveKey || getDefaultActiveKey(children));
|
|
118
|
+
const activeKey = isControlled ? props.activeKey : active;
|
|
119
|
+
const handleClick = useCallback(key => {
|
|
120
|
+
!isControlled && setActive(key);
|
|
121
|
+
onChange && onChange(key);
|
|
122
|
+
(holderRef === null || holderRef === void 0 ? void 0 : holderRef.current) && holderRef.current.scrollTo(0, 0);
|
|
123
|
+
}, [onChange, isControlled, holderRef.current]);
|
|
124
|
+
const {
|
|
125
|
+
tabs,
|
|
126
|
+
content,
|
|
127
|
+
tabContentPadding
|
|
128
|
+
} = useMemo(() => getTabsAndContent(children, activeKey, defaultActiveKey, handleClick), [children, activeKey, handleClick]);
|
|
129
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
130
|
+
className: classnames('tabs-holder', className, {
|
|
131
|
+
vertical: position !== 'top',
|
|
132
|
+
reversed: position === 'right',
|
|
133
|
+
horizontal: position === 'top'
|
|
134
|
+
})
|
|
135
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
136
|
+
className: "tabs-head"
|
|
137
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
138
|
+
className: "tabs-wrapper"
|
|
139
|
+
}, /*#__PURE__*/React__default.createElement("ul", {
|
|
140
|
+
className: classnames('tabs-content', "type-".concat(type), {
|
|
141
|
+
'equal-tabs': fixedSize
|
|
142
|
+
})
|
|
143
|
+
}, tabs)), actions && position === 'top' && /*#__PURE__*/React__default.createElement("div", {
|
|
144
|
+
className: "tabs-actions"
|
|
145
|
+
}, actions)), /*#__PURE__*/React__default.createElement("div", {
|
|
146
|
+
ref: holderRef,
|
|
147
|
+
className: classnames('tabs-content-holder', contentClassName, {
|
|
148
|
+
'c-type-box': type === 'box'
|
|
149
|
+
}),
|
|
150
|
+
style: {
|
|
151
|
+
padding: "".concat((tabContentPadding || contentPadding) / 10, "rem")
|
|
152
|
+
}
|
|
153
|
+
}, content));
|
|
154
|
+
}
|
|
155
|
+
Tabs.propTypes = {
|
|
156
|
+
/**
|
|
157
|
+
* Any valid react node, will be shown at right side of tab menu bar.
|
|
158
|
+
*/
|
|
159
|
+
actions: PropTypes.node,
|
|
160
|
+
/**
|
|
161
|
+
* Prop for specifying which tab is active
|
|
162
|
+
*/
|
|
163
|
+
activeKey: PropTypes.string,
|
|
164
|
+
/**
|
|
165
|
+
* Prop for default active tab
|
|
166
|
+
*/
|
|
167
|
+
defaultActiveKey: PropTypes.string,
|
|
168
|
+
/**
|
|
169
|
+
* Style of tab menu bar
|
|
170
|
+
*/
|
|
171
|
+
type: PropTypes.oneOf(['basic', 'box', 'button', 'text']),
|
|
172
|
+
/**
|
|
173
|
+
* Position of tab menu bar
|
|
174
|
+
*/
|
|
175
|
+
position: PropTypes.oneOf(['top', 'left', 'right']),
|
|
176
|
+
/**
|
|
177
|
+
* Size of tabs will be fixed when the value is true
|
|
178
|
+
*/
|
|
179
|
+
fixedSize: PropTypes.bool,
|
|
180
|
+
/**
|
|
181
|
+
* Callback function, fired when tab changes
|
|
182
|
+
*/
|
|
183
|
+
onChange: PropTypes.func,
|
|
184
|
+
/**
|
|
185
|
+
* Any valid react node
|
|
186
|
+
*/
|
|
187
|
+
children: childrenOf([Tab]),
|
|
188
|
+
/**
|
|
189
|
+
* Additional classname for content wrapper
|
|
190
|
+
*/
|
|
191
|
+
contentClassName: PropTypes.string,
|
|
192
|
+
/**
|
|
193
|
+
* Padding value for content wrapper
|
|
194
|
+
*/
|
|
195
|
+
contentPadding: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
196
|
+
};
|
|
197
|
+
Tabs.defaultProps = {
|
|
198
|
+
type: 'basic',
|
|
199
|
+
position: 'top',
|
|
200
|
+
fixedSize: false,
|
|
201
|
+
contentPadding: 19
|
|
202
|
+
};
|
|
203
|
+
function getDefaultActiveKey(children) {
|
|
204
|
+
let defaultActiveKey;
|
|
205
|
+
React__default.Children.forEach(children, child => {
|
|
206
|
+
if (!defaultActiveKey && !child.props.disabled) {
|
|
207
|
+
defaultActiveKey = child.key;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
return defaultActiveKey;
|
|
211
|
+
}
|
|
212
|
+
function getTabsAndContent(children, activeKey, defaultActiveKey, handleClick) {
|
|
213
|
+
let content;
|
|
214
|
+
let tabContentPadding;
|
|
215
|
+
const tabs = React__default.Children.map(children, child => {
|
|
216
|
+
const active = child.key === activeKey;
|
|
217
|
+
if (active) {
|
|
218
|
+
content = child.props.children;
|
|
219
|
+
tabContentPadding = child.props.contentPadding;
|
|
220
|
+
}
|
|
221
|
+
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
222
|
+
onClick: () => handleClick(child.key),
|
|
223
|
+
defaultActiveKey,
|
|
224
|
+
activeKey,
|
|
225
|
+
active
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
return {
|
|
229
|
+
tabs,
|
|
230
|
+
content,
|
|
231
|
+
tabContentPadding
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export { Tab, Tabs };
|
package/Tag/index.js
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { c as classnames } from '../index-6ff23041.js';
|
|
5
|
+
import { f as tagConfig } from '../configs-fed6ac34.js';
|
|
6
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
7
|
+
|
|
8
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .static-title-holder{align-items:flex-start;display:inline-flex;flex-direction:column;max-width:100%;vertical-align:top}[data-gene-ui-version=\"2.12.2\"] .static-title-holder .st-t{font:600 1.4rem/1.8rem var(--font-family);margin:0 0 .4rem;opacity:.5;padding:0 var(--static-title-padding,0)}[data-gene-ui-version=\"2.12.2\"] .static-title-holder .st-c{max-width:100%}[data-gene-ui-version=\"2.12.2\"] .static-title-holder .st-c:nth-child(2){align-items:center;display:flex;min-height:3.2rem}[data-gene-ui-version=\"2.12.2\"] .static-title-holder.f-full-width,[data-gene-ui-version=\"2.12.2\"] .static-title-holder.f-full-width .st-c{width:100%}[data-gene-ui-version=\"2.12.2\"] .tag-c{--color:var(--hero);align-items:center;background:var(--background);color:var(--color);display:flex;flex-direction:row-reverse;flex-shrink:0;font:600 1.4rem/1.8rem var(--font-family);height:var(--size);justify-content:center;max-width:100%;padding:0 1rem;position:relative;text-align:center;transition:color .3s;-webkit-user-select:none;user-select:none;width:100%}[data-gene-ui-version=\"2.12.2\"] .tag-c.s-small{--size:2.4rem;font-size:1.2rem}html:not([dir=rtl]) .tag-c.s-small .icon{margin-left:1px}html[dir=rtl] .tag-c.s-small .icon{margin-right:1px}[data-gene-ui-version=\"2.12.2\"] .tag-c.s-medium{--size:2.6rem}html:not([dir=rtl]) .tag-c.s-medium .icon{margin-left:.5rem}html[dir=rtl] .tag-c.s-medium .icon{margin-right:.5rem}[data-gene-ui-version=\"2.12.2\"] .tag-c.s-big{--size:3rem}html:not([dir=rtl]) .tag-c.s-big .icon{margin-left:.5rem}html[dir=rtl] .tag-c.s-big .icon{margin-right:.5rem}[data-gene-ui-version=\"2.12.2\"] .tag-c.f-compact{min-width:var(--size)}[data-gene-ui-version=\"2.12.2\"] .tag-c.f-compact.s-small{padding:0 .4rem}[data-gene-ui-version=\"2.12.2\"] .tag-c.f-compact.s-medium{padding:0 .5rem}[data-gene-ui-version=\"2.12.2\"] .tag-c.f-compact.s-big{padding:0 .7rem}html:not([dir=rtl]) .tag-c:not(.f-compact).s-small .icon{margin-right:-.9rem}html[dir=rtl] .tag-c:not(.f-compact).s-small .icon{margin-left:-.9rem}html:not([dir=rtl]) .tag-c:not(.f-compact).s-medium .icon{margin-right:-.7rem}html[dir=rtl] .tag-c:not(.f-compact).s-medium .icon{margin-left:-.7rem}html:not([dir=rtl]) .tag-c:not(.f-compact).s-big .icon{margin-right:-.2rem}html[dir=rtl] .tag-c:not(.f-compact).s-big .icon{margin-left:-.2rem}[data-gene-ui-version=\"2.12.2\"] .tag-c.cr-full-radius{border-radius:1.4rem}[data-gene-ui-version=\"2.12.2\"] .tag-c.cr-smooth-radius{border-radius:.6rem}[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-simple{--color:var(--background-sc)}[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-simple .tag-backdrop:before{opacity:.1}[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-simple .tag-backdrop:after{content:none}[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-minimal .tag-backdrop{--color:var(--background-sc)}[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-minimal .tag-backdrop:before{opacity:.03}[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-minimal .tag-backdrop:after{opacity:.07}[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-outline .tag-backdrop:before{content:none}[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-colored .tag-backdrop:before{opacity:.1}[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-clean{--color:var(--background-sc)}@media (hover:hover){[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-clean:hover{--color:var(--hero)}}[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-clean .tag-backdrop:after,[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-clean .tag-backdrop:before{content:none}[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-light .tag-backdrop:before{opacity:.1}[data-gene-ui-version=\"2.12.2\"] .tag-c:not(.active).a-light .tag-backdrop:after{border:0}[data-gene-ui-version=\"2.12.2\"] .tag-c.active{color:var(--hero-sc)}@media (hover:hover){[data-gene-ui-version=\"2.12.2\"] .tag-c:hover .tag-backdrop{opacity:.6}}[data-gene-ui-version=\"2.12.2\"] .tag-c .icon,[data-gene-ui-version=\"2.12.2\"] .tag-c .tag-cc{position:relative;transition:opacity .3s;z-index:1}[data-gene-ui-version=\"2.12.2\"] .tag-c .icon{cursor:pointer;opacity:.5}@media (hover:hover){[data-gene-ui-version=\"2.12.2\"] .tag-c .icon:hover{opacity:1}[data-gene-ui-version=\"2.12.2\"] .tag-c .icon:hover~.tag-cp{opacity:.6}}[data-gene-ui-version=\"2.12.2\"] .tag-backdrop{border-radius:inherit;height:100%;left:0;position:absolute;top:0;transition:opacity .3s;width:100%}[data-gene-ui-version=\"2.12.2\"] .tag-backdrop:after,[data-gene-ui-version=\"2.12.2\"] .tag-backdrop:before{border-radius:inherit;content:\"\";display:block;height:100%;left:0;position:absolute;top:0;width:100%}[data-gene-ui-version=\"2.12.2\"] .tag-backdrop:before{background:var(--color);transition:background .3s,opacity .3s}[data-gene-ui-version=\"2.12.2\"] .tag-backdrop:after{border:1px solid var(--color);transition:border-color .3s,opacity .3s}";
|
|
9
|
+
styleInject(css_248z);
|
|
10
|
+
|
|
11
|
+
function Tag(_ref) {
|
|
12
|
+
let {
|
|
13
|
+
label,
|
|
14
|
+
name,
|
|
15
|
+
cornerRadius,
|
|
16
|
+
size,
|
|
17
|
+
color,
|
|
18
|
+
appearance,
|
|
19
|
+
flexibility,
|
|
20
|
+
selected,
|
|
21
|
+
className,
|
|
22
|
+
cursor,
|
|
23
|
+
icons,
|
|
24
|
+
...restProps
|
|
25
|
+
} = _ref;
|
|
26
|
+
return /*#__PURE__*/React__default.createElement("ul", _extends({
|
|
27
|
+
className: classnames('static-title-holder', className, "f-".concat(flexibility))
|
|
28
|
+
}, restProps), label && /*#__PURE__*/React__default.createElement("li", {
|
|
29
|
+
className: "st-t"
|
|
30
|
+
}, label), /*#__PURE__*/React__default.createElement("li", {
|
|
31
|
+
className: "st-c"
|
|
32
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
33
|
+
className: classnames('tag-c', "cr-".concat(cornerRadius), "a-".concat(appearance), "f-".concat(flexibility), "s-".concat(size), {
|
|
34
|
+
active: selected,
|
|
35
|
+
'pointer-events-none': !icons
|
|
36
|
+
}),
|
|
37
|
+
style: {
|
|
38
|
+
'--hero': color,
|
|
39
|
+
cursor
|
|
40
|
+
}
|
|
41
|
+
}, icons || null, /*#__PURE__*/React__default.createElement("div", {
|
|
42
|
+
className: "tag-cp tag-cc ellipsis-text"
|
|
43
|
+
}, name), /*#__PURE__*/React__default.createElement("div", {
|
|
44
|
+
className: "tag-backdrop"
|
|
45
|
+
}))));
|
|
46
|
+
}
|
|
47
|
+
Tag.propTypes = {
|
|
48
|
+
/**
|
|
49
|
+
* Label for 'Tag'.
|
|
50
|
+
*/
|
|
51
|
+
label: PropTypes.string,
|
|
52
|
+
/**
|
|
53
|
+
* Cursor type for 'Tag'.
|
|
54
|
+
*/
|
|
55
|
+
cursor: PropTypes.string,
|
|
56
|
+
/**
|
|
57
|
+
* Name for 'Tag'.
|
|
58
|
+
*/
|
|
59
|
+
name: PropTypes.string.isRequired,
|
|
60
|
+
/**
|
|
61
|
+
* Border type of corners
|
|
62
|
+
*/
|
|
63
|
+
cornerRadius: PropTypes.oneOf(tagConfig.cornerRadius),
|
|
64
|
+
/**
|
|
65
|
+
* Chooses how to show 'Tag'
|
|
66
|
+
*/
|
|
67
|
+
flexibility: PropTypes.oneOf(tagConfig.flexibility),
|
|
68
|
+
/**
|
|
69
|
+
* Switches between different sizes of 'Tag'.
|
|
70
|
+
*/
|
|
71
|
+
size: PropTypes.oneOf(tagConfig.size),
|
|
72
|
+
/**
|
|
73
|
+
* Color/theming for 'Tag'.
|
|
74
|
+
*/
|
|
75
|
+
color: PropTypes.string,
|
|
76
|
+
/**
|
|
77
|
+
* Switches between different views of 'Tag'.
|
|
78
|
+
*/
|
|
79
|
+
appearance: PropTypes.oneOf(tagConfig.appearance),
|
|
80
|
+
/**
|
|
81
|
+
* Selected state
|
|
82
|
+
*/
|
|
83
|
+
selected: PropTypes.bool,
|
|
84
|
+
/**
|
|
85
|
+
* External/Additional className
|
|
86
|
+
*/
|
|
87
|
+
className: PropTypes.string,
|
|
88
|
+
/**
|
|
89
|
+
* Showing icons
|
|
90
|
+
*/
|
|
91
|
+
icons: PropTypes.node
|
|
92
|
+
};
|
|
93
|
+
Tag.defaultProps = {
|
|
94
|
+
cornerRadius: tagConfig.cornerRadius[0],
|
|
95
|
+
flexibility: tagConfig.flexibility[0],
|
|
96
|
+
size: tagConfig.size[1],
|
|
97
|
+
appearance: tagConfig.appearance[0],
|
|
98
|
+
selected: false,
|
|
99
|
+
cursor: 'pointer'
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export { Tag as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
4
|
function TextLink(_ref) {
|
|
5
5
|
let {
|
|
@@ -12,11 +12,11 @@ TextLink.propTypes = {
|
|
|
12
12
|
/**
|
|
13
13
|
* Any valid React node
|
|
14
14
|
*/
|
|
15
|
-
children:
|
|
15
|
+
children: PropTypes.string.isRequired,
|
|
16
16
|
/**
|
|
17
17
|
* Additional className
|
|
18
18
|
*/
|
|
19
|
-
className:
|
|
19
|
+
className: PropTypes.string
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export { TextLink as default };
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { _ as _extends } from '
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { i as inputConfig, s as screenTypes } from '
|
|
6
|
-
import ExtendedInput from '
|
|
7
|
-
import '
|
|
8
|
-
import
|
|
9
|
-
import '
|
|
10
|
-
import './_commonjsHelpers-24198af3.js';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { n as noop } from '../index-a0e4e333.js';
|
|
5
|
+
import { i as inputConfig, s as screenTypes } from '../configs-fed6ac34.js';
|
|
6
|
+
import ExtendedInput from '../ExtendedInput/index.js';
|
|
7
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
8
|
+
import '../dateValidation-67caec66.js';
|
|
9
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
11
10
|
import 'react-dom';
|
|
12
|
-
import '
|
|
13
|
-
import '
|
|
14
|
-
import '
|
|
15
|
-
import '
|
|
16
|
-
import '
|
|
17
|
-
import '
|
|
18
|
-
import '
|
|
19
|
-
import '
|
|
20
|
-
import '
|
|
21
|
-
import '
|
|
22
|
-
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 '../SuggestionList/index.js';
|
|
17
|
+
import '../hooks/useKeyDown.js';
|
|
18
|
+
import '../hooks/useClickOutside.js';
|
|
19
|
+
import '../config-0ca92874.js';
|
|
20
|
+
import '../Scrollbar/index.js';
|
|
21
|
+
import '../Tooltip/index.js';
|
|
22
|
+
import '../Popover-f4d1cac0.js';
|
|
23
|
+
import '../GeneUIProvider/index.js';
|
|
23
24
|
|
|
24
25
|
var css_248z = "";
|
|
25
26
|
styleInject(css_248z);
|
|
@@ -33,172 +34,172 @@ Textarea.propTypes = {
|
|
|
33
34
|
/**
|
|
34
35
|
* Additional className
|
|
35
36
|
*/
|
|
36
|
-
className:
|
|
37
|
+
className: PropTypes.string,
|
|
37
38
|
/**
|
|
38
39
|
* Control ExtendedInput disabled state with this prop
|
|
39
40
|
*/
|
|
40
|
-
disabled:
|
|
41
|
+
disabled: PropTypes.bool,
|
|
41
42
|
/**
|
|
42
43
|
* Borders will be colored on when "isValid" and this props are set to "true"
|
|
43
44
|
*/
|
|
44
|
-
colorBorderOnError:
|
|
45
|
+
colorBorderOnError: PropTypes.bool,
|
|
45
46
|
/**
|
|
46
47
|
* Shows an icon to clear ExtendedInput's value when set to "true"
|
|
47
48
|
*/
|
|
48
|
-
showClearIcon:
|
|
49
|
+
showClearIcon: PropTypes.bool,
|
|
49
50
|
/**
|
|
50
51
|
* Use this props in combo with "icon" prop. This will fire on icon click when set to "true"
|
|
51
52
|
*/
|
|
52
|
-
clickableIcon:
|
|
53
|
+
clickableIcon: PropTypes.bool,
|
|
53
54
|
/**
|
|
54
55
|
* Shows an error icon when "isValid" is set to "false" and this prop is set to "true"
|
|
55
56
|
*/
|
|
56
|
-
showErrorIcon:
|
|
57
|
+
showErrorIcon: PropTypes.bool,
|
|
57
58
|
/**
|
|
58
59
|
*.
|
|
59
60
|
*/
|
|
60
|
-
showClickableTooltipOnError:
|
|
61
|
+
showClickableTooltipOnError: PropTypes.bool,
|
|
61
62
|
/**
|
|
62
63
|
* ExtendedInput borders are colored when "isValid" and this props are set to "true"
|
|
63
64
|
*/
|
|
64
|
-
colorOnValid:
|
|
65
|
+
colorOnValid: PropTypes.bool,
|
|
65
66
|
/**
|
|
66
67
|
* ExtendedInput will display an icon when "isValid" and this props are set to "true"
|
|
67
68
|
*/
|
|
68
|
-
showIconOnValid:
|
|
69
|
+
showIconOnValid: PropTypes.bool,
|
|
69
70
|
/**
|
|
70
71
|
* Shows the "errorText" value in "Tooltip" when set to "true"
|
|
71
72
|
*/
|
|
72
|
-
showErrorWithTooltip:
|
|
73
|
+
showErrorWithTooltip: PropTypes.bool,
|
|
73
74
|
/**
|
|
74
75
|
* Control ExtendedInput validation. For more info see "ValidatableNumberInput", "ValidatableTextInput"(integrated ExtendedInputs with "Form" organism).
|
|
75
76
|
*/
|
|
76
|
-
isValid:
|
|
77
|
+
isValid: PropTypes.bool,
|
|
77
78
|
/**
|
|
78
79
|
* Use this prop to specify error message. This will be displayed when "isValid" is set to "false"
|
|
79
80
|
*/
|
|
80
|
-
errorText:
|
|
81
|
+
errorText: PropTypes.string,
|
|
81
82
|
/**
|
|
82
83
|
* Use this prop to specify tooltip message.
|
|
83
84
|
*/
|
|
84
|
-
tooltipText:
|
|
85
|
+
tooltipText: PropTypes.string,
|
|
85
86
|
/**
|
|
86
87
|
* Valid values are same as "Icon" type
|
|
87
88
|
*/
|
|
88
|
-
icon:
|
|
89
|
+
icon: PropTypes.string,
|
|
89
90
|
/**
|
|
90
91
|
* ExtendedInput placeholder
|
|
91
92
|
*/
|
|
92
|
-
placeholder:
|
|
93
|
+
placeholder: PropTypes.string,
|
|
93
94
|
/**
|
|
94
95
|
* Control items direction
|
|
95
96
|
*/
|
|
96
|
-
itemsDirection:
|
|
97
|
+
itemsDirection: PropTypes.oneOf(inputConfig.itemsDirection),
|
|
97
98
|
/**
|
|
98
99
|
* Use this prop to control ExtendedInput state. Note that when you specify this prop, the ExtendedInput will not functionate itself
|
|
99
100
|
*/
|
|
100
|
-
value:
|
|
101
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
101
102
|
/**
|
|
102
103
|
* ExtendedInput appearance
|
|
103
104
|
*/
|
|
104
|
-
appearance:
|
|
105
|
+
appearance: PropTypes.oneOf(inputConfig.appearance),
|
|
105
106
|
/**
|
|
106
107
|
* ExtendedInput size
|
|
107
108
|
*/
|
|
108
|
-
inputSize:
|
|
109
|
+
inputSize: PropTypes.oneOf(inputConfig.size),
|
|
109
110
|
/**
|
|
110
111
|
* ExtendedInput corner radius
|
|
111
112
|
*/
|
|
112
|
-
cornerRadius:
|
|
113
|
+
cornerRadius: PropTypes.oneOf(inputConfig.cornerRadius),
|
|
113
114
|
/**
|
|
114
115
|
* Will make ExtendedInput readonly when set to "true"
|
|
115
116
|
*/
|
|
116
|
-
readOnly:
|
|
117
|
+
readOnly: PropTypes.bool,
|
|
117
118
|
/**
|
|
118
119
|
* How to display inscription in relation to it's parent in ExtendedInput
|
|
119
120
|
*/
|
|
120
|
-
flexibility:
|
|
121
|
+
flexibility: PropTypes.oneOf(inputConfig.flexibility),
|
|
121
122
|
/**
|
|
122
123
|
* This prop will only applied once as defaultState for "value" when ExtendedInput mounts.
|
|
123
124
|
* Note that specifying this prop is not mean controlling it.
|
|
124
125
|
*/
|
|
125
|
-
defaultValue:
|
|
126
|
+
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
126
127
|
/**
|
|
127
128
|
* Shows an "Icon" to remove ExtendedInput's value
|
|
128
129
|
*/
|
|
129
|
-
canClear:
|
|
130
|
+
canClear: PropTypes.bool,
|
|
130
131
|
/**
|
|
131
132
|
* Fires an event on clear "Icon" click((element: Element) => void)
|
|
132
133
|
*/
|
|
133
|
-
onClear:
|
|
134
|
+
onClear: PropTypes.func,
|
|
134
135
|
/**
|
|
135
136
|
* Fires an event on ExtendedInput change((event: Event) => void)
|
|
136
137
|
*/
|
|
137
|
-
onChange:
|
|
138
|
+
onChange: PropTypes.func,
|
|
138
139
|
/**
|
|
139
140
|
* Specify a label for ExtendedInput
|
|
140
141
|
*/
|
|
141
|
-
label:
|
|
142
|
+
label: PropTypes.string,
|
|
142
143
|
/**
|
|
143
144
|
* Specify a "label" appearance
|
|
144
145
|
*/
|
|
145
|
-
labelAppearance:
|
|
146
|
+
labelAppearance: PropTypes.oneOf(inputConfig.labelAppearance),
|
|
146
147
|
/**
|
|
147
148
|
* Will add an additional description field
|
|
148
149
|
*/
|
|
149
|
-
description:
|
|
150
|
+
description: PropTypes.node,
|
|
150
151
|
/**
|
|
151
152
|
* Fires an event on ExtendInput <input /> click((event: Event => void))
|
|
152
153
|
*/
|
|
153
|
-
onClick:
|
|
154
|
+
onClick: PropTypes.func,
|
|
154
155
|
/**
|
|
155
156
|
* Typing will be blocked when set to "true". Note design is different from "readonly" prop's design
|
|
156
157
|
*/
|
|
157
|
-
writeProtected:
|
|
158
|
+
writeProtected: PropTypes.bool,
|
|
158
159
|
/**
|
|
159
160
|
* Callback fires when input is focused
|
|
160
161
|
*/
|
|
161
|
-
onFocus:
|
|
162
|
+
onFocus: PropTypes.func,
|
|
162
163
|
/**
|
|
163
164
|
* Callback fires when input loose focus
|
|
164
165
|
*/
|
|
165
|
-
onBlur:
|
|
166
|
+
onBlur: PropTypes.func,
|
|
166
167
|
/**
|
|
167
168
|
* Callback fires when click in icon
|
|
168
169
|
*/
|
|
169
|
-
onIconClick:
|
|
170
|
+
onIconClick: PropTypes.func,
|
|
170
171
|
/**
|
|
171
172
|
* Define is input required or no.
|
|
172
173
|
*/
|
|
173
|
-
required:
|
|
174
|
+
required: PropTypes.bool,
|
|
174
175
|
/**
|
|
175
176
|
* The switch between mobile and desktop version
|
|
176
177
|
*/
|
|
177
|
-
screenType:
|
|
178
|
+
screenType: PropTypes.oneOf(screenTypes),
|
|
178
179
|
/**
|
|
179
180
|
* Define is need input info icon required.
|
|
180
181
|
*/
|
|
181
|
-
withInfoIcon:
|
|
182
|
+
withInfoIcon: PropTypes.bool,
|
|
182
183
|
/**
|
|
183
184
|
* ExtendedInput info icon title.
|
|
184
185
|
*/
|
|
185
|
-
infoIconTitle:
|
|
186
|
+
infoIconTitle: PropTypes.string,
|
|
186
187
|
/**
|
|
187
188
|
* Max Length of input Value
|
|
188
189
|
*/
|
|
189
|
-
maxLength:
|
|
190
|
+
maxLength: PropTypes.number,
|
|
190
191
|
/**
|
|
191
192
|
* Show Remaining Length of input value, works only with maxLength
|
|
192
193
|
*/
|
|
193
|
-
showRemainingLength:
|
|
194
|
+
showRemainingLength: PropTypes.bool,
|
|
194
195
|
/**
|
|
195
196
|
* Suggestion Data
|
|
196
197
|
*/
|
|
197
|
-
suggestionData:
|
|
198
|
-
key:
|
|
199
|
-
data:
|
|
200
|
-
label:
|
|
201
|
-
value:
|
|
198
|
+
suggestionData: PropTypes.arrayOf(PropTypes.shape({
|
|
199
|
+
key: PropTypes.string.isRequired,
|
|
200
|
+
data: PropTypes.arrayOf(PropTypes.shape({
|
|
201
|
+
label: PropTypes.string.isRequired,
|
|
202
|
+
value: PropTypes.string.isRequired
|
|
202
203
|
}))
|
|
203
204
|
}))
|
|
204
205
|
};
|