@linzjs/lui 17.8.1 → 17.9.0
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/CHANGELOG.md +7 -0
- package/dist/components/LuiTabs/LuiTabsPanel/LuiTabsPanel.d.ts +2 -0
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/lui.esm.js +10 -3
- package/dist/lui.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [17.9.0](https://github.com/linz/lui/compare/v17.8.1...v17.9.0) (2022-08-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **LuiTabsPanel:** adding support for lazy loading content via the mode prop ([#715](https://github.com/linz/lui/issues/715)) ([55ee571](https://github.com/linz/lui/commit/55ee57105a917312fa7ab84c51d89277b9f213c7))
|
|
7
|
+
|
|
1
8
|
## [17.8.1](https://github.com/linz/lui/compare/v17.8.0...v17.8.1) (2022-08-08)
|
|
2
9
|
|
|
3
10
|
|
package/dist/index.js
CHANGED
|
@@ -863,10 +863,17 @@ var LuiTabsGroup = function (props) {
|
|
|
863
863
|
return (React__default["default"].createElement("div", { className: "LuiTabsGroup " + (props.justify ? 'LuiTabsGroup--justified' : ''), role: "tablist", "aria-label": props.ariaLabel }, props.children));
|
|
864
864
|
};
|
|
865
865
|
|
|
866
|
-
var LuiTabsPanel = function (
|
|
866
|
+
var LuiTabsPanel = function (_a) {
|
|
867
|
+
var children = _a.children, panel = _a.panel, _b = _a.mode, mode = _b === void 0 ? 'eager' : _b;
|
|
867
868
|
var context = React.useContext(LuiTabsContext);
|
|
868
|
-
var
|
|
869
|
-
|
|
869
|
+
var _c = React.useState(mode === 'eager'), shouldShow = _c[0], setShouldShow = _c[1];
|
|
870
|
+
var active = context.activePanel === panel;
|
|
871
|
+
React.useEffect(function () {
|
|
872
|
+
if (active && !shouldShow) {
|
|
873
|
+
setShouldShow(true);
|
|
874
|
+
}
|
|
875
|
+
}, [active, shouldShow]);
|
|
876
|
+
return (React__default["default"].createElement("div", { className: clsx('LuiTabsPanel', active && 'LuiTabsPanel--active'), id: panel + "-tab-panel", role: "tabpanel", "aria-labelledby": panel + "-tab" }, shouldShow ? children : null));
|
|
870
877
|
};
|
|
871
878
|
|
|
872
879
|
var LuiTabsPanelSwitch = function (props) {
|