Skip to content

Commit b581210

Browse files
adding moreButtonPlugin_buttonTooltip option
1 parent 505ddeb commit b581210

File tree

3 files changed

+27
-22
lines changed

3 files changed

+27
-22
lines changed

src/plugins/moreButtonPlugin/button/api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default function Api(components) {
2222
onClick,
2323
ref,
2424
className: this._api.getSetting('titleClass') + ' ' + this._api.getSetting('showMoreButtonClass'),
25+
title: this._api.getOption('moreButtonPlugin_buttonTooltip'),
2526
};
2627
if (this._api.getOption('accessibility')) {
2728
result.tabIndex = 0;

src/plugins/moreButtonPlugin/icon.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
export default function MoreButtonPlugin_iconComponent(props) {
4-
const style = {};
5-
if (props.instance.getOption('direction') === 'rtl') {
6-
style.transform = 'rotate(180deg)';
7-
}
8-
return (
9-
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512" title="More tabs" style={style}>
10-
<path
11-
fill="gray"
12-
d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"
13-
/>
14-
</svg>
15-
);
4+
const style = {};
5+
if (props.instance.getOption('direction') === 'rtl') {
6+
style.transform = 'rotate(180deg)';
7+
}
8+
return (
9+
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512" style={style}>
10+
<path
11+
fill="gray"
12+
d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"
13+
/>
14+
</svg>
15+
);
1616
}
1717
MoreButtonPlugin_iconComponent.propTypes /* remove-proptypes */ = {
18-
instance: PropTypes.object,
19-
};
18+
instance: PropTypes.object,
19+
};

src/plugins/moreButtonPlugin/index.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ShowMoreButton.propTypes /* remove-proptypes */ = {
1515
children: PropTypes.element,
1616
};
1717
function setTablistOverflow(ctx, components) {
18-
components.MoreButtonPlugin = ShowMoreButton.bind(undefined, { ctx, components });
18+
components.MoreButtonPlugin = ShowMoreButton.bind(undefined, {ctx, components});
1919
if (!components.OriginalTablistOverflow) {
2020
components.OriginalTablistOverflow = components.TablistOverflow;
2121
components.TablistOverflow = function (props) {
@@ -31,18 +31,22 @@ function setTablistOverflow(ctx, components) {
3131
function setTablistView(ctx, components) {
3232
components.TablistView = components.TablistViewFactory.bind(undefined, (ins) => ({
3333
tablistViewPropsManager: () => {
34-
let { className } = components.tablistViewPropsManager(ins);
34+
let {className} = components.tablistViewPropsManager(ins);
3535
className += ' rc-dyn-tabs-responsive';
36-
return { className };
36+
return {className};
3737
},
3838
}));
3939
}
4040
function setDefaultOptions(ctx) {
41-
ctx.optionsManager.options = Object.assign({
42-
moreButtonPlugin_buttonComponent,
43-
moreButtonPlugin_iconComponent
44-
}, ctx.optionsManager.options);
45-
};
41+
ctx.optionsManager.options = Object.assign(
42+
{
43+
moreButtonPlugin_buttonComponent,
44+
moreButtonPlugin_iconComponent,
45+
moreButtonPlugin_buttonTooltip: 'show more',
46+
},
47+
ctx.optionsManager.options,
48+
);
49+
}
4650
export default function ResponsiveFactory(ctx, components) {
4751
setDefaultOptions(ctx);
4852
setTablistView(ctx, components);

0 commit comments

Comments
 (0)