@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/Holder/index.js
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
|
+
import React__default, { useRef, useState } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { c as classnames } from '../index-6ff23041.js';
|
|
5
|
+
import { n as noop } from '../index-a0e4e333.js';
|
|
6
|
+
import { g as popoverV2Config } from '../configs-fed6ac34.js';
|
|
7
|
+
import Icon from '../Icon/index.js';
|
|
8
|
+
import Button from '../Button/index.js';
|
|
9
|
+
import Portal from '../Portal/index.js';
|
|
10
|
+
import CustomScrollbar from '../Scrollbar/index.js';
|
|
11
|
+
import ModuleTitle from '../ModuleTitle/index.js';
|
|
12
|
+
import Tooltip from '../Tooltip/index.js';
|
|
13
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
14
|
+
import '../dateValidation-67caec66.js';
|
|
15
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
16
|
+
import 'react-dom';
|
|
17
|
+
import '../GeneUIProvider/index.js';
|
|
18
|
+
import '../Popover-f4d1cac0.js';
|
|
19
|
+
import '../hooks/useDeviceType.js';
|
|
20
|
+
import '../hooks/useWindowSize.js';
|
|
21
|
+
|
|
22
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .holder{--delay:200ms;--width:1.9rem;--opened-width:39.9rem;background:var(--background);height:100%;position:relative;top:0;transition:width .4s var(--delay);width:var(--width);z-index:200}[data-gene-ui-version=\"2.12.2\"] .holder.disabled{pointer-events:none}[data-gene-ui-version=\"2.12.2\"] .holder.disabled .holder-toggle .icon{opacity:.5}[data-gene-ui-version=\"2.12.2\"] .holder.pinned{--width:var(--opened-width);--delay:0ms}[data-gene-ui-version=\"2.12.2\"] .holder.pinned.opened .layer-1{transform:scale(1)}[data-gene-ui-version=\"2.12.2\"] .holder.opened{--delay:400ms}[data-gene-ui-version=\"2.12.2\"] .holder.opened .holder-wrapper{opacity:1;width:var(--opened-width)}[data-gene-ui-version=\"2.12.2\"] .holder:not(.pinned).opened .layer-3,[data-gene-ui-version=\"2.12.2\"] .holder:not(.pinned):not(.opened) .layer-2{transform:scale(1)}[data-gene-ui-version=\"2.12.2\"] .holder-c-wrapper{background:var(--background);height:100%;min-width:100%;position:absolute;top:0}[data-gene-ui-version=\"2.12.2\"] .holder-toggle{padding:.5rem;position:absolute;top:1rem}[data-gene-ui-version=\"2.12.2\"] .holder-toggle button{background:var(--background);border-radius:100%;box-shadow:0 0 .2rem rgba(var(--background-sc-rgb),.16);color:var(--hero);cursor:pointer;height:3rem;position:relative;transition:color .25s,background .25s;width:3rem}@media (hover:hover){[data-gene-ui-version=\"2.12.2\"] .holder-toggle button:hover{background:var(--hero);color:var(--hero-sc)}}[data-gene-ui-version=\"2.12.2\"] .holder-toggle button.active{background:var(--hero);color:var(--hero-sc)}@media (hover:hover){[data-gene-ui-version=\"2.12.2\"] .holder-toggle button.active:hover{background:var(--hero-hover)}}[data-gene-ui-version=\"2.12.2\"] .holder-toggle .icon{left:0;padding:.3rem;position:absolute;top:0;transform:scale(0);transition:transform .4s,opacity .4s}[data-gene-ui-version=\"2.12.2\"] .holder-wrapper{height:100%;opacity:0;overflow:hidden;position:relative;transition:opacity .15s var(--delay),width .4s var(--delay);width:var(--width)}html:not([dir=rtl]) .holder-left{left:0}html[dir=rtl] .holder-left{right:0}[data-gene-ui-version=\"2.12.2\"] .holder-left .holder-c-wrapper{border-inline-end:1px solid rgba(var(--background-sc-rgb),.1)}html:not([dir=rtl]) .holder-left .holder-c-wrapper{left:0}html[dir=rtl] .holder-left .holder-c-wrapper{right:0}html:not([dir=rtl]) .holder-left .module-header{padding-right:1.5rem}html[dir=rtl] .holder-left .module-header{padding-left:1.5rem}html:not([dir=rtl]) .holder-left .holder-toggle{right:-2rem}html[dir=rtl] .holder-left .holder-toggle{left:-2rem}html:not([dir=rtl]) .holder-right{right:0}html[dir=rtl] .holder-right{left:0}[data-gene-ui-version=\"2.12.2\"] .holder-right .holder-c-wrapper{border-inline-start:1px solid rgba(var(--background-sc-rgb),.1)}html:not([dir=rtl]) .holder-right .holder-c-wrapper{right:0}html[dir=rtl] .holder-right .holder-c-wrapper{left:0}html:not([dir=rtl]) .holder-right .holder-toggle{left:-2rem}html[dir=rtl] .holder-right .holder-toggle{right:-2rem}[data-gene-ui-version=\"2.12.2\"] .opened .holder-content{width:var(--opened-width)}[data-gene-ui-version=\"2.12.2\"] .holder-content{display:grid;grid-template-areas:\"head\" \"body\" \"footer\";grid-template-columns:100%;grid-template-rows:auto 1fr auto;height:100%;overflow:hidden}[data-gene-ui-version=\"2.12.2\"] .holder-content .module-header{grid-area:head}[data-gene-ui-version=\"2.12.2\"] .holder-content .holder-body{grid-area:body}[data-gene-ui-version=\"2.12.2\"] .holder-footer{border-top:1px solid rgba(var(--background-sc-rgb),.1);display:flex;grid-area:footer;padding:2rem}[data-gene-ui-version=\"2.12.2\"] .holder-footer:empty{display:none}[data-gene-ui-version=\"2.12.2\"] .holder-body-c{display:flex;flex-wrap:wrap;padding:1rem}[data-gene-ui-version=\"2.12.2\"] .holder-body-c>*{margin:1rem}[data-gene-ui-version=\"2.12.2\"] .holder-body-c .holder-title{font:600 1.6rem/2rem var(--font-family);margin-bottom:.5rem;padding:0 1rem;width:100%}[data-gene-ui-version=\"2.12.2\"] .holder-body-c .col-6{width:50%}";
|
|
23
|
+
styleInject(css_248z);
|
|
24
|
+
|
|
25
|
+
function Holder(_ref) {
|
|
26
|
+
let {
|
|
27
|
+
title,
|
|
28
|
+
footer,
|
|
29
|
+
disabled,
|
|
30
|
+
children,
|
|
31
|
+
position,
|
|
32
|
+
onChange,
|
|
33
|
+
resetText,
|
|
34
|
+
applyText,
|
|
35
|
+
withPortal,
|
|
36
|
+
className,
|
|
37
|
+
onReset,
|
|
38
|
+
onApply,
|
|
39
|
+
applyDisabled,
|
|
40
|
+
resetDisabled,
|
|
41
|
+
defaultOpened,
|
|
42
|
+
expandText,
|
|
43
|
+
collapseText,
|
|
44
|
+
portalContainer,
|
|
45
|
+
rightIconType,
|
|
46
|
+
leftIconType,
|
|
47
|
+
filterIconType,
|
|
48
|
+
openedWidth,
|
|
49
|
+
disableOnHover,
|
|
50
|
+
...restProps
|
|
51
|
+
} = _ref;
|
|
52
|
+
const parentContainer = useRef(null);
|
|
53
|
+
const isControlled = ('opened' in restProps);
|
|
54
|
+
const [holderOpened, setHolderOpened] = useState(defaultOpened);
|
|
55
|
+
const [holderHovered, setHolderHovered] = useState(false);
|
|
56
|
+
const isOpened = isControlled ? restProps.opened : holderOpened;
|
|
57
|
+
const handleEvent = open => {
|
|
58
|
+
if (!isControlled) {
|
|
59
|
+
setHolderOpened(open);
|
|
60
|
+
!open && holderHovered && setHolderHovered(false);
|
|
61
|
+
}
|
|
62
|
+
onChange(open, holderHovered);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// Will open later
|
|
66
|
+
const handleHover = hovered => {
|
|
67
|
+
if (!disableOnHover && hovered !== holderHovered) {
|
|
68
|
+
!isControlled && setHolderHovered(!holderOpened ? hovered : false);
|
|
69
|
+
onChange(holderOpened, hovered);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const Content = /*#__PURE__*/React__default.createElement("div", _extends({
|
|
73
|
+
className: classnames('holder', className, "holder-".concat(position), {
|
|
74
|
+
pinned: isOpened,
|
|
75
|
+
opened: holderHovered || isOpened,
|
|
76
|
+
disabled
|
|
77
|
+
}),
|
|
78
|
+
style: {
|
|
79
|
+
'--opened-width': openedWidth
|
|
80
|
+
},
|
|
81
|
+
onMouseLeave: () => {
|
|
82
|
+
if (!document.documentElement.classList.contains(popoverV2Config.onOpenClassName)) {
|
|
83
|
+
handleHover(false);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}, restProps), /*#__PURE__*/React__default.createElement("div", {
|
|
87
|
+
className: "holder-c-wrapper",
|
|
88
|
+
ref: parentContainer
|
|
89
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
90
|
+
className: "holder-wrapper",
|
|
91
|
+
onMouseEnter: () => handleHover(true)
|
|
92
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
93
|
+
className: "holder-content"
|
|
94
|
+
}, title && /*#__PURE__*/React__default.createElement(ModuleTitle, {
|
|
95
|
+
title: title,
|
|
96
|
+
size: "extra-big"
|
|
97
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
98
|
+
className: "holder-body"
|
|
99
|
+
}, /*#__PURE__*/React__default.createElement(CustomScrollbar, null, /*#__PURE__*/React__default.createElement("div", {
|
|
100
|
+
className: "holder-body-c"
|
|
101
|
+
}, children))), /*#__PURE__*/React__default.createElement("div", {
|
|
102
|
+
className: "holder-footer"
|
|
103
|
+
}, footer !== undefined ? footer : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Button, {
|
|
104
|
+
flexibility: "full-width",
|
|
105
|
+
appearance: "minimal",
|
|
106
|
+
color: "default",
|
|
107
|
+
disabled: resetDisabled,
|
|
108
|
+
onClick: onReset
|
|
109
|
+
}, resetText), /*#__PURE__*/React__default.createElement(Button, {
|
|
110
|
+
flexibility: "full-width",
|
|
111
|
+
color: "confirm",
|
|
112
|
+
disabled: applyDisabled,
|
|
113
|
+
onClick: onApply
|
|
114
|
+
}, applyText))))), /*#__PURE__*/React__default.createElement("div", {
|
|
115
|
+
className: "holder-toggle"
|
|
116
|
+
}, /*#__PURE__*/React__default.createElement("button", {
|
|
117
|
+
className: classnames({
|
|
118
|
+
active: isOpened
|
|
119
|
+
})
|
|
120
|
+
}, /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
121
|
+
title: isOpened ? collapseText : expandText,
|
|
122
|
+
position: "right"
|
|
123
|
+
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(Icon, {
|
|
124
|
+
type: leftIconType,
|
|
125
|
+
className: "layer-1",
|
|
126
|
+
onClick: () => handleEvent(false)
|
|
127
|
+
}), /*#__PURE__*/React__default.createElement(Icon, {
|
|
128
|
+
type: filterIconType,
|
|
129
|
+
className: "layer-2",
|
|
130
|
+
onClick: () => handleEvent(true)
|
|
131
|
+
}))), /*#__PURE__*/React__default.createElement(Icon, {
|
|
132
|
+
type: rightIconType,
|
|
133
|
+
className: "layer-3",
|
|
134
|
+
onClick: () => handleEvent(true)
|
|
135
|
+
})))));
|
|
136
|
+
return withPortal ? /*#__PURE__*/React__default.createElement(Portal, {
|
|
137
|
+
isOpen: true,
|
|
138
|
+
container: portalContainer
|
|
139
|
+
}, Content) : Content;
|
|
140
|
+
}
|
|
141
|
+
Holder.propTypes = {
|
|
142
|
+
/**
|
|
143
|
+
* Custom footer,
|
|
144
|
+
* Any valid React element
|
|
145
|
+
*/
|
|
146
|
+
footer: PropTypes.node,
|
|
147
|
+
/**
|
|
148
|
+
* It prevents the user from changing the state(opened/closed) of holder
|
|
149
|
+
*/
|
|
150
|
+
disabled: PropTypes.bool,
|
|
151
|
+
/**
|
|
152
|
+
* Content of holder,
|
|
153
|
+
* Valid React element
|
|
154
|
+
*/
|
|
155
|
+
children: PropTypes.node,
|
|
156
|
+
/**
|
|
157
|
+
* Fires event when user changes state(opened/closed) of holder
|
|
158
|
+
* (holderOpened: Boolean) => void
|
|
159
|
+
*/
|
|
160
|
+
onChange: PropTypes.func,
|
|
161
|
+
/**
|
|
162
|
+
* Wraps component with Portal component if [true]
|
|
163
|
+
*/
|
|
164
|
+
withPortal: PropTypes.bool,
|
|
165
|
+
/**
|
|
166
|
+
* Custom text for reset button
|
|
167
|
+
*/
|
|
168
|
+
resetText: PropTypes.string,
|
|
169
|
+
/**
|
|
170
|
+
* Custom text for apply button
|
|
171
|
+
*/
|
|
172
|
+
applyText: PropTypes.string,
|
|
173
|
+
/**
|
|
174
|
+
* The CSS class name of the wrapper element.
|
|
175
|
+
*/
|
|
176
|
+
className: PropTypes.string,
|
|
177
|
+
/**
|
|
178
|
+
* Fires event when user clicks on reset button
|
|
179
|
+
* (event: Event) -=> void
|
|
180
|
+
*/
|
|
181
|
+
onReset: PropTypes.func,
|
|
182
|
+
/**
|
|
183
|
+
* Fires event when user clicks on apply button
|
|
184
|
+
* (event: Event) -=> void
|
|
185
|
+
*/
|
|
186
|
+
onApply: PropTypes.func,
|
|
187
|
+
/**
|
|
188
|
+
* Initial state(opened/closed) for holder, I
|
|
189
|
+
* If true holder will be opened
|
|
190
|
+
*/
|
|
191
|
+
defaultOpened: PropTypes.bool,
|
|
192
|
+
/**
|
|
193
|
+
* Controlled value or state(opened/closed) for holder, I
|
|
194
|
+
* If true holder will be opened
|
|
195
|
+
*/
|
|
196
|
+
opened: PropTypes.bool,
|
|
197
|
+
/**
|
|
198
|
+
* Is any valid DOM node, regardless of its location in the DOM.
|
|
199
|
+
*/
|
|
200
|
+
portalContainer: PropTypes.any,
|
|
201
|
+
/**
|
|
202
|
+
* Controls holder position
|
|
203
|
+
*/
|
|
204
|
+
position: PropTypes.oneOf(['left', 'right']),
|
|
205
|
+
/**
|
|
206
|
+
* Title for component
|
|
207
|
+
*/
|
|
208
|
+
title: PropTypes.string.isRequired,
|
|
209
|
+
/**
|
|
210
|
+
* Disabled state for "apply" button
|
|
211
|
+
*/
|
|
212
|
+
applyDisabled: PropTypes.bool,
|
|
213
|
+
/**
|
|
214
|
+
* Disabled state for "reset" button
|
|
215
|
+
*/
|
|
216
|
+
resetDisabled: PropTypes.bool,
|
|
217
|
+
/**
|
|
218
|
+
* Tooltip text for expanding icon
|
|
219
|
+
*/
|
|
220
|
+
expandText: PropTypes.string.isRequired,
|
|
221
|
+
/**
|
|
222
|
+
* Tooltip text for collapsing icon
|
|
223
|
+
*/
|
|
224
|
+
collapseText: PropTypes.string.isRequired,
|
|
225
|
+
/**
|
|
226
|
+
* Width for holder opened state (write with px)
|
|
227
|
+
*/
|
|
228
|
+
openedWidth: PropTypes.string,
|
|
229
|
+
/**
|
|
230
|
+
* Left custom icon name, default is 'bc-icon-arrow-left'
|
|
231
|
+
*/
|
|
232
|
+
leftIconType: PropTypes.string,
|
|
233
|
+
/**
|
|
234
|
+
* Right custom icon name, default is 'bc-icon-arrow-right'
|
|
235
|
+
*/
|
|
236
|
+
rightIconType: PropTypes.string,
|
|
237
|
+
/**
|
|
238
|
+
* Filter custom icon name, default is 'bc-icon-arrow-filter'
|
|
239
|
+
*/
|
|
240
|
+
filterIconType: PropTypes.string,
|
|
241
|
+
/**
|
|
242
|
+
* Disabled hover event which opening Holder component.
|
|
243
|
+
*/
|
|
244
|
+
disableOnHover: PropTypes.bool
|
|
245
|
+
};
|
|
246
|
+
Holder.defaultProps = {
|
|
247
|
+
disabled: false,
|
|
248
|
+
applyText: 'Apply',
|
|
249
|
+
withPortal: false,
|
|
250
|
+
resetText: 'Reset',
|
|
251
|
+
defaultOpened: false,
|
|
252
|
+
position: 'left',
|
|
253
|
+
applyDisabled: false,
|
|
254
|
+
onChange: noop,
|
|
255
|
+
leftIconType: 'bc-icon-arrow-left',
|
|
256
|
+
rightIconType: 'bc-icon-arrow-right',
|
|
257
|
+
filterIconType: 'bc-icon-filter',
|
|
258
|
+
disableOnHover: false
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export { Holder as default };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { _ as _extends } from '
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { c as classnames } from '
|
|
4
|
-
import
|
|
5
|
-
import '
|
|
6
|
-
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
3
|
+
import { c as classnames } from '../index-6ff23041.js';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
7
6
|
|
|
8
|
-
var css_248z = "[data-gene-ui-version=\"
|
|
7
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .icon{display:block;font-size:2.4rem}[data-gene-ui-version=\"2.12.2\"] .icon.disabled{opacity:.5;pointer-events:none}[data-gene-ui-version=\"2.12.2\"] .icon.bc-icon-loader{overflow:hidden}[data-gene-ui-version=\"2.12.2\"] .icon.bc-icon-loader:before{animation:loader-icon .3s linear infinite;display:block}@keyframes loader-icon{to{transform:rotate(1turn)}}[data-gene-ui-version=\"2.12.2\"] [dir=rtl] .bc-icon-arrow-right-nav:before{content:\"\\e906\"}[data-gene-ui-version=\"2.12.2\"] [dir=rtl] .bc-icon-arrow-left-nav:before{content:\"\\e90a\"}[data-gene-ui-version=\"2.12.2\"] [dir=rtl] .bc-icon-arrow-right:before{content:\"\\e907\"}[data-gene-ui-version=\"2.12.2\"] [dir=rtl] .bc-icon-arrow-left:before{content:\"\\e90b\"}[data-gene-ui-version=\"2.12.2\"] [dir=rtl] .bc-icon-arrow-forward:before{content:\"\\e901\"}[data-gene-ui-version=\"2.12.2\"] [dir=rtl] .bc-icon-left-outline:before{content:\"\\e959\"}[data-gene-ui-version=\"2.12.2\"] [dir=rtl] .bc-icon-right-outline:before{content:\"\\e955\"}[data-gene-ui-version=\"2.12.2\"] [dir=rtl] .bc-icon-forwards:before{content:\"\\e95b\"}[data-gene-ui-version=\"2.12.2\"] [dir=rtl] .bc-icon-backwards:before{content:\"\\e95a\"}";
|
|
9
8
|
styleInject(css_248z);
|
|
10
9
|
|
|
11
10
|
// This this because in production we need to replace 'nonames.com' with host
|
|
@@ -40,19 +39,19 @@ Icon.propTypes = {
|
|
|
40
39
|
/**
|
|
41
40
|
* Type is the exact icon. You can find valid "type" values in the documentation example
|
|
42
41
|
*/
|
|
43
|
-
type:
|
|
42
|
+
type: PropTypes.string,
|
|
44
43
|
/**
|
|
45
44
|
* Additional className
|
|
46
45
|
*/
|
|
47
|
-
className:
|
|
46
|
+
className: PropTypes.string,
|
|
48
47
|
/**
|
|
49
48
|
* Icon disabled state
|
|
50
49
|
*/
|
|
51
|
-
disabled:
|
|
50
|
+
disabled: PropTypes.bool,
|
|
52
51
|
/**
|
|
53
52
|
* Will fill the icon when set to "true"
|
|
54
53
|
*/
|
|
55
|
-
isFilled:
|
|
54
|
+
isFilled: PropTypes.bool
|
|
56
55
|
};
|
|
57
56
|
Icon.defaultProps = {
|
|
58
57
|
disabled: false,
|
package/Image/index.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
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 Empty from '../Empty/index.js';
|
|
6
|
+
import Tooltip from '../Tooltip/index.js';
|
|
7
|
+
import Checkbox from '../Checkbox/index.js';
|
|
8
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
9
|
+
import '../Popover-f4d1cac0.js';
|
|
10
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
11
|
+
import 'react-dom';
|
|
12
|
+
import '../configs-fed6ac34.js';
|
|
13
|
+
import '../index-a0e4e333.js';
|
|
14
|
+
import '../dateValidation-67caec66.js';
|
|
15
|
+
import '../hooks/useDeviceType.js';
|
|
16
|
+
import '../hooks/useWindowSize.js';
|
|
17
|
+
import '../GeneUIProvider/index.js';
|
|
18
|
+
import '../checkboxRadioSwitcher-5b69d7bd.js';
|
|
19
|
+
import '../guid-8ddf77b3.js';
|
|
20
|
+
|
|
21
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .image-holder{--image-border-radius:1rem;padding:100% 0 0;position:relative;transition:box-shadow .4s;-webkit-user-select:none;user-select:none;width:100%}[data-gene-ui-version=\"2.12.2\"] .image-holder.with-border{--distance:0.8rem;--image-border-radius:0.6rem;border-radius:1rem;box-shadow:inset 0 0 0 1px rgba(var(--background-sc-rgb),.2)}[data-gene-ui-version=\"2.12.2\"] .image-holder.with-border:hover{box-shadow:inset 0 0 0 1px rgba(var(--background-sc-rgb),.5)}[data-gene-ui-version=\"2.12.2\"] .image-holder.with-border.error{box-shadow:inset 0 0 0 1px rgba(var(--danger-rgb),.5)}[data-gene-ui-version=\"2.12.2\"] .image-holder.with-border.error:hover{box-shadow:inset 0 0 0 1px var(--danger)}[data-gene-ui-version=\"2.12.2\"] .image-content{bottom:var(--distance,0);left:var(--distance,0);position:absolute;right:var(--distance,0);top:var(--distance,0)}[data-gene-ui-version=\"2.12.2\"] .image-content img{border-radius:var(--image-border-radius);display:block;height:100%;object-fit:cover;width:100%}[data-gene-ui-version=\"2.12.2\"] .image-label-holder{background:#0003;border-radius:var(--image-border-radius);cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}[data-gene-ui-version=\"2.12.2\"] .image-heading{align-items:center;display:flex;left:0;padding:0 .7rem;position:absolute;top:1.2rem;width:100%}[data-gene-ui-version=\"2.12.2\"] .image-heading>li{margin:0 .5rem}[data-gene-ui-version=\"2.12.2\"] .image-heading>li.image-cra{background:#fff;border-radius:.3rem;flex-shrink:0}[data-gene-ui-version=\"2.12.2\"] .image-heading>li.image-title{color:#fff;flex:auto;font:700 1.2rem/2rem var(--font-family)}[data-gene-ui-version=\"2.12.2\"] .image-actions-holder{align-items:center;background:#0009;border-radius:var(--image-border-radius);display:flex;height:100%;justify-content:center;left:0;position:absolute;top:0;transition:opacity .4s,visibility .4s;width:100%}[data-gene-ui-version=\"2.12.2\"] .image-holder:not(:hover) .image-actions-holder{opacity:0;visibility:hidden}[data-gene-ui-version=\"2.12.2\"] .image-actions{align-items:center;display:flex}[data-gene-ui-version=\"2.12.2\"] .image-actions>*{box-shadow:inset 0 0 0 5rem #ffffffe6}html:not([dir=rtl]) .image-actions>*+*{margin-left:.5rem}html[dir=rtl] .image-actions>*+*{margin-right:.5rem}[data-gene-ui-version=\"2.12.2\"] .image-empty-state-holder{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}";
|
|
22
|
+
styleInject(css_248z);
|
|
23
|
+
|
|
24
|
+
function Image(_ref) {
|
|
25
|
+
let {
|
|
26
|
+
src,
|
|
27
|
+
withBorder,
|
|
28
|
+
selectMode,
|
|
29
|
+
actions,
|
|
30
|
+
title,
|
|
31
|
+
imageProps,
|
|
32
|
+
checkboxProps,
|
|
33
|
+
className,
|
|
34
|
+
isValid,
|
|
35
|
+
tooltipTitle,
|
|
36
|
+
emptyText,
|
|
37
|
+
...restProps
|
|
38
|
+
} = _ref;
|
|
39
|
+
const isValidSource = useMemo(() => typeof src === 'string' && src !== '', [src]);
|
|
40
|
+
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
41
|
+
title: tooltipTitle
|
|
42
|
+
}, /*#__PURE__*/React__default.createElement("div", _extends({
|
|
43
|
+
className: classnames('image-holder', className, {
|
|
44
|
+
'with-border': withBorder,
|
|
45
|
+
error: !isValid
|
|
46
|
+
})
|
|
47
|
+
}, restProps), isValidSource ? /*#__PURE__*/React__default.createElement("div", {
|
|
48
|
+
className: "image-content"
|
|
49
|
+
}, /*#__PURE__*/React__default.createElement("img", _extends({
|
|
50
|
+
src: src,
|
|
51
|
+
alt: title
|
|
52
|
+
}, imageProps)), selectMode && /*#__PURE__*/React__default.createElement("label", {
|
|
53
|
+
className: "image-label-holder"
|
|
54
|
+
}, /*#__PURE__*/React__default.createElement("ul", {
|
|
55
|
+
className: "image-heading"
|
|
56
|
+
}, /*#__PURE__*/React__default.createElement("li", {
|
|
57
|
+
className: "image-cra"
|
|
58
|
+
}, /*#__PURE__*/React__default.createElement(Checkbox, _extends({
|
|
59
|
+
size: "big"
|
|
60
|
+
}, checkboxProps))), title && /*#__PURE__*/React__default.createElement("li", {
|
|
61
|
+
className: "image-title ellipsis-text"
|
|
62
|
+
}, title))), actions && !selectMode && /*#__PURE__*/React__default.createElement("div", {
|
|
63
|
+
className: "image-actions-holder"
|
|
64
|
+
}, title && /*#__PURE__*/React__default.createElement("ul", {
|
|
65
|
+
className: "image-heading"
|
|
66
|
+
}, /*#__PURE__*/React__default.createElement("li", {
|
|
67
|
+
className: "image-title ellipsis-text"
|
|
68
|
+
}, title)), /*#__PURE__*/React__default.createElement("div", {
|
|
69
|
+
className: "image-actions"
|
|
70
|
+
}, actions))) : /*#__PURE__*/React__default.createElement(Empty, {
|
|
71
|
+
type: "data",
|
|
72
|
+
title: emptyText,
|
|
73
|
+
className: "image-empty-state-holder"
|
|
74
|
+
})));
|
|
75
|
+
}
|
|
76
|
+
Image.propTypes = {
|
|
77
|
+
/**
|
|
78
|
+
* Image path to display
|
|
79
|
+
*/
|
|
80
|
+
src: PropTypes.string.isRequired,
|
|
81
|
+
/**
|
|
82
|
+
* Will add a border when set to "true"
|
|
83
|
+
*/
|
|
84
|
+
withBorder: PropTypes.bool,
|
|
85
|
+
/**
|
|
86
|
+
* The property will add a checkbox and an overlay over the image.
|
|
87
|
+
*/
|
|
88
|
+
selectMode: PropTypes.bool,
|
|
89
|
+
/**
|
|
90
|
+
* Customize checkbox(will be rendered only when "selectMode" is set to "true").
|
|
91
|
+
*/
|
|
92
|
+
checkboxProps: PropTypes.object,
|
|
93
|
+
/**
|
|
94
|
+
* Customize image tag with this property.
|
|
95
|
+
*/
|
|
96
|
+
imageProps: PropTypes.object,
|
|
97
|
+
/**
|
|
98
|
+
* The property will render "actions" when "selectMode" is not setted to "true". Any valid React node
|
|
99
|
+
*/
|
|
100
|
+
actions: PropTypes.node,
|
|
101
|
+
/**
|
|
102
|
+
* Will add a title to the top of Image atom. Any valid React node
|
|
103
|
+
*/
|
|
104
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
105
|
+
/**
|
|
106
|
+
* Title for 'Tooltip'.
|
|
107
|
+
*/
|
|
108
|
+
tooltipTitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
109
|
+
/**
|
|
110
|
+
* Addional className
|
|
111
|
+
*/
|
|
112
|
+
className: PropTypes.string,
|
|
113
|
+
/**
|
|
114
|
+
* Image atom also can be included in "Form" organism. It can be validated as other "Form" elements
|
|
115
|
+
*/
|
|
116
|
+
isValid: PropTypes.bool,
|
|
117
|
+
/**
|
|
118
|
+
* Empty state text for component
|
|
119
|
+
*/
|
|
120
|
+
emptyText: PropTypes.string
|
|
121
|
+
};
|
|
122
|
+
Image.defaultProps = {
|
|
123
|
+
withBorder: false,
|
|
124
|
+
selectMode: false,
|
|
125
|
+
isValid: true,
|
|
126
|
+
emptyText: 'No image to display'
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export { Image as default };
|