mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 03:22:59 +08:00
refactor: picker cssinjs (#35037)
* refactor: picker cssinjs * feat: cssinjs * feat: panel style * refactor: picker status style * feat: rtl style * test: fix lint * fix: fix && selector * fix: range style * fix: time panel style * fix: round arrow style * fix: style * fix: ranges * fix: logical * chore: comment
This commit is contained in:
parent
f4411d9393
commit
e8991979fd
@ -8,6 +8,7 @@ import type { ComponentToken as MentionsComponentToken } from '../../mentions/st
|
|||||||
import type { ComponentToken as SelectComponentToken } from '../../select/style';
|
import type { ComponentToken as SelectComponentToken } from '../../select/style';
|
||||||
import type { ComponentToken as SliderComponentToken } from '../../slider/style';
|
import type { ComponentToken as SliderComponentToken } from '../../slider/style';
|
||||||
import type { ComponentToken as TypographyComponentToken } from '../../typography/style';
|
import type { ComponentToken as TypographyComponentToken } from '../../typography/style';
|
||||||
|
import type { ComponentToken as DatePickerComponentToken } from '../../date-picker/style';
|
||||||
import type { ComponentToken as TimelineComponentToken } from '../../timeline/style';
|
import type { ComponentToken as TimelineComponentToken } from '../../timeline/style';
|
||||||
|
|
||||||
export const PresetColors = [
|
export const PresetColors = [
|
||||||
@ -48,6 +49,7 @@ export interface OverrideToken {
|
|||||||
Carousel?: {};
|
Carousel?: {};
|
||||||
Cascader?: CascaderComponentToken;
|
Cascader?: CascaderComponentToken;
|
||||||
Checkbox?: {};
|
Checkbox?: {};
|
||||||
|
DatePicker?: DatePickerComponentToken;
|
||||||
Descriptions?: {};
|
Descriptions?: {};
|
||||||
Divider?: DividerComponentToken;
|
Divider?: DividerComponentToken;
|
||||||
Drawer?: {};
|
Drawer?: {};
|
||||||
|
@ -16,11 +16,16 @@ import { Components, getTimeProps, PickerLocale, RangePickerProps } from '.';
|
|||||||
import { FormItemInputContext } from '../../form/context';
|
import { FormItemInputContext } from '../../form/context';
|
||||||
import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils';
|
import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils';
|
||||||
import { PickerComponentClass } from './interface';
|
import { PickerComponentClass } from './interface';
|
||||||
|
import useStyle from '../style';
|
||||||
|
|
||||||
export default function generateRangePicker<DateType>(
|
export default function generateRangePicker<DateType>(
|
||||||
generateConfig: GenerateConfig<DateType>,
|
generateConfig: GenerateConfig<DateType>,
|
||||||
): PickerComponentClass<RangePickerProps<DateType>> {
|
): PickerComponentClass<RangePickerProps<DateType>> {
|
||||||
class RangePicker extends React.Component<RangePickerProps<DateType>> {
|
type InternalRangePickerProps = RangePickerProps<DateType> & {
|
||||||
|
hashId?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
class RangePicker extends React.Component<InternalRangePickerProps> {
|
||||||
static contextType = ConfigContext;
|
static contextType = ConfigContext;
|
||||||
|
|
||||||
context: ConfigConsumerProps;
|
context: ConfigConsumerProps;
|
||||||
@ -51,6 +56,8 @@ export default function generateRangePicker<DateType>(
|
|||||||
bordered = true,
|
bordered = true,
|
||||||
placeholder,
|
placeholder,
|
||||||
status: customStatus,
|
status: customStatus,
|
||||||
|
dropdownClassName,
|
||||||
|
hashId,
|
||||||
...restProps
|
...restProps
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { format, showTime, picker } = this.props as any;
|
const { format, showTime, picker } = this.props as any;
|
||||||
@ -109,6 +116,7 @@ export default function generateRangePicker<DateType>(
|
|||||||
getMergedStatus(contextStatus, customStatus),
|
getMergedStatus(contextStatus, customStatus),
|
||||||
hasFeedback,
|
hasFeedback,
|
||||||
),
|
),
|
||||||
|
hashId,
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
locale={locale!.lang}
|
locale={locale!.lang}
|
||||||
@ -117,6 +125,7 @@ export default function generateRangePicker<DateType>(
|
|||||||
generateConfig={generateConfig}
|
generateConfig={generateConfig}
|
||||||
components={Components}
|
components={Components}
|
||||||
direction={direction}
|
direction={direction}
|
||||||
|
dropdownClassName={classNames(hashId, dropdownClassName)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
@ -142,6 +151,8 @@ export default function generateRangePicker<DateType>(
|
|||||||
const { getPrefixCls } = useContext(ConfigContext);
|
const { getPrefixCls } = useContext(ConfigContext);
|
||||||
const prefixCls = getPrefixCls('picker', customizePrefixCls);
|
const prefixCls = getPrefixCls('picker', customizePrefixCls);
|
||||||
|
|
||||||
return <RangePicker {...props} prefixCls={prefixCls} ref={ref} />;
|
const [wrapSSR, hashId] = useStyle(prefixCls);
|
||||||
|
|
||||||
|
return wrapSSR(<RangePicker {...props} prefixCls={prefixCls} ref={ref} hashId={hashId} />);
|
||||||
}) as unknown as PickerComponentClass<RangePickerProps<DateType>>;
|
}) as unknown as PickerComponentClass<RangePickerProps<DateType>>;
|
||||||
}
|
}
|
||||||
|
@ -24,17 +24,21 @@ import {
|
|||||||
import { FormItemInputContext } from '../../form/context';
|
import { FormItemInputContext } from '../../form/context';
|
||||||
import { getMergedStatus, getStatusClassNames, InputStatus } from '../../_util/statusUtils';
|
import { getMergedStatus, getStatusClassNames, InputStatus } from '../../_util/statusUtils';
|
||||||
import { DatePickRef, PickerComponentClass } from './interface';
|
import { DatePickRef, PickerComponentClass } from './interface';
|
||||||
|
import useStyle from '../style';
|
||||||
|
|
||||||
export default function generatePicker<DateType>(generateConfig: GenerateConfig<DateType>) {
|
export default function generatePicker<DateType>(generateConfig: GenerateConfig<DateType>) {
|
||||||
type DatePickerProps = PickerProps<DateType> & {
|
type DatePickerProps = PickerProps<DateType> & {
|
||||||
status?: InputStatus;
|
status?: InputStatus;
|
||||||
|
hashId?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
function getPicker<InnerPickerProps extends DatePickerProps>(
|
function getPicker<InnerPickerProps extends DatePickerProps>(
|
||||||
picker?: PickerMode,
|
picker?: PickerMode,
|
||||||
displayName?: string,
|
displayName?: string,
|
||||||
) {
|
) {
|
||||||
class Picker extends React.Component<InnerPickerProps> {
|
type InternalPickerProps = InnerPickerProps & { hashId?: string };
|
||||||
|
|
||||||
|
class Picker extends React.Component<InternalPickerProps> {
|
||||||
static contextType = ConfigContext;
|
static contextType = ConfigContext;
|
||||||
|
|
||||||
static displayName: string;
|
static displayName: string;
|
||||||
@ -76,6 +80,8 @@ export default function generatePicker<DateType>(generateConfig: GenerateConfig<
|
|||||||
placement,
|
placement,
|
||||||
placeholder,
|
placeholder,
|
||||||
status: customStatus,
|
status: customStatus,
|
||||||
|
dropdownClassName,
|
||||||
|
hashId,
|
||||||
...restProps
|
...restProps
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { format, showTime } = this.props as any;
|
const { format, showTime } = this.props as any;
|
||||||
@ -141,6 +147,7 @@ export default function generatePicker<DateType>(generateConfig: GenerateConfig<
|
|||||||
getMergedStatus(contextStatus, customStatus),
|
getMergedStatus(contextStatus, customStatus),
|
||||||
hasFeedback,
|
hasFeedback,
|
||||||
),
|
),
|
||||||
|
hashId,
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
prefixCls={prefixCls}
|
prefixCls={prefixCls}
|
||||||
@ -148,6 +155,7 @@ export default function generatePicker<DateType>(generateConfig: GenerateConfig<
|
|||||||
generateConfig={generateConfig}
|
generateConfig={generateConfig}
|
||||||
components={Components}
|
components={Components}
|
||||||
direction={direction}
|
direction={direction}
|
||||||
|
dropdownClassName={classNames(hashId, dropdownClassName)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
@ -172,14 +180,16 @@ export default function generatePicker<DateType>(generateConfig: GenerateConfig<
|
|||||||
|
|
||||||
const { getPrefixCls } = useContext(ConfigContext);
|
const { getPrefixCls } = useContext(ConfigContext);
|
||||||
const prefixCls = getPrefixCls('picker', customizePrefixCls);
|
const prefixCls = getPrefixCls('picker', customizePrefixCls);
|
||||||
|
const [wrapSSR, hashId] = useStyle(prefixCls);
|
||||||
|
|
||||||
const pickerProps: InnerPickerProps = {
|
const pickerProps: InnerPickerProps = {
|
||||||
...props,
|
...props,
|
||||||
prefixCls,
|
prefixCls,
|
||||||
ref,
|
ref,
|
||||||
|
hashId,
|
||||||
};
|
};
|
||||||
|
|
||||||
return <Picker {...pickerProps} />;
|
return wrapSSR(<Picker {...pickerProps} />);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (displayName) {
|
if (displayName) {
|
||||||
|
@ -1,364 +1,364 @@
|
|||||||
@import '../../style/themes/index';
|
//@import '../../style/themes/index';
|
||||||
@import '../../style/mixins/index';
|
//@import '../../style/mixins/index';
|
||||||
@import '../../input/style/mixin';
|
//@import '../../input/style/mixin';
|
||||||
@import './status';
|
//@import './status';
|
||||||
|
//
|
||||||
@picker-prefix-cls: ~'@{ant-prefix}-picker';
|
//@picker-prefix-cls: ~'@{ant-prefix}-picker';
|
||||||
|
//
|
||||||
.picker-padding(@input-height, @font-size, @padding-horizontal) {
|
//.picker-padding(@input-height, @font-size, @padding-horizontal) {
|
||||||
// font height probably 22.0001, So use floor better
|
// // font height probably 22.0001, So use floor better
|
||||||
@font-height: floor(@font-size * @line-height-base) + 2;
|
// @font-height: floor(@font-size * @line-height-base) + 2;
|
||||||
@padding-top: max(((@input-height - @font-height) / 2), 0);
|
// @padding-top: max(((@input-height - @font-height) / 2), 0);
|
||||||
@padding-bottom: max(@input-height - @font-height - @padding-top, 0);
|
// @padding-bottom: max(@input-height - @font-height - @padding-top, 0);
|
||||||
padding: @padding-top @padding-horizontal @padding-bottom;
|
// padding: @padding-top @padding-horizontal @padding-bottom;
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
.@{picker-prefix-cls} {
|
//.@{picker-prefix-cls} {
|
||||||
@arrow-size: @popover-arrow-width;
|
// @arrow-size: @popover-arrow-width;
|
||||||
|
//
|
||||||
.reset-component();
|
// .reset-component();
|
||||||
.picker-padding(@input-height-base, @font-size-base, @input-padding-horizontal-base);
|
// .picker-padding(@input-height-base, @font-size-base, @input-padding-horizontal-base);
|
||||||
position: relative;
|
// position: relative;
|
||||||
display: inline-flex;
|
// display: inline-flex;
|
||||||
align-items: center;
|
// align-items: center;
|
||||||
background: @picker-bg;
|
// background: @picker-bg;
|
||||||
border: @border-width-base @border-style-base @select-border-color;
|
// border: @border-width-base @border-style-base @select-border-color;
|
||||||
border-radius: @control-border-radius;
|
// border-radius: @control-border-radius;
|
||||||
transition: border @animation-duration-slow, box-shadow @animation-duration-slow;
|
// transition: border @animation-duration-slow, box-shadow @animation-duration-slow;
|
||||||
|
//
|
||||||
&:hover,
|
// &:hover,
|
||||||
&-focused {
|
// &-focused {
|
||||||
.hover();
|
// .hover();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-focused {
|
// &-focused {
|
||||||
.active();
|
// .active();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&&-disabled {
|
// &&-disabled {
|
||||||
background: @input-disabled-bg;
|
// background: @input-disabled-bg;
|
||||||
border-color: @select-border-color;
|
// border-color: @select-border-color;
|
||||||
cursor: not-allowed;
|
// cursor: not-allowed;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&&-disabled &-suffix {
|
// &&-disabled &-suffix {
|
||||||
color: @disabled-color;
|
// color: @disabled-color;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&&-borderless {
|
// &&-borderless {
|
||||||
background-color: transparent !important;
|
// background-color: transparent !important;
|
||||||
border-color: transparent !important;
|
// border-color: transparent !important;
|
||||||
box-shadow: none !important;
|
// box-shadow: none !important;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// ======================== Input =========================
|
// // ======================== Input =========================
|
||||||
&-input {
|
// &-input {
|
||||||
position: relative;
|
// position: relative;
|
||||||
display: inline-flex;
|
// display: inline-flex;
|
||||||
align-items: center;
|
// align-items: center;
|
||||||
width: 100%;
|
// width: 100%;
|
||||||
|
//
|
||||||
> input {
|
// > input {
|
||||||
.input();
|
// .input();
|
||||||
flex: auto;
|
// flex: auto;
|
||||||
|
//
|
||||||
// Fix Firefox flex not correct:
|
// // Fix Firefox flex not correct:
|
||||||
// https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553
|
// // https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553
|
||||||
min-width: 1px;
|
// min-width: 1px;
|
||||||
height: auto;
|
// height: auto;
|
||||||
padding: 0;
|
// padding: 0;
|
||||||
background: transparent;
|
// background: transparent;
|
||||||
|
//
|
||||||
border: 0;
|
// border: 0;
|
||||||
|
//
|
||||||
&:focus {
|
// &:focus {
|
||||||
box-shadow: none;
|
// box-shadow: none;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&[disabled] {
|
// &[disabled] {
|
||||||
background: transparent;
|
// background: transparent;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&:hover {
|
// &:hover {
|
||||||
.@{picker-prefix-cls}-clear {
|
// .@{picker-prefix-cls}-clear {
|
||||||
opacity: 1;
|
// opacity: 1;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-placeholder {
|
// &-placeholder {
|
||||||
> input {
|
// > input {
|
||||||
color: @input-placeholder-color;
|
// color: @input-placeholder-color;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// Size
|
// // Size
|
||||||
&-large {
|
// &-large {
|
||||||
.picker-padding(@input-height-lg, @font-size-lg, @input-padding-horizontal-lg);
|
// .picker-padding(@input-height-lg, @font-size-lg, @input-padding-horizontal-lg);
|
||||||
|
//
|
||||||
.@{picker-prefix-cls}-input > input {
|
// .@{picker-prefix-cls}-input > input {
|
||||||
font-size: @font-size-lg;
|
// font-size: @font-size-lg;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-small {
|
// &-small {
|
||||||
.picker-padding(@input-height-sm, @font-size-base, @input-padding-horizontal-sm);
|
// .picker-padding(@input-height-sm, @font-size-base, @input-padding-horizontal-sm);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-suffix {
|
// &-suffix {
|
||||||
display: flex;
|
// display: flex;
|
||||||
flex: none;
|
// flex: none;
|
||||||
align-self: center;
|
// align-self: center;
|
||||||
margin-left: (@padding-xs / 2);
|
// margin-left: (@padding-xs / 2);
|
||||||
color: @disabled-color;
|
// color: @disabled-color;
|
||||||
line-height: 1;
|
// line-height: 1;
|
||||||
pointer-events: none;
|
// pointer-events: none;
|
||||||
|
//
|
||||||
> * {
|
// > * {
|
||||||
vertical-align: top;
|
// vertical-align: top;
|
||||||
|
//
|
||||||
&:not(:last-child) {
|
// &:not(:last-child) {
|
||||||
margin-right: 8px;
|
// margin-right: 8px;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-clear {
|
// &-clear {
|
||||||
position: absolute;
|
// position: absolute;
|
||||||
top: 50%;
|
// top: 50%;
|
||||||
right: 0;
|
// right: 0;
|
||||||
color: @disabled-color;
|
// color: @disabled-color;
|
||||||
line-height: 1;
|
// line-height: 1;
|
||||||
background: @component-background;
|
// background: @component-background;
|
||||||
transform: translateY(-50%);
|
// transform: translateY(-50%);
|
||||||
cursor: pointer;
|
// cursor: pointer;
|
||||||
opacity: 0;
|
// opacity: 0;
|
||||||
transition: opacity @animation-duration-slow, color @animation-duration-slow;
|
// transition: opacity @animation-duration-slow, color @animation-duration-slow;
|
||||||
|
//
|
||||||
> * {
|
// > * {
|
||||||
vertical-align: top;
|
// vertical-align: top;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&:hover {
|
// &:hover {
|
||||||
color: @text-color-secondary;
|
// color: @text-color-secondary;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-separator {
|
// &-separator {
|
||||||
position: relative;
|
// position: relative;
|
||||||
display: inline-block;
|
// display: inline-block;
|
||||||
width: 1em;
|
// width: 1em;
|
||||||
height: @font-size-lg;
|
// height: @font-size-lg;
|
||||||
color: @disabled-color;
|
// color: @disabled-color;
|
||||||
font-size: @font-size-lg;
|
// font-size: @font-size-lg;
|
||||||
vertical-align: top;
|
// vertical-align: top;
|
||||||
cursor: default;
|
// cursor: default;
|
||||||
|
//
|
||||||
.@{picker-prefix-cls}-focused & {
|
// .@{picker-prefix-cls}-focused & {
|
||||||
color: @text-color-secondary;
|
// color: @text-color-secondary;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
.@{picker-prefix-cls}-range-separator & {
|
// .@{picker-prefix-cls}-range-separator & {
|
||||||
.@{picker-prefix-cls}-disabled & {
|
// .@{picker-prefix-cls}-disabled & {
|
||||||
cursor: not-allowed;
|
// cursor: not-allowed;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// ======================== Range =========================
|
// // ======================== Range =========================
|
||||||
&-range {
|
// &-range {
|
||||||
position: relative;
|
// position: relative;
|
||||||
display: inline-flex;
|
// display: inline-flex;
|
||||||
|
//
|
||||||
// Clear
|
// // Clear
|
||||||
.@{picker-prefix-cls}-clear {
|
// .@{picker-prefix-cls}-clear {
|
||||||
right: @input-padding-horizontal-base;
|
// right: @input-padding-horizontal-base;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&:hover {
|
// &:hover {
|
||||||
.@{picker-prefix-cls}-clear {
|
// .@{picker-prefix-cls}-clear {
|
||||||
opacity: 1;
|
// opacity: 1;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// Active bar
|
// // Active bar
|
||||||
.@{picker-prefix-cls}-active-bar {
|
// .@{picker-prefix-cls}-active-bar {
|
||||||
bottom: -@border-width-base;
|
// bottom: -@border-width-base;
|
||||||
height: 2px;
|
// height: 2px;
|
||||||
margin-left: @input-padding-horizontal-base;
|
// margin-left: @input-padding-horizontal-base;
|
||||||
background: @primary-color;
|
// background: @primary-color;
|
||||||
opacity: 0;
|
// opacity: 0;
|
||||||
transition: all @animation-duration-slow ease-out;
|
// transition: all @animation-duration-slow ease-out;
|
||||||
pointer-events: none;
|
// pointer-events: none;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&.@{picker-prefix-cls}-focused {
|
// &.@{picker-prefix-cls}-focused {
|
||||||
.@{picker-prefix-cls}-active-bar {
|
// .@{picker-prefix-cls}-active-bar {
|
||||||
opacity: 1;
|
// opacity: 1;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-separator {
|
// &-separator {
|
||||||
align-items: center;
|
// align-items: center;
|
||||||
padding: 0 @padding-xs;
|
// padding: 0 @padding-xs;
|
||||||
line-height: 1;
|
// line-height: 1;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&.@{picker-prefix-cls}-small {
|
// &.@{picker-prefix-cls}-small {
|
||||||
.@{picker-prefix-cls}-clear {
|
// .@{picker-prefix-cls}-clear {
|
||||||
right: @input-padding-horizontal-sm;
|
// right: @input-padding-horizontal-sm;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
.@{picker-prefix-cls}-active-bar {
|
// .@{picker-prefix-cls}-active-bar {
|
||||||
margin-left: @input-padding-horizontal-sm;
|
// margin-left: @input-padding-horizontal-sm;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// ======================= Dropdown =======================
|
// // ======================= Dropdown =======================
|
||||||
&-dropdown {
|
// &-dropdown {
|
||||||
.reset-component();
|
// .reset-component();
|
||||||
position: absolute;
|
// position: absolute;
|
||||||
z-index: @zindex-picker;
|
// z-index: @zindex-picker;
|
||||||
|
//
|
||||||
&-hidden {
|
// &-hidden {
|
||||||
display: none;
|
// display: none;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-placement-bottomLeft {
|
// &-placement-bottomLeft {
|
||||||
.@{picker-prefix-cls}-range-arrow {
|
// .@{picker-prefix-cls}-range-arrow {
|
||||||
top: (@arrow-size / 2) - (@arrow-size / 3) + 0.7px;
|
// top: (@arrow-size / 2) - (@arrow-size / 3) + 0.7px;
|
||||||
display: block;
|
// display: block;
|
||||||
transform: rotate(-135deg) translateY(1px);
|
// transform: rotate(-135deg) translateY(1px);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-placement-topLeft {
|
// &-placement-topLeft {
|
||||||
.@{picker-prefix-cls}-range-arrow {
|
// .@{picker-prefix-cls}-range-arrow {
|
||||||
bottom: (@arrow-size / 2) - (@arrow-size / 3) + 0.7px;
|
// bottom: (@arrow-size / 2) - (@arrow-size / 3) + 0.7px;
|
||||||
display: block;
|
// display: block;
|
||||||
transform: rotate(45deg);
|
// transform: rotate(45deg);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&.@{ant-prefix}-slide-up-enter.@{ant-prefix}-slide-up-enter-active&-placement-topLeft,
|
// &.@{ant-prefix}-slide-up-enter.@{ant-prefix}-slide-up-enter-active&-placement-topLeft,
|
||||||
&.@{ant-prefix}-slide-up-enter.@{ant-prefix}-slide-up-enter-active&-placement-topRight,
|
// &.@{ant-prefix}-slide-up-enter.@{ant-prefix}-slide-up-enter-active&-placement-topRight,
|
||||||
&.@{ant-prefix}-slide-up-appear.@{ant-prefix}-slide-up-appear-active&-placement-topLeft,
|
// &.@{ant-prefix}-slide-up-appear.@{ant-prefix}-slide-up-appear-active&-placement-topLeft,
|
||||||
&.@{ant-prefix}-slide-up-appear.@{ant-prefix}-slide-up-appear-active&-placement-topRight {
|
// &.@{ant-prefix}-slide-up-appear.@{ant-prefix}-slide-up-appear-active&-placement-topRight {
|
||||||
animation-name: antSlideDownIn;
|
// animation-name: antSlideDownIn;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&.@{ant-prefix}-slide-up-enter.@{ant-prefix}-slide-up-enter-active&-placement-bottomLeft,
|
// &.@{ant-prefix}-slide-up-enter.@{ant-prefix}-slide-up-enter-active&-placement-bottomLeft,
|
||||||
&.@{ant-prefix}-slide-up-enter.@{ant-prefix}-slide-up-enter-active&-placement-bottomRight,
|
// &.@{ant-prefix}-slide-up-enter.@{ant-prefix}-slide-up-enter-active&-placement-bottomRight,
|
||||||
&.@{ant-prefix}-slide-up-appear.@{ant-prefix}-slide-up-appear-active&-placement-bottomLeft,
|
// &.@{ant-prefix}-slide-up-appear.@{ant-prefix}-slide-up-appear-active&-placement-bottomLeft,
|
||||||
&.@{ant-prefix}-slide-up-appear.@{ant-prefix}-slide-up-appear-active&-placement-bottomRight {
|
// &.@{ant-prefix}-slide-up-appear.@{ant-prefix}-slide-up-appear-active&-placement-bottomRight {
|
||||||
animation-name: antSlideUpIn;
|
// animation-name: antSlideUpIn;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&.@{ant-prefix}-slide-up-leave.@{ant-prefix}-slide-up-leave-active&-placement-topLeft,
|
// &.@{ant-prefix}-slide-up-leave.@{ant-prefix}-slide-up-leave-active&-placement-topLeft,
|
||||||
&.@{ant-prefix}-slide-up-leave.@{ant-prefix}-slide-up-leave-active&-placement-topRight {
|
// &.@{ant-prefix}-slide-up-leave.@{ant-prefix}-slide-up-leave-active&-placement-topRight {
|
||||||
animation-name: antSlideDownOut;
|
// animation-name: antSlideDownOut;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&.@{ant-prefix}-slide-up-leave.@{ant-prefix}-slide-up-leave-active&-placement-bottomLeft,
|
// &.@{ant-prefix}-slide-up-leave.@{ant-prefix}-slide-up-leave-active&-placement-bottomLeft,
|
||||||
&.@{ant-prefix}-slide-up-leave.@{ant-prefix}-slide-up-leave-active&-placement-bottomRight {
|
// &.@{ant-prefix}-slide-up-leave.@{ant-prefix}-slide-up-leave-active&-placement-bottomRight {
|
||||||
animation-name: antSlideUpOut;
|
// animation-name: antSlideUpOut;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-dropdown-range {
|
// &-dropdown-range {
|
||||||
padding: (@arrow-size * 2 / 3) 0;
|
// padding: (@arrow-size * 2 / 3) 0;
|
||||||
|
//
|
||||||
&-hidden {
|
// &-hidden {
|
||||||
display: none;
|
// display: none;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// Time picker with additional style
|
// // Time picker with additional style
|
||||||
&-dropdown &-panel > &-time-panel {
|
// &-dropdown &-panel > &-time-panel {
|
||||||
padding-top: (@padding-xs / 2);
|
// padding-top: (@padding-xs / 2);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// ======================== Ranges ========================
|
// // ======================== Ranges ========================
|
||||||
&-ranges {
|
// &-ranges {
|
||||||
margin-bottom: 0;
|
// margin-bottom: 0;
|
||||||
padding: (@padding-xs / 2) @padding-sm;
|
// padding: (@padding-xs / 2) @padding-sm;
|
||||||
overflow: hidden;
|
// overflow: hidden;
|
||||||
line-height: @picker-text-height - 2 * @border-width-base - (@padding-xs / 2);
|
// line-height: @picker-text-height - 2 * @border-width-base - (@padding-xs / 2);
|
||||||
text-align: left;
|
// text-align: left;
|
||||||
list-style: none;
|
// list-style: none;
|
||||||
|
//
|
||||||
> li {
|
// > li {
|
||||||
display: inline-block;
|
// display: inline-block;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// https://github.com/ant-design/ant-design/issues/23687
|
// // https://github.com/ant-design/ant-design/issues/23687
|
||||||
.@{picker-prefix-cls}-preset > .@{ant-prefix}-tag-blue {
|
// .@{picker-prefix-cls}-preset > .@{ant-prefix}-tag-blue {
|
||||||
color: @primary-color;
|
// color: @primary-color;
|
||||||
background: @primary-1;
|
// background: @primary-1;
|
||||||
border-color: @primary-3;
|
// border-color: @primary-3;
|
||||||
cursor: pointer;
|
// cursor: pointer;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
.@{picker-prefix-cls}-ok {
|
// .@{picker-prefix-cls}-ok {
|
||||||
float: right;
|
// float: right;
|
||||||
margin-left: @padding-xs;
|
// margin-left: @padding-xs;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-range-wrapper {
|
// &-range-wrapper {
|
||||||
display: flex;
|
// display: flex;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-range-arrow {
|
// &-range-arrow {
|
||||||
position: absolute;
|
// position: absolute;
|
||||||
z-index: 1;
|
// z-index: 1;
|
||||||
display: none;
|
// display: none;
|
||||||
width: @arrow-size;
|
// width: @arrow-size;
|
||||||
height: @arrow-size;
|
// height: @arrow-size;
|
||||||
margin-left: @input-padding-horizontal-base * 1.5;
|
// margin-left: @input-padding-horizontal-base * 1.5;
|
||||||
background: linear-gradient(
|
// background: linear-gradient(
|
||||||
135deg,
|
// 135deg,
|
||||||
transparent 40%,
|
// transparent 40%,
|
||||||
@calendar-bg 40%
|
// @calendar-bg 40%
|
||||||
); // Use linear-gradient to prevent arrow from covering text
|
// ); // Use linear-gradient to prevent arrow from covering text
|
||||||
box-shadow: 2px 2px 6px -2px fade(@black, 10%); // use spread radius to hide shadow over popover
|
// box-shadow: 2px 2px 6px -2px fade(@black, 10%); // use spread radius to hide shadow over popover
|
||||||
transition: left @animation-duration-slow ease-out;
|
// transition: left @animation-duration-slow ease-out;
|
||||||
.roundedArrow(@arrow-size, 5px, @calendar-bg);
|
// .roundedArrow(@arrow-size, 5px, @calendar-bg);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-panel-container {
|
// &-panel-container {
|
||||||
overflow: hidden;
|
// overflow: hidden;
|
||||||
vertical-align: top;
|
// vertical-align: top;
|
||||||
background: @calendar-bg;
|
// background: @calendar-bg;
|
||||||
border-radius: @border-radius-base;
|
// border-radius: @border-radius-base;
|
||||||
box-shadow: @box-shadow-base;
|
// box-shadow: @box-shadow-base;
|
||||||
transition: margin @animation-duration-slow;
|
// transition: margin @animation-duration-slow;
|
||||||
|
//
|
||||||
.@{picker-prefix-cls}-panels {
|
// .@{picker-prefix-cls}-panels {
|
||||||
display: inline-flex;
|
// display: inline-flex;
|
||||||
flex-wrap: nowrap;
|
// flex-wrap: nowrap;
|
||||||
direction: ltr;
|
// direction: ltr;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
.@{picker-prefix-cls}-panel {
|
// .@{picker-prefix-cls}-panel {
|
||||||
vertical-align: top;
|
// vertical-align: top;
|
||||||
background: transparent;
|
// background: transparent;
|
||||||
border-width: 0 0 @border-width-base 0;
|
// border-width: 0 0 @border-width-base 0;
|
||||||
border-radius: 0;
|
// border-radius: 0;
|
||||||
|
//
|
||||||
.@{picker-prefix-cls}-content,
|
// .@{picker-prefix-cls}-content,
|
||||||
table {
|
// table {
|
||||||
text-align: center;
|
// text-align: center;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
&-focused {
|
// &-focused {
|
||||||
border-color: @border-color-split;
|
// border-color: @border-color-split;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
@import './panel';
|
//@import './panel';
|
||||||
@import './rtl';
|
//@import './rtl';
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user