1 line
1.7 KiB
JSON
1 line
1.7 KiB
JSON
{"ast":null,"code":"import React, { useMemo } from 'react';\nimport { useUncontrolled } from 'uncontrollable';\nimport TabContext from './TabContext';\nimport SelectableContext from './SelectableContext';\n/* eslint-disable react/no-unused-prop-types */\n\nvar TabContainer = function TabContainer(props) {\n var _useUncontrolled = useUncontrolled(props, {\n activeKey: 'onSelect'\n }),\n id = _useUncontrolled.id,\n generateCustomChildId = _useUncontrolled.generateChildId,\n onSelect = _useUncontrolled.onSelect,\n activeKey = _useUncontrolled.activeKey,\n transition = _useUncontrolled.transition,\n mountOnEnter = _useUncontrolled.mountOnEnter,\n unmountOnExit = _useUncontrolled.unmountOnExit,\n children = _useUncontrolled.children;\n\n var generateChildId = useMemo(function () {\n return generateCustomChildId || function (key, type) {\n return id ? id + \"-\" + type + \"-\" + key : null;\n };\n }, [id, generateCustomChildId]);\n var tabContext = useMemo(function () {\n return {\n onSelect: onSelect,\n activeKey: activeKey,\n transition: transition,\n mountOnEnter: mountOnEnter,\n unmountOnExit: unmountOnExit,\n getControlledId: function getControlledId(key) {\n return generateChildId(key, 'tabpane');\n },\n getControllerId: function getControllerId(key) {\n return generateChildId(key, 'tab');\n }\n };\n }, [onSelect, activeKey, transition, mountOnEnter, unmountOnExit, generateChildId]);\n return React.createElement(TabContext.Provider, {\n value: tabContext\n }, React.createElement(SelectableContext.Provider, {\n value: onSelect\n }, children));\n};\n\nexport default TabContainer;","map":null,"metadata":{},"sourceType":"module"} |