krl-alfred 1.77.21 → 1.77.22
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.
|
@@ -30,7 +30,7 @@ var TabItem = function (props) {
|
|
|
30
30
|
(0, react_1.useEffect)(function () {
|
|
31
31
|
if (props.isActive)
|
|
32
32
|
setActiveContent(props.children);
|
|
33
|
-
}, [props.isActive]);
|
|
33
|
+
}, [props.isActive, props.children]);
|
|
34
34
|
return ((0, jsx_runtime_1.jsx)(Tabs_styled_1.TabItemStyled, __assign({ "$isDisabled": props.isDisabled }, { children: (0, jsx_runtime_1.jsx)(Tabs_styled_1.TabItemTitleStyled, __assign({ "$isActive": props.isActive, onClick: onClickTab }, { children: props.title })) }), props.key));
|
|
35
35
|
};
|
|
36
36
|
exports.default = TabItem;
|
|
@@ -45,6 +45,9 @@ var TabItem_1 = __importDefault(require("./TabItem"));
|
|
|
45
45
|
var Tabs = function (props) {
|
|
46
46
|
var _a = (0, react_1.useState)(props.activeIndex || 0), activeIndex = _a[0], setActiveIndex = _a[1];
|
|
47
47
|
var _b = (0, react_1.useState)(null), activeContent = _b[0], setActiveContent = _b[1];
|
|
48
|
+
(0, react_1.useEffect)(function () {
|
|
49
|
+
setActiveIndex(props.activeIndex);
|
|
50
|
+
}, [props.activeIndex]);
|
|
48
51
|
var onActive = function (e) { return props.onActive(e); };
|
|
49
52
|
var getTabsContext = (0, react_1.useCallback)(function (index) {
|
|
50
53
|
var activateTab = function (nextIndex) {
|