@rescui/tab-list 0.2.0 → 0.5.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/lib/index.css +232 -185
- package/lib/parts/chip-list-context.d.ts +0 -1
- package/lib/parts/chip-list-context.js +1 -1
- package/lib/parts/chip-list.d.ts +10 -3
- package/lib/parts/chip-list.js +3 -5
- package/lib/parts/chip-list.module.pcss.js +18 -16
- package/lib/parts/chip.d.ts +1 -33
- package/lib/parts/chip.js +13 -4
- package/lib/parts/deep-map.d.ts +1 -1
- package/lib/parts/separator.module.pcss.js +3 -3
- package/lib/parts/tab-list-context.d.ts +0 -1
- package/lib/parts/tab-list-context.js +1 -1
- package/lib/parts/tab-list.module.pcss.js +18 -18
- package/lib/parts/tab.d.ts +1 -33
- package/lib/parts/tab.js +13 -4
- package/lib/parts/use-scrollable-list.d.ts +1 -1
- package/lib/parts/with-scroll-arrows.d.ts +6 -1
- package/lib/parts/with-scroll-arrows.js +1 -2
- package/lib/parts/with-scroll-arrows.module.pcss.js +10 -10
- package/lib/tab-list.d.ts +11 -3
- package/lib/tab-list.js +3 -5
- package/package.json +8 -8
package/lib/parts/chip-list.d.ts
CHANGED
|
@@ -5,8 +5,6 @@ export declare type ChipListSizeType = 'l' | 'm' | 's';
|
|
|
5
5
|
export declare type ChipListModeType = 'classic' | 'rock';
|
|
6
6
|
export declare type InnerChipListProps = {
|
|
7
7
|
className?: string;
|
|
8
|
-
/** @ignore */
|
|
9
|
-
fullText?: boolean;
|
|
10
8
|
size?: ChipListSizeType;
|
|
11
9
|
/** Increase inner horizontal offset between the chips. */
|
|
12
10
|
sparse?: boolean;
|
|
@@ -21,5 +19,14 @@ export declare type InnerChipListProps = {
|
|
|
21
19
|
activeNodeRef?: React.MutableRefObject<HTMLElement>;
|
|
22
20
|
containerRef?: React.MutableRefObject<HTMLDivElement>;
|
|
23
21
|
};
|
|
24
|
-
export declare const ChipList:
|
|
22
|
+
export declare const ChipList: {
|
|
23
|
+
<OT extends ChipListValueType>({ compareValues, value, onChange, children, theme: themeFromProps, arrowBackgroundColor, ["data-e2e"]: e2eId, ...restProps }: React.PropsWithChildren<import("./with-scroll-arrows").WithScrollArrowsProps<OT> & {
|
|
24
|
+
size?: ChipListSizeType;
|
|
25
|
+
sparse?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
mode?: ChipListModeType;
|
|
28
|
+
'data-e2e'?: string;
|
|
29
|
+
}>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
25
32
|
export default ChipList;
|
package/lib/parts/chip-list.js
CHANGED
|
@@ -20,8 +20,6 @@ var InnerChipList = function InnerChipList(_ref) {
|
|
|
20
20
|
_ref$mode = _ref.mode,
|
|
21
21
|
mode = _ref$mode === void 0 ? 'classic' : _ref$mode,
|
|
22
22
|
theme = _ref.theme,
|
|
23
|
-
_ref$fullText = _ref.fullText,
|
|
24
|
-
fullText = _ref$fullText === void 0 ? false : _ref$fullText,
|
|
25
23
|
onChange = _ref.onChange,
|
|
26
24
|
children = _ref.children,
|
|
27
25
|
selectedId = _ref.selectedId,
|
|
@@ -29,7 +27,6 @@ var InnerChipList = function InnerChipList(_ref) {
|
|
|
29
27
|
e2eId = _ref['data-e2e'];
|
|
30
28
|
return /*#__PURE__*/React.createElement(ChipListContext.Provider, {
|
|
31
29
|
value: {
|
|
32
|
-
fullText: fullText,
|
|
33
30
|
onChange: onChange,
|
|
34
31
|
selectedId: selectedId
|
|
35
32
|
}
|
|
@@ -42,14 +39,15 @@ var InnerChipList = function InnerChipList(_ref) {
|
|
|
42
39
|
};
|
|
43
40
|
|
|
44
41
|
InnerChipList.displayName = 'ChipList';
|
|
45
|
-
var ChipList = withScrollArrows(InnerChipList, Chip, 'calc(100% + 8px)');
|
|
42
|
+
var ChipList = withScrollArrows(InnerChipList, Chip, 'calc(100% + 8px)'); // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
|
|
46
45
|
ChipList.propTypes = {
|
|
47
46
|
size: PropTypes.oneOf(['s', 'm', 'l']),
|
|
48
47
|
sparse: PropTypes.bool,
|
|
49
48
|
theme: PropTypes.oneOf(['light', 'dark']),
|
|
50
49
|
className: PropTypes.string,
|
|
51
50
|
mode: PropTypes.oneOf(['classic', 'rock']),
|
|
52
|
-
fullText: PropTypes.bool,
|
|
53
51
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.symbol]),
|
|
54
52
|
onChange: PropTypes.func,
|
|
55
53
|
compareValues: PropTypes.func,
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"chipsContainer": "
|
|
3
|
-
"chip": "
|
|
4
|
-
"light": "
|
|
5
|
-
"dark": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
2
|
+
"chipsContainer": "_chipsContainer_675g9w_9",
|
|
3
|
+
"chip": "_chip_675g9w_9",
|
|
4
|
+
"light": "_light_675g9w_49",
|
|
5
|
+
"dark": "_dark_675g9w_54",
|
|
6
|
+
"sizeXs": "_sizeXs_675g9w_1",
|
|
7
|
+
"sizeS": "_sizeS_675g9w_63",
|
|
8
|
+
"sizeM": "_sizeM_675g9w_69",
|
|
9
|
+
"sizeL": "_sizeL_675g9w_75",
|
|
10
|
+
"selected": "_selected_675g9w_59",
|
|
11
|
+
"withoutText": "_withoutText_675g9w_60",
|
|
12
|
+
"rs-reset-letter-spacing": "_rs-reset-letter-spacing_675g9w_1",
|
|
13
|
+
"rock": "_rock_675g9w_81",
|
|
14
|
+
"classic": "_classic_675g9w_143",
|
|
15
|
+
"innerOffsetM": "_innerOffsetM_675g9w_205",
|
|
16
|
+
"innerOffsetL": "_innerOffsetL_675g9w_213",
|
|
17
|
+
"icon": "_icon_675g9w_231",
|
|
18
|
+
"iconLeft": "_iconLeft_675g9w_235",
|
|
19
|
+
"iconRight": "_iconRight_675g9w_236"
|
|
18
20
|
};
|
|
19
21
|
export default styles;
|
package/lib/parts/chip.d.ts
CHANGED
|
@@ -22,37 +22,5 @@ export declare type ChipProps = {
|
|
|
22
22
|
icon?: never;
|
|
23
23
|
iconPosition?: never;
|
|
24
24
|
});
|
|
25
|
-
declare const Chip: React.ForwardRefExoticComponent<
|
|
26
|
-
className?: string;
|
|
27
|
-
value?: ChipListValueType;
|
|
28
|
-
/** @ignore */
|
|
29
|
-
itemId?: number;
|
|
30
|
-
/** @ignore */
|
|
31
|
-
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
32
|
-
/** @ignore */
|
|
33
|
-
onMouseDown?: React.MouseEventHandler<HTMLElement>;
|
|
34
|
-
/** Identifier for e2e tests */
|
|
35
|
-
'data-e2e'?: string;
|
|
36
|
-
children?: React.ReactNode;
|
|
37
|
-
} & {
|
|
38
|
-
/** Additional icon */
|
|
39
|
-
icon: React.ReactNode;
|
|
40
|
-
/** Additional icon position */
|
|
41
|
-
iconPosition?: ChipIconPosition;
|
|
42
|
-
} & React.RefAttributes<HTMLDivElement>) | ({
|
|
43
|
-
className?: string;
|
|
44
|
-
value?: ChipListValueType;
|
|
45
|
-
/** @ignore */
|
|
46
|
-
itemId?: number;
|
|
47
|
-
/** @ignore */
|
|
48
|
-
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
49
|
-
/** @ignore */
|
|
50
|
-
onMouseDown?: React.MouseEventHandler<HTMLElement>;
|
|
51
|
-
/** Identifier for e2e tests */
|
|
52
|
-
'data-e2e'?: string;
|
|
53
|
-
children?: React.ReactNode;
|
|
54
|
-
} & {
|
|
55
|
-
icon?: never;
|
|
56
|
-
iconPosition?: never;
|
|
57
|
-
} & React.RefAttributes<HTMLDivElement>)>;
|
|
25
|
+
declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLDivElement>>;
|
|
58
26
|
export default Chip;
|
package/lib/parts/chip.js
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
import "core-js/modules/web.dom-collections.for-each.js";
|
|
2
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
3
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
4
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
1
7
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
2
8
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
3
9
|
var _excluded = ["value", "className", "children", "icon", "iconPosition", "itemId", "onFocus", "onMouseDown", "data-e2e"];
|
|
4
|
-
|
|
10
|
+
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
|
|
13
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
|
+
|
|
5
15
|
import React, { forwardRef, cloneElement } from 'react';
|
|
6
16
|
import PropTypes from 'prop-types';
|
|
7
17
|
import cn from 'classnames';
|
|
@@ -28,15 +38,14 @@ var Chip = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
28
38
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
29
39
|
|
|
30
40
|
var _useChipListContext = useChipListContext(),
|
|
31
|
-
fullText = _useChipListContext.fullText,
|
|
32
41
|
onChange = _useChipListContext.onChange,
|
|
33
42
|
selectedId = _useChipListContext.selectedId;
|
|
34
43
|
|
|
35
44
|
var selected = itemId === selectedId;
|
|
36
45
|
var isRenderLeftIcon = icon && iconPosition === 'left';
|
|
37
46
|
var isRenderRightIcon = icon && iconPosition === 'right';
|
|
38
|
-
return /*#__PURE__*/React.createElement("div",
|
|
39
|
-
className: cn(styles.chip, (_cn = {}, _defineProperty(_cn, styles.selected, selected), _defineProperty(_cn, styles.
|
|
47
|
+
return /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({}, restProps), {}, {
|
|
48
|
+
className: cn(styles.chip, (_cn = {}, _defineProperty(_cn, styles.selected, selected), _defineProperty(_cn, styles.withoutText, isWithoutChildren(children)), _cn), className),
|
|
40
49
|
onClick: function onClick() {
|
|
41
50
|
return onChange(value);
|
|
42
51
|
},
|
package/lib/parts/deep-map.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare function deepMap(children: React.ReactNode, fn: (child: React.ReactNode) => React.ReactNode):
|
|
2
|
+
export declare function deepMap(children: React.ReactNode, fn: (child: React.ReactNode) => React.ReactNode): (React.ReactChild | React.ReactFragment | React.ReactPortal)[];
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"wrapper": "
|
|
3
|
-
"tabsContainer": "
|
|
4
|
-
"indicator": "
|
|
5
|
-
"light": "
|
|
6
|
-
"classic": "
|
|
7
|
-
"dark": "
|
|
8
|
-
"rock": "
|
|
9
|
-
"tab": "
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"sizeL": "
|
|
13
|
-
"innerOffsetM": "
|
|
14
|
-
"innerOffsetL": "
|
|
15
|
-
"short": "
|
|
16
|
-
"selected": "
|
|
17
|
-
"icon": "
|
|
18
|
-
"iconLeft": "
|
|
19
|
-
"iconRight": "
|
|
2
|
+
"wrapper": "_wrapper_1fcqo6x_9",
|
|
3
|
+
"tabsContainer": "_tabsContainer_1fcqo6x_13",
|
|
4
|
+
"indicator": "_indicator_1fcqo6x_19",
|
|
5
|
+
"light": "_light_1fcqo6x_31",
|
|
6
|
+
"classic": "_classic_1fcqo6x_31",
|
|
7
|
+
"dark": "_dark_1fcqo6x_35",
|
|
8
|
+
"rock": "_rock_1fcqo6x_39",
|
|
9
|
+
"tab": "_tab_1fcqo6x_13",
|
|
10
|
+
"sizeM": "_sizeM_1fcqo6x_99",
|
|
11
|
+
"rs-reset-letter-spacing": "_rs-reset-letter-spacing_1fcqo6x_1",
|
|
12
|
+
"sizeL": "_sizeL_1fcqo6x_104",
|
|
13
|
+
"innerOffsetM": "_innerOffsetM_1fcqo6x_109",
|
|
14
|
+
"innerOffsetL": "_innerOffsetL_1fcqo6x_117",
|
|
15
|
+
"short": "_short_1fcqo6x_133",
|
|
16
|
+
"selected": "_selected_1fcqo6x_141",
|
|
17
|
+
"icon": "_icon_1fcqo6x_239",
|
|
18
|
+
"iconLeft": "_iconLeft_1fcqo6x_253",
|
|
19
|
+
"iconRight": "_iconRight_1fcqo6x_261"
|
|
20
20
|
};
|
|
21
21
|
export default styles;
|
package/lib/parts/tab.d.ts
CHANGED
|
@@ -22,37 +22,5 @@ export declare type TabProps = {
|
|
|
22
22
|
icon?: never;
|
|
23
23
|
iconPosition?: never;
|
|
24
24
|
});
|
|
25
|
-
declare const Tab: React.ForwardRefExoticComponent<
|
|
26
|
-
className?: string;
|
|
27
|
-
value?: TabListValueType;
|
|
28
|
-
/** @ignore */
|
|
29
|
-
itemId?: number;
|
|
30
|
-
/** @ignore */
|
|
31
|
-
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
32
|
-
/** @ignore */
|
|
33
|
-
onMouseDown?: React.MouseEventHandler<HTMLElement>;
|
|
34
|
-
/** Identifier for e2e tests */
|
|
35
|
-
'data-e2e'?: string;
|
|
36
|
-
children?: React.ReactNode;
|
|
37
|
-
} & {
|
|
38
|
-
/** Additional icon */
|
|
39
|
-
icon: React.ReactNode;
|
|
40
|
-
/** Additional icon position */
|
|
41
|
-
iconPosition?: TabIconPosition;
|
|
42
|
-
} & React.RefAttributes<HTMLDivElement>) | ({
|
|
43
|
-
className?: string;
|
|
44
|
-
value?: TabListValueType;
|
|
45
|
-
/** @ignore */
|
|
46
|
-
itemId?: number;
|
|
47
|
-
/** @ignore */
|
|
48
|
-
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
49
|
-
/** @ignore */
|
|
50
|
-
onMouseDown?: React.MouseEventHandler<HTMLElement>;
|
|
51
|
-
/** Identifier for e2e tests */
|
|
52
|
-
'data-e2e'?: string;
|
|
53
|
-
children?: React.ReactNode;
|
|
54
|
-
} & {
|
|
55
|
-
icon?: never;
|
|
56
|
-
iconPosition?: never;
|
|
57
|
-
} & React.RefAttributes<HTMLDivElement>)>;
|
|
25
|
+
declare const Tab: React.ForwardRefExoticComponent<TabProps & React.RefAttributes<HTMLDivElement>>;
|
|
58
26
|
export default Tab;
|
package/lib/parts/tab.js
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
import "core-js/modules/web.dom-collections.for-each.js";
|
|
2
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
3
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
4
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
5
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
1
7
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
2
8
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
3
9
|
var _excluded = ["value", "className", "children", "icon", "iconPosition", "itemId", "onFocus", "onMouseDown", "data-e2e"];
|
|
4
|
-
|
|
10
|
+
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
|
|
13
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
|
+
|
|
5
15
|
import React, { forwardRef, cloneElement } from 'react';
|
|
6
16
|
import PropTypes from 'prop-types';
|
|
7
17
|
import cn from 'classnames';
|
|
@@ -24,15 +34,14 @@ var Tab = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
24
34
|
|
|
25
35
|
var _useTabListContext = useTabListContext(),
|
|
26
36
|
short = _useTabListContext.short,
|
|
27
|
-
fullText = _useTabListContext.fullText,
|
|
28
37
|
onChange = _useTabListContext.onChange,
|
|
29
38
|
selectedId = _useTabListContext.selectedId;
|
|
30
39
|
|
|
31
40
|
var selected = itemId === selectedId;
|
|
32
41
|
var isRenderLeftIcon = icon && iconPosition === 'left';
|
|
33
42
|
var isRenderRightIcon = icon && iconPosition === 'right';
|
|
34
|
-
return /*#__PURE__*/React.createElement("div",
|
|
35
|
-
className: cn(styles.tab, (_cn = {}, _defineProperty(_cn, styles.selected, selected), _defineProperty(_cn, styles.short, short),
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({}, restProps), {}, {
|
|
44
|
+
className: cn(styles.tab, (_cn = {}, _defineProperty(_cn, styles.selected, selected), _defineProperty(_cn, styles.short, short), _cn), className),
|
|
36
45
|
onClick: function onClick() {
|
|
37
46
|
return onChange(value);
|
|
38
47
|
},
|
|
@@ -11,7 +11,7 @@ export declare const useScrollableList: <T>({ children, compareValues, value, Co
|
|
|
11
11
|
activeNodeRef: React.MutableRefObject<HTMLElement>;
|
|
12
12
|
scrollableRef: React.MutableRefObject<HTMLDivElement>;
|
|
13
13
|
containerRef: React.MutableRefObject<HTMLElement>;
|
|
14
|
-
childrenWithValues:
|
|
14
|
+
childrenWithValues: (React.ReactChild | React.ReactFragment | React.ReactPortal)[];
|
|
15
15
|
showLeftArrow: boolean;
|
|
16
16
|
showRightArrow: boolean;
|
|
17
17
|
};
|
|
@@ -21,4 +21,9 @@ export declare type WithScrollArrowsWrappedComponentProps<T> = {
|
|
|
21
21
|
theme: Theme;
|
|
22
22
|
containerRef?: React.MutableRefObject<HTMLElement>;
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
declare type OmittedWrappedComponentProps<P, T> = Omit<P, keyof WithScrollArrowsWrappedComponentProps<T>>;
|
|
25
|
+
export declare const withScrollArrows: <T, P extends WithScrollArrowsWrappedComponentProps<T>>(WrappedComponent: React.FC<WithScrollArrowsWrappedComponentProps<T>>, CompareItem: React.ElementType, arrowHeight?: string) => {
|
|
26
|
+
<OT extends T>({ compareValues, value, onChange, children, theme: themeFromProps, arrowBackgroundColor, ["data-e2e"]: e2eId, ...restProps }: React.PropsWithChildren<WithScrollArrowsProps<OT> & OmittedWrappedComponentProps<P, OT>>): React.ReactElement | null;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -8,7 +8,6 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
|
8
8
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
9
9
|
var _excluded = ["compareValues", "value", "onChange", "children", "theme", "arrowBackgroundColor", "data-e2e"];
|
|
10
10
|
import "core-js/modules/es.function.name.js";
|
|
11
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
12
11
|
|
|
13
12
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
14
13
|
|
|
@@ -87,7 +86,7 @@ var withScrollArrows = function withScrollArrows(WrappedComponent, CompareItem)
|
|
|
87
86
|
})), /*#__PURE__*/React.createElement("div", {
|
|
88
87
|
className: styles.scrollable,
|
|
89
88
|
ref: scrollableRef
|
|
90
|
-
}, /*#__PURE__*/React.createElement(WrappedComponent,
|
|
89
|
+
}, /*#__PURE__*/React.createElement(WrappedComponent, _objectSpread({
|
|
91
90
|
selectedId: selectedId,
|
|
92
91
|
activeNodeRef: activeNodeRef,
|
|
93
92
|
value: value,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"wrapper": "
|
|
3
|
-
"scrollable": "
|
|
4
|
-
"arrowShadow": "
|
|
5
|
-
"arrow": "
|
|
6
|
-
"light": "
|
|
7
|
-
"dark": "
|
|
8
|
-
"shown": "
|
|
9
|
-
"arrowLeft": "
|
|
10
|
-
"arrowRight": "
|
|
11
|
-
"arrowButton": "
|
|
2
|
+
"wrapper": "_wrapper_edyv3p_4",
|
|
3
|
+
"scrollable": "_scrollable_edyv3p_10",
|
|
4
|
+
"arrowShadow": "_arrowShadow_edyv3p_39",
|
|
5
|
+
"arrow": "_arrow_edyv3p_39",
|
|
6
|
+
"light": "_light_edyv3p_82",
|
|
7
|
+
"dark": "_dark_edyv3p_86",
|
|
8
|
+
"shown": "_shown_edyv3p_91",
|
|
9
|
+
"arrowLeft": "_arrowLeft_edyv3p_99",
|
|
10
|
+
"arrowRight": "_arrowRight_edyv3p_112",
|
|
11
|
+
"arrowButton": "_arrowButton_edyv3p_126"
|
|
12
12
|
};
|
|
13
13
|
export default styles;
|
package/lib/tab-list.d.ts
CHANGED
|
@@ -5,8 +5,6 @@ export declare type TabListSizeType = 'l' | 'm';
|
|
|
5
5
|
export declare type TabListModeType = 'classic' | 'rock';
|
|
6
6
|
export declare type InnerTabListProps = {
|
|
7
7
|
className?: string;
|
|
8
|
-
/** @ignore */
|
|
9
|
-
fullText?: boolean;
|
|
10
8
|
size?: TabListSizeType;
|
|
11
9
|
/** Increase inner horizontal offset between the tabs. */
|
|
12
10
|
sparse?: boolean;
|
|
@@ -22,5 +20,15 @@ export declare type InnerTabListProps = {
|
|
|
22
20
|
activeNodeRef?: React.MutableRefObject<HTMLElement>;
|
|
23
21
|
containerRef?: React.MutableRefObject<HTMLDivElement>;
|
|
24
22
|
};
|
|
25
|
-
export declare const TabList:
|
|
23
|
+
export declare const TabList: {
|
|
24
|
+
<OT extends TabListValueType>({ compareValues, value, onChange, children, theme: themeFromProps, arrowBackgroundColor, ["data-e2e"]: e2eId, ...restProps }: React.PropsWithChildren<import("./parts/with-scroll-arrows").WithScrollArrowsProps<OT> & {
|
|
25
|
+
size?: TabListSizeType;
|
|
26
|
+
sparse?: boolean;
|
|
27
|
+
className?: string;
|
|
28
|
+
mode?: TabListModeType;
|
|
29
|
+
short?: boolean;
|
|
30
|
+
'data-e2e'?: string;
|
|
31
|
+
}>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
26
34
|
export default TabList;
|
package/lib/tab-list.js
CHANGED
|
@@ -22,8 +22,6 @@ var InnerTabList = function InnerTabList(_ref) {
|
|
|
22
22
|
_ref$short = _ref.short,
|
|
23
23
|
short = _ref$short === void 0 ? false : _ref$short,
|
|
24
24
|
theme = _ref.theme,
|
|
25
|
-
_ref$fullText = _ref.fullText,
|
|
26
|
-
fullText = _ref$fullText === void 0 ? false : _ref$fullText,
|
|
27
25
|
value = _ref.value,
|
|
28
26
|
onChange = _ref.onChange,
|
|
29
27
|
children = _ref.children,
|
|
@@ -39,7 +37,6 @@ var InnerTabList = function InnerTabList(_ref) {
|
|
|
39
37
|
return /*#__PURE__*/React.createElement(TabListContext.Provider, {
|
|
40
38
|
value: {
|
|
41
39
|
short: short,
|
|
42
|
-
fullText: fullText,
|
|
43
40
|
onChange: onChange,
|
|
44
41
|
selectedId: selectedId
|
|
45
42
|
}
|
|
@@ -55,7 +52,9 @@ var InnerTabList = function InnerTabList(_ref) {
|
|
|
55
52
|
};
|
|
56
53
|
|
|
57
54
|
InnerTabList.displayName = 'TabList';
|
|
58
|
-
var TabList = withScrollArrows(InnerTabList, Tab);
|
|
55
|
+
var TabList = withScrollArrows(InnerTabList, Tab); // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
|
|
59
58
|
TabList.propTypes = {
|
|
60
59
|
size: PropTypes.oneOf(['m', 'l']),
|
|
61
60
|
sparse: PropTypes.bool,
|
|
@@ -63,7 +62,6 @@ TabList.propTypes = {
|
|
|
63
62
|
className: PropTypes.string,
|
|
64
63
|
mode: PropTypes.oneOf(['classic', 'rock']),
|
|
65
64
|
short: PropTypes.bool,
|
|
66
|
-
fullText: PropTypes.bool,
|
|
67
65
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.symbol]),
|
|
68
66
|
onChange: PropTypes.func,
|
|
69
67
|
compareValues: PropTypes.func,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescui/tab-list",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "JetBrains",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime-corejs3": "^7.14.0",
|
|
19
19
|
"@juggle/resize-observer": "3.3.0",
|
|
20
|
-
"@rescui/button": "^0.
|
|
21
|
-
"@rescui/icons": "^0.
|
|
20
|
+
"@rescui/button": "^0.4.1",
|
|
21
|
+
"@rescui/icons": "^0.4.0",
|
|
22
22
|
"classnames": "^2.2.6",
|
|
23
23
|
"core-js": "^3.9.1"
|
|
24
24
|
},
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"react": ">=16.8.0 <18"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@rescui/colors": "^0.0.
|
|
32
|
-
"@rescui/postcss-preset-library": "^0.0.
|
|
33
|
-
"@rescui/scripts": "^0.1.
|
|
34
|
-
"@rescui/typography": "^0.
|
|
31
|
+
"@rescui/colors": "^0.0.6",
|
|
32
|
+
"@rescui/postcss-preset-library": "^0.0.4",
|
|
33
|
+
"@rescui/scripts": "^0.1.4",
|
|
34
|
+
"@rescui/typography": "^0.4.0",
|
|
35
35
|
"@rescui/visual-regression": "^0.0.1"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "rescui-scripts build"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "6b1d206de2641861028760d73f33dee214c07911"
|
|
41
41
|
}
|