@ringcentral/juno 2.43.0 → 2.43.1
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.
|
@@ -14,12 +14,16 @@ var styles_1 = require("./styles");
|
|
|
14
14
|
var utils_1 = require("./utils");
|
|
15
15
|
var _RcTabList = react_1.forwardRef(function (inProps, ref) {
|
|
16
16
|
var props = foundation_1.useThemeProps({ props: inProps, name: 'RcTabList' });
|
|
17
|
-
var classesProp = props.classes, childrenProp = props.children,
|
|
17
|
+
var classesProp = props.classes, childrenProp = props.children, idPrefix = props.idPrefix, value = props.value, rest = tslib_1.__rest(props, ["classes", "children", "idPrefix", "value"]);
|
|
18
18
|
var classes = react_1.useMemo(function () { return foundation_1.combineClasses(utils_1.RcTabListClasses, classesProp); }, [classesProp]);
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
var tabContext = TabContext_1.useTabContext();
|
|
20
|
+
var context = react_1.useMemo(function () { return ({
|
|
21
|
+
value: value !== null && value !== void 0 ? value : tabContext === null || tabContext === void 0 ? void 0 : tabContext.value,
|
|
22
|
+
idPrefix: idPrefix !== null && idPrefix !== void 0 ? idPrefix : tabContext === null || tabContext === void 0 ? void 0 : tabContext.idPrefix,
|
|
23
|
+
}); }, [value, idPrefix, tabContext]);
|
|
24
|
+
if (!tabContext && !context.idPrefix) {
|
|
25
|
+
throw new Error('[TabList] No idPrefix provided, use RcTabContext or idPrefix prop');
|
|
26
|
+
}
|
|
23
27
|
var children = react_1.useMemo(function () {
|
|
24
28
|
return react_1.default.Children.map(childrenProp, function (child) {
|
|
25
29
|
var value = child.props.value;
|
|
@@ -12,12 +12,16 @@ import { TabListStyle } from './styles';
|
|
|
12
12
|
import { RcTabListClasses } from './utils';
|
|
13
13
|
var _RcTabList = forwardRef(function (inProps, ref) {
|
|
14
14
|
var props = useThemeProps({ props: inProps, name: 'RcTabList' });
|
|
15
|
-
var classesProp = props.classes, childrenProp = props.children,
|
|
15
|
+
var classesProp = props.classes, childrenProp = props.children, idPrefix = props.idPrefix, value = props.value, rest = __rest(props, ["classes", "children", "idPrefix", "value"]);
|
|
16
16
|
var classes = useMemo(function () { return combineClasses(RcTabListClasses, classesProp); }, [classesProp]);
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
var tabContext = useTabContext();
|
|
18
|
+
var context = useMemo(function () { return ({
|
|
19
|
+
value: value !== null && value !== void 0 ? value : tabContext === null || tabContext === void 0 ? void 0 : tabContext.value,
|
|
20
|
+
idPrefix: idPrefix !== null && idPrefix !== void 0 ? idPrefix : tabContext === null || tabContext === void 0 ? void 0 : tabContext.idPrefix,
|
|
21
|
+
}); }, [value, idPrefix, tabContext]);
|
|
22
|
+
if (!tabContext && !context.idPrefix) {
|
|
23
|
+
throw new Error('[TabList] No idPrefix provided, use RcTabContext or idPrefix prop');
|
|
24
|
+
}
|
|
21
25
|
var children = useMemo(function () {
|
|
22
26
|
return React.Children.map(childrenProp, function (child) {
|
|
23
27
|
var value = child.props.value;
|