Comparing version 12.11.0 to 12.11.1
@@ -1,4 +0,4 @@ | ||
import React from 'react'; | ||
import { TabOffset } from '../interface'; | ||
export type GetIndicatorLength = number | ((origin: number) => number); | ||
import type React from 'react'; | ||
import type { TabOffset } from '../interface'; | ||
export type GetIndicatorSize = number | ((origin: number) => number); | ||
export type UseIndicator = (options: { | ||
@@ -8,3 +8,3 @@ activeTabOffset: TabOffset; | ||
rtl: boolean; | ||
indicatorLength: GetIndicatorLength; | ||
indicatorSize: GetIndicatorSize; | ||
}) => { | ||
@@ -11,0 +11,0 @@ style: React.CSSProperties; |
@@ -8,3 +8,3 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
rtl = _ref.rtl, | ||
indicatorLength = _ref.indicatorLength; | ||
indicatorSize = _ref.indicatorSize; | ||
var _useState = useState(), | ||
@@ -16,7 +16,7 @@ _useState2 = _slicedToArray(_useState, 2), | ||
var getLength = function getLength(origin) { | ||
if (typeof indicatorLength === 'function') { | ||
return indicatorLength(origin); | ||
if (typeof indicatorSize === 'function') { | ||
return indicatorSize(origin); | ||
} | ||
if (typeof indicatorLength === 'number') { | ||
return indicatorLength; | ||
if (typeof indicatorSize === 'number') { | ||
return indicatorSize; | ||
} | ||
@@ -53,3 +53,3 @@ return origin; | ||
return cleanInkBarRaf; | ||
}, [activeTabOffset, horizontal, rtl, indicatorLength]); | ||
}, [activeTabOffset, horizontal, rtl, indicatorSize]); | ||
return { | ||
@@ -56,0 +56,0 @@ style: inkStyle |
import * as React from 'react'; | ||
import type { AnimatedConfig, EditableConfig, OnTabScroll, RenderTabBar, TabBarExtraContent, TabPosition, TabsLocale } from '../interface'; | ||
import type { GetIndicatorLength } from '../hooks/useIndicator'; | ||
import type { GetIndicatorSize } from '../hooks/useIndicator'; | ||
export interface TabNavListProps { | ||
@@ -25,5 +25,5 @@ id: string; | ||
popupClassName?: string; | ||
indicatorLength?: GetIndicatorLength; | ||
indicatorSize?: GetIndicatorSize; | ||
} | ||
declare const _default: React.ForwardRefExoticComponent<TabNavListProps & React.RefAttributes<HTMLDivElement>>; | ||
export default _default; |
@@ -58,3 +58,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
onTabScroll = props.onTabScroll, | ||
indicatorLength = props.indicatorLength; | ||
indicatorSize = props.indicatorSize; | ||
var containerRef = useRef(); | ||
@@ -343,3 +343,3 @@ var extraLeftRef = useRef(); | ||
rtl: rtl, | ||
indicatorLength: indicatorLength | ||
indicatorSize: indicatorSize | ||
}), | ||
@@ -346,0 +346,0 @@ indicatorStyle = _useIndicator.style; |
import * as React from 'react'; | ||
import type { AnimatedConfig, EditableConfig, OnTabScroll, RenderTabBar, Tab, TabBarExtraContent, TabPosition, TabsLocale } from './interface'; | ||
import type { GetIndicatorLength } from './hooks/useIndicator'; | ||
import type { GetIndicatorSize } from './hooks/useIndicator'; | ||
export interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'children'> { | ||
@@ -30,5 +30,5 @@ prefixCls?: string; | ||
popupClassName?: string; | ||
indicatorLength?: GetIndicatorLength; | ||
indicatorSize?: GetIndicatorSize; | ||
} | ||
declare const ForwardTabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>; | ||
export default ForwardTabs; |
@@ -7,3 +7,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
var _excluded = ["id", "prefixCls", "className", "items", "direction", "activeKey", "defaultActiveKey", "editable", "animated", "tabPosition", "tabBarGutter", "tabBarStyle", "tabBarExtraContent", "locale", "moreIcon", "moreTransitionName", "destroyInactiveTabPane", "renderTabBar", "onChange", "onTabClick", "onTabScroll", "getPopupContainer", "popupClassName", "indicatorLength"]; | ||
var _excluded = ["id", "prefixCls", "className", "items", "direction", "activeKey", "defaultActiveKey", "editable", "animated", "tabPosition", "tabBarGutter", "tabBarStyle", "tabBarExtraContent", "locale", "moreIcon", "moreTransitionName", "destroyInactiveTabPane", "renderTabBar", "onChange", "onTabClick", "onTabScroll", "getPopupContainer", "popupClassName", "indicatorSize"]; | ||
// Accessibility https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Tab_Role | ||
@@ -56,3 +56,3 @@ import * as React from 'react'; | ||
popupClassName = _ref.popupClassName, | ||
indicatorLength = _ref.indicatorLength, | ||
indicatorSize = _ref.indicatorSize, | ||
restProps = _objectWithoutProperties(_ref, _excluded); | ||
@@ -160,3 +160,3 @@ var tabs = React.useMemo(function () { | ||
popupClassName: popupClassName, | ||
indicatorLength: indicatorLength | ||
indicatorSize: indicatorSize | ||
}); | ||
@@ -163,0 +163,0 @@ return /*#__PURE__*/React.createElement(TabContext.Provider, { |
@@ -1,4 +0,4 @@ | ||
import React from 'react'; | ||
import { TabOffset } from '../interface'; | ||
export type GetIndicatorLength = number | ((origin: number) => number); | ||
import type React from 'react'; | ||
import type { TabOffset } from '../interface'; | ||
export type GetIndicatorSize = number | ((origin: number) => number); | ||
export type UseIndicator = (options: { | ||
@@ -8,3 +8,3 @@ activeTabOffset: TabOffset; | ||
rtl: boolean; | ||
indicatorLength: GetIndicatorLength; | ||
indicatorSize: GetIndicatorSize; | ||
}) => { | ||
@@ -11,0 +11,0 @@ style: React.CSSProperties; |
@@ -15,3 +15,3 @@ "use strict"; | ||
rtl = _ref.rtl, | ||
indicatorLength = _ref.indicatorLength; | ||
indicatorSize = _ref.indicatorSize; | ||
var _useState = (0, _react.useState)(), | ||
@@ -23,7 +23,7 @@ _useState2 = (0, _slicedToArray2.default)(_useState, 2), | ||
var getLength = function getLength(origin) { | ||
if (typeof indicatorLength === 'function') { | ||
return indicatorLength(origin); | ||
if (typeof indicatorSize === 'function') { | ||
return indicatorSize(origin); | ||
} | ||
if (typeof indicatorLength === 'number') { | ||
return indicatorLength; | ||
if (typeof indicatorSize === 'number') { | ||
return indicatorSize; | ||
} | ||
@@ -60,3 +60,3 @@ return origin; | ||
return cleanInkBarRaf; | ||
}, [activeTabOffset, horizontal, rtl, indicatorLength]); | ||
}, [activeTabOffset, horizontal, rtl, indicatorSize]); | ||
return { | ||
@@ -63,0 +63,0 @@ style: inkStyle |
import * as React from 'react'; | ||
import type { AnimatedConfig, EditableConfig, OnTabScroll, RenderTabBar, TabBarExtraContent, TabPosition, TabsLocale } from '../interface'; | ||
import type { GetIndicatorLength } from '../hooks/useIndicator'; | ||
import type { GetIndicatorSize } from '../hooks/useIndicator'; | ||
export interface TabNavListProps { | ||
@@ -25,5 +25,5 @@ id: string; | ||
popupClassName?: string; | ||
indicatorLength?: GetIndicatorLength; | ||
indicatorSize?: GetIndicatorSize; | ||
} | ||
declare const _default: React.ForwardRefExoticComponent<TabNavListProps & React.RefAttributes<HTMLDivElement>>; | ||
export default _default; |
@@ -67,3 +67,3 @@ "use strict"; | ||
onTabScroll = props.onTabScroll, | ||
indicatorLength = props.indicatorLength; | ||
indicatorSize = props.indicatorSize; | ||
var containerRef = (0, React.useRef)(); | ||
@@ -352,3 +352,3 @@ var extraLeftRef = (0, React.useRef)(); | ||
rtl: rtl, | ||
indicatorLength: indicatorLength | ||
indicatorSize: indicatorSize | ||
}), | ||
@@ -355,0 +355,0 @@ indicatorStyle = _useIndicator.style; |
import * as React from 'react'; | ||
import type { AnimatedConfig, EditableConfig, OnTabScroll, RenderTabBar, Tab, TabBarExtraContent, TabPosition, TabsLocale } from './interface'; | ||
import type { GetIndicatorLength } from './hooks/useIndicator'; | ||
import type { GetIndicatorSize } from './hooks/useIndicator'; | ||
export interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'children'> { | ||
@@ -30,5 +30,5 @@ prefixCls?: string; | ||
popupClassName?: string; | ||
indicatorLength?: GetIndicatorLength; | ||
indicatorSize?: GetIndicatorSize; | ||
} | ||
declare const ForwardTabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>; | ||
export default ForwardTabs; |
@@ -23,3 +23,3 @@ "use strict"; | ||
var _useAnimateConfig = _interopRequireDefault(require("./hooks/useAnimateConfig")); | ||
var _excluded = ["id", "prefixCls", "className", "items", "direction", "activeKey", "defaultActiveKey", "editable", "animated", "tabPosition", "tabBarGutter", "tabBarStyle", "tabBarExtraContent", "locale", "moreIcon", "moreTransitionName", "destroyInactiveTabPane", "renderTabBar", "onChange", "onTabClick", "onTabScroll", "getPopupContainer", "popupClassName", "indicatorLength"]; // Accessibility https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Tab_Role | ||
var _excluded = ["id", "prefixCls", "className", "items", "direction", "activeKey", "defaultActiveKey", "editable", "animated", "tabPosition", "tabBarGutter", "tabBarStyle", "tabBarExtraContent", "locale", "moreIcon", "moreTransitionName", "destroyInactiveTabPane", "renderTabBar", "onChange", "onTabClick", "onTabScroll", "getPopupContainer", "popupClassName", "indicatorSize"]; // Accessibility https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Tab_Role | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
@@ -64,3 +64,3 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
popupClassName = _ref.popupClassName, | ||
indicatorLength = _ref.indicatorLength, | ||
indicatorSize = _ref.indicatorSize, | ||
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded); | ||
@@ -168,3 +168,3 @@ var tabs = React.useMemo(function () { | ||
popupClassName: popupClassName, | ||
indicatorLength: indicatorLength | ||
indicatorSize: indicatorSize | ||
}); | ||
@@ -171,0 +171,0 @@ return /*#__PURE__*/React.createElement(_TabContext.default.Provider, { |
{ | ||
"name": "rc-tabs", | ||
"version": "12.11.0", | ||
"version": "12.11.1", | ||
"description": "tabs ui component for react", | ||
@@ -5,0 +5,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
160477