mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +08:00
style: add rtl.less of InputNumber (#22434)
* seyle: add rtl.less of InputNumber * fix: snap
This commit is contained in:
parent
c9927b9b8d
commit
1f79c76b80
@ -2,7 +2,7 @@
|
||||
|
||||
exports[`InputNumber rtl render component should be rendered correctly in RTL direction 1`] = `
|
||||
<div
|
||||
class="ant-input-number"
|
||||
class="ant-input-number ant-input-number-rtl"
|
||||
>
|
||||
<div
|
||||
class="ant-input-number-handler-wrap"
|
||||
|
@ -54,7 +54,7 @@ export default class InputNumber extends React.Component<InputNumberProps, any>
|
||||
this.inputNumberRef.blur();
|
||||
}
|
||||
|
||||
renderInputNumber = ({ getPrefixCls }: ConfigConsumerProps) => {
|
||||
renderInputNumber = ({ getPrefixCls, direction }: ConfigConsumerProps) => {
|
||||
const { className, size: customizeSize, prefixCls: customizePrefixCls, ...others } = this.props;
|
||||
const prefixCls = getPrefixCls('input-number', customizePrefixCls);
|
||||
const upIcon = <UpOutlined className={`${prefixCls}-handler-up-inner`} />;
|
||||
@ -68,6 +68,7 @@ export default class InputNumber extends React.Component<InputNumberProps, any>
|
||||
{
|
||||
[`${prefixCls}-lg`]: mergeSize === 'large',
|
||||
[`${prefixCls}-sm`]: mergeSize === 'small',
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||
},
|
||||
className,
|
||||
);
|
||||
|
@ -182,3 +182,5 @@
|
||||
color: @disabled-color;
|
||||
}
|
||||
}
|
||||
|
||||
@import './rtl';
|
||||
|
24
components/input-number/style/rtl.less
Normal file
24
components/input-number/style/rtl.less
Normal file
@ -0,0 +1,24 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../style/mixins/index';
|
||||
@import '../../input/style/mixin';
|
||||
|
||||
@input-number-prefix-cls: ~'@{ant-prefix}-input-number';
|
||||
|
||||
.@{input-number-prefix-cls} {
|
||||
&-handler-wrap {
|
||||
.@{input-number-prefix-cls}-rtl & {
|
||||
right: auto;
|
||||
left: 0;
|
||||
border-right: @border-width-base @border-style-base @input-number-handler-border-color;
|
||||
border-left: 0;
|
||||
border-radius: @border-radius-base 0 0 @border-radius-base;
|
||||
}
|
||||
}
|
||||
|
||||
&-input {
|
||||
.@{input-number-prefix-cls}-rtl & {
|
||||
direction: rtl;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user