This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
@import '../../input/style/mixin';
@import (reference) '../../style/themes/index';
@input-prefix-cls: ~'@{ant-prefix}-input';
@input-affix-margin: 4px;
.@{ant-prefix}-input-number {
&-affix-wrapper {
.input();
// or number handler will cover form status
position: relative;
display: inline-flex;
width: 90px;
padding: 0;
padding-inline-start: @input-padding-horizontal-base;
&:not(&-disabled):hover {
.hover();
z-index: 1;
}
&-focused,
&:focus {
z-index: 1;
}
&-disabled {
.@{ant-prefix}-input-number[disabled] {
background: transparent;
}
}
> div.@{ant-prefix}-input-number {
width: 100%;
border: none;
outline: none;
&.@{ant-prefix}-input-number-focused {
box-shadow: none !important;
}
}
input.@{ant-prefix}-input-number-input {
padding: 0;
}
&::before {
display: inline-block;
width: 0;
visibility: hidden;
content: '\a0';
}
.@{ant-prefix}-input-number-handler-wrap {
z-index: 2;
}
}
&-prefix,
&-suffix {
display: flex;
flex: none;
align-items: center;
pointer-events: none;
}
&-prefix {
margin-inline-end: @input-affix-margin;
}
&-suffix {
position: absolute;
top: 0;
right: 0;
z-index: 1;
height: 100%;
margin-right: @input-padding-horizontal-base;
margin-left: @input-affix-margin;
}
}
.@{ant-prefix}-input-number-group-wrapper .@{ant-prefix}-input-number-affix-wrapper {
width: 100%;
}

View File

@@ -0,0 +1,2 @@
@import './index.less';
@import './patch.less';

1042
node_modules/ng-zorro-antd/input-number/style/index.css generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,243 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@import '../../input/style/mixin';
@import './affix';
@import './status';
@input-number-prefix-cls: ~'@{ant-prefix}-input-number';
@form-item-prefix-cls: ~'@{ant-prefix}-form-item';
.@{input-number-prefix-cls} {
.reset-component();
.input();
//== Style for input-group: input with label, with button or dropdown...
&-group {
.reset-component();
.input-group(~'@{input-number-prefix-cls}');
&-wrapper {
display: inline-block;
text-align: start;
vertical-align: top; // https://github.com/ant-design/ant-design/issues/6403
.input-group-wrapper-compact(~'@{input-number-prefix-cls}');
}
}
display: inline-block;
width: 90px;
margin: 0;
padding: 0;
border: @border-width-base @border-style-base @input-border-color;
border-radius: @control-border-radius;
&-handler {
position: relative;
display: block;
width: 100%;
height: 50%;
overflow: hidden;
color: @text-color-secondary;
font-weight: bold;
line-height: 0;
text-align: center;
border-left: @border-width-base @border-style-base @input-number-handler-border-color;
transition: all 0.1s linear;
&:active {
background: @input-number-handler-active-bg;
}
&:hover &-up-inner,
&:hover &-down-inner {
color: @input-number-handler-hover-bg;
}
}
&-handler-up-inner,
&-handler-down-inner {
.iconfont-mixin();
position: absolute;
right: 4px;
width: 12px;
height: 12px;
color: @text-color-secondary;
line-height: 12px;
transition: all 0.1s linear;
user-select: none;
}
&:hover {
& + .@{form-item-prefix-cls}-children-icon {
opacity: 0;
transition: opacity 0.24s linear 0.24s;
}
}
&-focused {
.active();
}
&-disabled {
.disabled();
.@{input-number-prefix-cls}-input {
cursor: not-allowed;
}
.@{input-number-prefix-cls}-handler-wrap {
display: none;
}
}
&-readonly {
.@{input-number-prefix-cls}-handler-wrap {
display: none;
}
}
&-input {
width: 100%;
height: @input-height-base - 2px;
padding: 0 @control-padding-horizontal - 1px;
text-align: left;
background-color: transparent;
border: 0;
border-radius: @control-border-radius;
outline: 0;
transition: all 0.3s linear;
appearance: textfield !important;
.placeholder();
&[type='number']::-webkit-inner-spin-button,
&[type='number']::-webkit-outer-spin-button {
margin: 0;
/* stylelint-disable-next-line property-no-vendor-prefix */
-webkit-appearance: none;
appearance: none;
}
}
&-lg {
padding: 0;
font-size: @font-size-lg;
input {
height: @input-height-lg - 2px;
}
}
&-sm {
padding: 0;
input {
height: @input-height-sm - 2px;
padding: 0 @control-padding-horizontal-sm - 1px;
}
}
&-handler-wrap {
position: absolute;
top: 0;
right: 0;
width: 22px;
height: 100%;
background: transparent;
border-radius: 0 @control-border-radius @control-border-radius 0;
opacity: 0;
transition: opacity 0.24s linear 0.1s;
// Fix input number inside Menu makes icon too large
// We arise the selector priority by nest selector here
// https://github.com/ant-design/ant-design/issues/14367
.@{input-number-prefix-cls}-handler {
.@{input-number-prefix-cls}-handler-up-inner,
.@{input-number-prefix-cls}-handler-down-inner {
display: flex;
align-items: center;
justify-content: center;
min-width: auto;
margin-right: 0;
font-size: 7px;
}
}
.@{input-number-prefix-cls}-borderless & {
border-left-width: 0;
}
}
&-handler-wrap:hover &-handler {
height: 40%;
}
&:hover &-handler-wrap,
&-focused &-handler-wrap {
opacity: 1;
}
&-handler-up {
border-top-right-radius: @control-border-radius;
cursor: pointer;
&-inner {
top: 50%;
margin-top: -5px;
text-align: center;
}
&:hover {
height: 60% !important;
}
}
&-handler-down {
top: 0;
border-top: @border-width-base @border-style-base @input-number-handler-border-color;
border-bottom-right-radius: @control-border-radius;
cursor: pointer;
&-inner {
top: 50%;
text-align: center;
transform: translateY(-50%);
}
&:hover {
height: 60% !important;
}
.@{input-number-prefix-cls}-borderless & {
border-top-width: 0;
}
}
&:hover:not(.@{input-number-prefix-cls}-borderless) &-handler-down,
&-focused:not(.@{input-number-prefix-cls}-borderless) &-handler-down {
border-top: @border-width-base @border-style-base @input-number-handler-border-color;
}
&-handler-up-disabled,
&-handler-down-disabled {
cursor: not-allowed;
}
&-handler-up-disabled:hover &-handler-up-inner,
&-handler-down-disabled:hover &-handler-down-inner {
color: @disabled-color;
}
// ===================== Out Of Range =====================
&-out-of-range {
input {
color: @error-color;
}
}
// ===================== Compact Item Styles =====================
/* stylelint-disable less/no-duplicate-variables */
.compact-item(@input-number-prefix-cls, null, ~'@{input-number-prefix-cls}-focused');
.compact-item(~'@{input-number-prefix-cls}-affix-wrapper', null, ~'@{input-number-prefix-cls}-focused');
.compact-item(~'@{input-number-prefix-cls}-group-wrapper', ~'@{input-number-prefix-cls}-group-addon', ~'@{input-number-prefix-cls}-focused');
}
@import './rtl';

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
// The following patch applies only to input-number-legacy.
.@{ant-prefix}-input-number {
&-affix-wrapper {
> nz-input-number.@{ant-prefix}-input-number {
width: 100%;
border: none;
outline: none;
&.@{ant-prefix}-input-number-focused {
box-shadow: none !important;
}
}
}
&&-has-feedback {
.@{ant-prefix}-input-number-handler-wrap {
z-index: 2;
}
}
}

73
node_modules/ng-zorro-antd/input-number/style/rtl.less generated vendored Normal file
View File

@@ -0,0 +1,73 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@import '../../input/style/mixin';
@input-number-prefix-cls: ~'@{ant-prefix}-input-number';
.@{input-number-prefix-cls} {
&-rtl {
direction: rtl;
}
&-handler {
.@{input-number-prefix-cls}-rtl & {
border-right: @border-width-base @border-style-base @input-number-handler-border-color;
border-left: 0;
}
&-wrap {
.@{input-number-prefix-cls}-rtl & {
right: auto;
left: 0;
}
.@{input-number-prefix-cls}-rtl.@{input-number-prefix-cls}-borderless &,
.@{input-number-prefix-cls}-rtl.@{input-number-prefix-cls}-filled &,
.@{input-number-prefix-cls}-rtl.@{input-number-prefix-cls}-underlined & {
border-right-width: 0;
}
}
&-up {
.@{input-number-prefix-cls}-rtl & {
border-top-right-radius: 0;
}
}
&-down {
.@{input-number-prefix-cls}-rtl & {
border-bottom-right-radius: 0;
}
}
}
&-input {
.@{input-number-prefix-cls}-rtl & {
direction: ltr;
text-align: right;
}
}
}
// https://github.com/ant-design/ant-design/issues/35870
.input-group(@input-number-prefix-cls) {
> .@{input-number-prefix-cls}-rtl:first-child {
border-radius: 0 @border-radius-base @border-radius-base 0;
}
> .@{input-number-prefix-cls}-rtl:last-child {
border-radius: @border-radius-base 0 0 @border-radius-base;
}
&-addon {
.@{input-number-prefix-cls}-group-rtl &:first-child {
border-right: @border-width-base @border-style-base @input-border-color;
border-left: 0;
border-radius: 0 @border-radius-base @border-radius-base 0;
}
.@{input-number-prefix-cls}-group-rtl &:last-child {
border-right: 0;
border-left: @border-width-base @border-style-base @input-border-color;
border-radius: @border-radius-base 0 0 @border-radius-base;
}
}
}

View File

@@ -0,0 +1,29 @@
@import '../../input/style/mixin';
@input-number-prefix-cls: ~'@{ant-prefix}-input-number';
@input-number-wrapper-cls: @input-number-prefix-cls, ~'@{input-number-prefix-cls}-affix-wrapper';
each(@input-number-wrapper-cls, {
.@{value} {
&-status-error {
.status-color(@value, @error-color, @error-color, @input-bg, @error-color-hover, @error-color-outline);
.status-color-common(@input-number-prefix-cls, @error-color, @error-color, @input-bg, @error-color-hover, @error-color-outline)
}
&-status-warning {
.status-color(@value, @warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline);
.status-color-common(@input-number-prefix-cls, @warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline)
}
}
});
.@{input-number-prefix-cls}-group-wrapper {
&-status-error {
.group-status-color(@input-number-prefix-cls, @error-color, @error-color);
}
&-status-warning {
.group-status-color(@input-number-prefix-cls, @warning-color, @warning-color);
}
}