@oliasoft-open-source/react-ui-library 3.2.1 → 3.2.3
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/dist/index.js +11 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14928,6 +14928,7 @@ const Drawer = ({
|
|
|
14928
14928
|
children,
|
|
14929
14929
|
fixed: fixed2,
|
|
14930
14930
|
open: openProp,
|
|
14931
|
+
setOpen: setOpenProp,
|
|
14931
14932
|
right: right2,
|
|
14932
14933
|
shadow: shadow2,
|
|
14933
14934
|
top: top2,
|
|
@@ -14939,14 +14940,16 @@ const Drawer = ({
|
|
|
14939
14940
|
border: border2,
|
|
14940
14941
|
tabs: tabs2,
|
|
14941
14942
|
defaultTabIndex,
|
|
14943
|
+
activeTab: activeTabProp,
|
|
14944
|
+
setActiveTab: setActiveTabProp,
|
|
14942
14945
|
testId,
|
|
14943
14946
|
onResize,
|
|
14944
14947
|
getActiveTab
|
|
14945
14948
|
}) => {
|
|
14946
14949
|
const isStandardButton = button2 === true;
|
|
14947
14950
|
const isCustomButton = !isStandardButton && isValidElement(button2);
|
|
14948
|
-
const [open, setOpen] = isStandardButton || tabs2 ? useState(openProp) : [openProp, null];
|
|
14949
|
-
const [activeTab, setActiveTab] = useState(open ? defaultTabIndex : null);
|
|
14951
|
+
const [open, setOpen] = setOpenProp ? [openProp, setOpenProp] : isStandardButton || tabs2 ? useState(openProp) : [openProp, null];
|
|
14952
|
+
const [activeTab, setActiveTab] = setActiveTabProp ? [activeTabProp, setActiveTabProp] : useState(open ? defaultTabIndex : null);
|
|
14950
14953
|
const openWidth = Array.isArray(width) ? width[activeTab] : width;
|
|
14951
14954
|
const TABS_WIDTH = 37;
|
|
14952
14955
|
const currentWidth = open ? openWidth : tabs2 ? TABS_WIDTH : closedWidth;
|
|
@@ -14982,7 +14985,6 @@ const Drawer = ({
|
|
|
14982
14985
|
children: tabs2 ? /* @__PURE__ */ jsx(DrawerTabs, {
|
|
14983
14986
|
width: openWidth,
|
|
14984
14987
|
testId,
|
|
14985
|
-
open,
|
|
14986
14988
|
tabs: tabs2,
|
|
14987
14989
|
activeTab,
|
|
14988
14990
|
background,
|
|
@@ -15008,6 +15010,7 @@ Drawer.defaultProps = {
|
|
|
15008
15010
|
background: "transparent",
|
|
15009
15011
|
fixed: false,
|
|
15010
15012
|
open: false,
|
|
15013
|
+
setOpen: void 0,
|
|
15011
15014
|
right: false,
|
|
15012
15015
|
width: 400,
|
|
15013
15016
|
closedWidth: 0,
|
|
@@ -15020,6 +15023,8 @@ Drawer.defaultProps = {
|
|
|
15020
15023
|
children: null,
|
|
15021
15024
|
tabs: null,
|
|
15022
15025
|
defaultTabIndex: 0,
|
|
15026
|
+
activeTab: void 0,
|
|
15027
|
+
setActiveTab: void 0,
|
|
15023
15028
|
testId: void 0,
|
|
15024
15029
|
onResize: null,
|
|
15025
15030
|
getActiveTab: null
|
|
@@ -15028,6 +15033,7 @@ Drawer.propTypes = {
|
|
|
15028
15033
|
background: propTypes$1.exports.string,
|
|
15029
15034
|
fixed: propTypes$1.exports.bool,
|
|
15030
15035
|
open: propTypes$1.exports.bool,
|
|
15036
|
+
setOpen: propTypes$1.exports.func,
|
|
15031
15037
|
right: propTypes$1.exports.bool,
|
|
15032
15038
|
width: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.number, propTypes$1.exports.arrayOf(propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.number]))]),
|
|
15033
15039
|
closedWidth: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.number]),
|
|
@@ -15044,6 +15050,8 @@ Drawer.propTypes = {
|
|
|
15044
15050
|
})),
|
|
15045
15051
|
testId: propTypes$1.exports.string,
|
|
15046
15052
|
defaultTabIndex: propTypes$1.exports.number,
|
|
15053
|
+
activeTab: propTypes$1.exports.number,
|
|
15054
|
+
setActiveTab: propTypes$1.exports.func,
|
|
15047
15055
|
onResize: propTypes$1.exports.func,
|
|
15048
15056
|
getActiveTab: propTypes$1.exports.func
|
|
15049
15057
|
};
|