chore : prettier code (#29123)

* style: prettier code

* update

* Update index.less
This commit is contained in:
xrkffgg 2021-01-30 19:39:02 +08:00 committed by GitHub
parent 431aee165d
commit dcc0ffa016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 77 additions and 84 deletions

View File

@ -83,13 +83,13 @@ ReactDOM.render(
} }
.demo-nav { .demo-nav {
height: 30px; height: 30px;
line-height: 30px;
margin-bottom: 16px; margin-bottom: 16px;
line-height: 30px;
background: #f8f8f8; background: #f8f8f8;
} }
.demo-nav a { .demo-nav a {
line-height: 30px;
padding: 0 8px; padding: 0 8px;
line-height: 30px;
} }
.app-list { .app-list {
margin-top: 16px; margin-top: 16px;

View File

@ -32,7 +32,7 @@ ReactDOM.render(
```css ```css
.site-button-ghost-wrapper { .site-button-ghost-wrapper {
background: rgb(190, 200, 200);
padding: 26px 16px 16px; padding: 26px 16px 16px;
background: rgb(190, 200, 200);
} }
``` ```

View File

@ -84,20 +84,20 @@ ReactDOM.render(
```css ```css
.events { .events {
list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none;
} }
.events .ant-badge-status { .events .ant-badge-status {
overflow: hidden;
white-space: nowrap;
width: 100%; width: 100%;
text-overflow: ellipsis; overflow: hidden;
font-size: 12px; font-size: 12px;
white-space: nowrap;
text-overflow: ellipsis;
} }
.notes-month { .notes-month {
text-align: center;
font-size: 28px; font-size: 28px;
text-align: center;
} }
.notes-month section { .notes-month section {
font-size: 28px; font-size: 28px;

View File

@ -10,9 +10,9 @@
position: relative; position: relative;
display: block; display: block;
box-sizing: border-box; box-sizing: border-box;
-webkit-touch-callout: none;
-ms-touch-action: pan-y; -ms-touch-action: pan-y;
touch-action: pan-y; touch-action: pan-y;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent;
} }

View File

@ -49,11 +49,11 @@ ReactDOM.render(
```css ```css
[data-theme='compact'] .site-collapse-custom-collapse .site-collapse-custom-panel, [data-theme='compact'] .site-collapse-custom-collapse .site-collapse-custom-panel,
.site-collapse-custom-collapse .site-collapse-custom-panel { .site-collapse-custom-collapse .site-collapse-custom-panel {
background: #f7f7f7;
border-radius: 2px;
margin-bottom: 24px; margin-bottom: 24px;
border: 0px;
overflow: hidden; overflow: hidden;
background: #f7f7f7;
border: 0px;
border-radius: 2px;
} }
``` ```

View File

@ -176,8 +176,8 @@ ReactDOM.render(<App />, mountNode);
} }
.locale-components { .locale-components {
border-top: 1px solid #d9d9d9;
padding-top: 16px; padding-top: 16px;
border-top: 1px solid #d9d9d9;
} }
.code-box-demo .example { .code-box-demo .example {

View File

@ -172,9 +172,9 @@ ReactDOM.render(<DrawerForm />, mountNode);
bottom: 0px; bottom: 0px;
width: 100%; width: 100%;
padding: 10px 16px; padding: 10px 16px;
border-top: 1px solid #e9e9e9;
background: #fff;
text-align: right; text-align: right;
background: #fff;
border-top: 1px solid #e9e9e9;
} }
``` ```

View File

@ -43,8 +43,8 @@ ReactDOM.render(
```css ```css
.site-dropdown-context-menu { .site-dropdown-context-menu {
background: #f7f7f7;
color: #777; color: #777;
background: #f7f7f7;
} }
``` ```

View File

@ -52,8 +52,8 @@
// not support the definition because the less variables have no meaning // not support the definition because the less variables have no meaning
& when (@theme = dark) { & when (@theme = dark) {
&-ellipse { &-ellipse {
fill-opacity: 0.08;
fill: @white; fill: @white;
fill-opacity: 0.08;
} }
&-path { &-path {
&-1 { &-1 {
@ -78,8 +78,8 @@
} }
& when not (@theme = dark) { & when not (@theme = dark) {
&-ellipse { &-ellipse {
fill-opacity: 0.8;
fill: #f5f5f5; fill: #f5f5f5;
fill-opacity: 0.8;
} }
&-path { &-path {
&-1 { &-1 {

View File

@ -122,12 +122,12 @@ ReactDOM.render(<DynamicFieldSet />, mountNode);
```css ```css
.dynamic-delete-button { .dynamic-delete-button {
margin: 0 8px;
cursor: pointer;
position: relative; position: relative;
top: 4px; top: 4px;
font-size: 24px; margin: 0 8px;
color: #999; color: #999;
font-size: 24px;
cursor: pointer;
transition: all 0.3s; transition: all 0.3s;
} }
.dynamic-delete-button:hover { .dynamic-delete-button:hover {

View File

@ -129,9 +129,9 @@
// Optional mark // Optional mark
.@{form-item-prefix-cls}-tooltip { .@{form-item-prefix-cls}-tooltip {
color: @text-color-secondary;
writing-mode: horizontal-tb; writing-mode: horizontal-tb;
margin-inline-start: @margin-xss; margin-inline-start: @margin-xss;
color: @text-color-secondary;
} }
&::after { &::after {

View File

@ -26,13 +26,7 @@ const InternalPreviewGroup: React.FC<GroupConsumerProps> = ({
}) => { }) => {
const { getPrefixCls } = React.useContext(ConfigContext); const { getPrefixCls } = React.useContext(ConfigContext);
const prefixCls = getPrefixCls('image-preview', customizePrefixCls); const prefixCls = getPrefixCls('image-preview', customizePrefixCls);
return ( return <RcImage.PreviewGroup previewPrefixCls={prefixCls} icons={icons} {...props} />;
<RcImage.PreviewGroup
previewPrefixCls={prefixCls}
icons={icons}
{...props}
/>
);
}; };
export default InternalPreviewGroup; export default InternalPreviewGroup;

View File

@ -42,8 +42,8 @@ ReactDOM.render(<ImageDemo />, mountNode);
```css ```css
.customize-mask { .customize-mask {
opacity: 1;
font-size: 20px; font-size: 20px;
opacity: 1;
} }
.customize-mask .anticon { .customize-mask .anticon {
font-size: 32px; font-size: 32px;

View File

@ -88,9 +88,9 @@ ReactDOM.render(<SiderDemo />, mountNode);
```css ```css
#components-layout-demo-custom-trigger .trigger { #components-layout-demo-custom-trigger .trigger {
padding: 0 24px;
font-size: 18px; font-size: 18px;
line-height: 64px; line-height: 64px;
padding: 0 24px;
cursor: pointer; cursor: pointer;
transition: color 0.3s; transition: color 0.3s;
} }

View File

@ -81,9 +81,9 @@ ReactDOM.render(<SiderDemo />, mountNode);
```css ```css
#components-layout-demo-custom-trigger .trigger { #components-layout-demo-custom-trigger .trigger {
padding: 0 24px;
font-size: 18px; font-size: 18px;
line-height: 64px; line-height: 64px;
padding: 0 24px;
cursor: pointer; cursor: pointer;
transition: color 0.3s; transition: color 0.3s;
} }
@ -94,8 +94,8 @@ ReactDOM.render(<SiderDemo />, mountNode);
#components-layout-demo-custom-trigger .logo { #components-layout-demo-custom-trigger .logo {
height: 32px; height: 32px;
background: rgba(255, 255, 255, 0.3);
margin: 16px; margin: 16px;
background: rgba(255, 255, 255, 0.3);
} }
.site-layout .site-layout-background { .site-layout .site-layout-background {

View File

@ -178,8 +178,8 @@ ReactDOM.render(
```css ```css
#components-layout-demo-fixed-sider .logo { #components-layout-demo-fixed-sider .logo {
height: 32px; height: 32px;
background: rgba(255, 255, 255, 0.2);
margin: 16px; margin: 16px;
background: rgba(255, 255, 255, 0.2);
} }
.site-layout .site-layout-background { .site-layout .site-layout-background {
background: #fff; background: #fff;

View File

@ -47,11 +47,11 @@ ReactDOM.render(
```css ```css
#components-layout-demo-fixed .logo { #components-layout-demo-fixed .logo {
float: left;
width: 120px; width: 120px;
height: 31px; height: 31px;
background: rgba(255, 255, 255, 0.2);
margin: 16px 24px 16px 0; margin: 16px 24px 16px 0;
float: left; background: rgba(255, 255, 255, 0.2);
} }
.site-layout .site-layout-background { .site-layout .site-layout-background {
background: #fff; background: #fff;

View File

@ -68,8 +68,8 @@ ReactDOM.render(
```css ```css
#components-layout-demo-responsive .logo { #components-layout-demo-responsive .logo {
height: 32px; height: 32px;
background: rgba(255, 255, 255, 0.2);
margin: 16px; margin: 16px;
background: rgba(255, 255, 255, 0.2);
} }
.site-layout-sub-header-background { .site-layout-sub-header-background {

View File

@ -112,11 +112,11 @@ ReactDOM.render(<InfiniteListExample />, mountNode);
```css ```css
.demo-infinite-container { .demo-infinite-container {
height: 300px;
padding: 8px 24px;
overflow: auto;
border: 1px solid #e8e8e8; border: 1px solid #e8e8e8;
border-radius: 4px; border-radius: 4px;
overflow: auto;
padding: 8px 24px;
height: 300px;
} }
.demo-loading-container { .demo-loading-container {
position: absolute; position: absolute;

View File

@ -149,9 +149,9 @@ ReactDOM.render(
```css ```css
#components-page-header-demo-content .image { #components-page-header-demo-content .image {
margin: 0 0 0 60px;
display: flex; display: flex;
align-items: center; align-items: center;
margin: 0 0 0 60px;
} }
#components-page-header-demo-content .ant-page-header-rtl .image { #components-page-header-demo-content .ant-page-header-rtl .image {
@ -159,8 +159,8 @@ ReactDOM.render(
} }
#components-page-header-demo-content .example-link { #components-page-header-demo-content .example-link {
line-height: 24px;
margin-right: 16px; margin-right: 16px;
line-height: 24px;
} }
[data-theme='compact'] #components-page-header-demo-content .example-link { [data-theme='compact'] #components-page-header-demo-content .example-link {
line-height: 20px; line-height: 20px;

View File

@ -50,7 +50,7 @@ ReactDOM.render(
```css ```css
.site-page-header-ghost-wrapper { .site-page-header-ghost-wrapper {
background-color: #f5f5f5;
padding: 24px; padding: 24px;
background-color: #f5f5f5;
} }
``` ```

View File

@ -72,10 +72,7 @@
height: @select-multiple-item-height; height: @select-multiple-item-height;
margin-top: @select-multiple-item-spacing-half; margin-top: @select-multiple-item-spacing-half;
margin-inline-end: @input-padding-vertical-base;
margin-bottom: @select-multiple-item-spacing-half; margin-bottom: @select-multiple-item-spacing-half;
padding-inline-start: @padding-xs;
padding-inline-end: (@padding-xs / 2);
line-height: @select-multiple-item-height - @select-multiple-item-border-width * 2; line-height: @select-multiple-item-height - @select-multiple-item-border-width * 2;
background: @select-selection-item-bg; background: @select-selection-item-bg;
border: 1px solid @select-selection-item-border-color; border: 1px solid @select-selection-item-border-color;
@ -83,6 +80,9 @@
cursor: default; cursor: default;
transition: font-size 0.3s, line-height 0.3s, height 0.3s; transition: font-size 0.3s, line-height 0.3s, height 0.3s;
user-select: none; user-select: none;
margin-inline-end: @input-padding-vertical-base;
padding-inline-start: @padding-xs;
padding-inline-end: (@padding-xs / 2);
.@{select-prefix-cls}-disabled& { .@{select-prefix-cls}-disabled& {
color: @select-multiple-item-disabled-color; color: @select-multiple-item-disabled-color;

View File

@ -56,9 +56,9 @@ ReactDOM.render(<IconSlider min={0} max={20} />, mountNode);
top: -2px; top: -2px;
width: 16px; width: 16px;
height: 16px; height: 16px;
line-height: 1;
font-size: 16px;
color: rgba(0, 0, 0, 0.25); color: rgba(0, 0, 0, 0.25);
font-size: 16px;
line-height: 1;
} }
.icon-wrapper .icon-wrapper-active { .icon-wrapper .icon-wrapper-active {

View File

@ -37,9 +37,9 @@ To input a value in a range.
### range ### range
| Property | Description | Type | Default | Version | | Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- | | -------------- | ------------------------------- | ------- | ------- | ------- |
| draggableTrack | Whether range track can be drag | boolean | false | 4.10.0 | | draggableTrack | Whether range track can be drag | boolean | false | 4.10.0 |
## Methods ## Methods

View File

@ -145,13 +145,13 @@ const Slider = React.forwardRef<unknown, SliderSingleProps | SliderRangeProps>(
if (direction === 'rtl' && !restProps.vertical) { if (direction === 'rtl' && !restProps.vertical) {
restProps.reverse = !restProps.reverse; restProps.reverse = !restProps.reverse;
} }
// extrack draggableTrack from range={{ ... }} // extrack draggableTrack from range={{ ... }}
let draggableTrack: boolean | undefined; let draggableTrack: boolean | undefined;
if (typeof range === 'object') { if (typeof range === 'object') {
draggableTrack = range.draggableTrack; draggableTrack = range.draggableTrack;
} }
if (range) { if (range) {
return ( return (
<RcRange <RcRange

View File

@ -38,9 +38,9 @@ cover: https://gw.alipayobjects.com/zos/alicdn/HZ3meFc6W/Silder.svg
### range ### range
| 参数 | 说明 | 类型 | 默认值 | 版本 | | 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- | | -------------- | -------------------- | ------- | ------ | ------ |
| draggableTrack | 范围刻度是否可被拖拽 | boolean | false | 4.10.0 | | draggableTrack | 范围刻度是否可被拖拽 | boolean | false | 4.10.0 |
## 方法 ## 方法

View File

@ -54,14 +54,14 @@ ReactDOM.render(
```css ```css
.space-align-container { .space-align-container {
display: flex; display: flex;
align-item: flex-start;
flex-wrap: wrap; flex-wrap: wrap;
align-item: flex-start;
} }
.space-align-block { .space-align-block {
margin: 8px 4px;
border: 1px solid #40a9ff;
padding: 4px;
flex: none; flex: none;
margin: 8px 4px;
padding: 4px;
border: 1px solid #40a9ff;
} }
.space-align-block .mock-block { .space-align-block .mock-block {
display: inline-block; display: inline-block;

View File

@ -26,12 +26,12 @@ ReactDOM.render(
```css ```css
.example { .example {
margin: 20px 0;
margin-bottom: 20px;
padding: 30px 50px;
text-align: center; text-align: center;
background: rgba(0, 0, 0, 0.05); background: rgba(0, 0, 0, 0.05);
border-radius: 4px; border-radius: 4px;
margin-bottom: 20px;
padding: 30px 50px;
margin: 20px 0;
} }
``` ```

View File

@ -52,8 +52,8 @@ ReactDOM.render(
```css ```css
.site-statistic-demo-card { .site-statistic-demo-card {
background: #ececec;
padding: 30px; padding: 30px;
background: #ececec;
} }
``` ```

View File

@ -78,13 +78,13 @@ ReactDOM.render(<App />, mountNode);
```css ```css
.steps-content { .steps-content {
min-height: 200px;
margin-top: 16px; margin-top: 16px;
padding-top: 80px;
text-align: center;
background-color: #fafafa;
border: 1px dashed #e9e9e9; border: 1px dashed #e9e9e9;
border-radius: 2px; border-radius: 2px;
background-color: #fafafa;
min-height: 200px;
text-align: center;
padding-top: 80px;
} }
.steps-action { .steps-action {

View File

@ -239,8 +239,8 @@ describe('Table.pagination', () => {
}); });
/** /**
* `pagination` is not designed to accept `true` value, but in practice, many people assign `true` * `pagination` is not designed to accept `true` value, but in practice, many people assign
* to `pagination`, since they misunderstand that `pagination` can accept a boolean value. * `true` to `pagination`, since they misunderstand that `pagination` can accept a boolean value.
*/ */
it('Accepts pagination as true', () => { it('Accepts pagination as true', () => {
const wrapper = mount(createTable({ pagination: true })); const wrapper = mount(createTable({ pagination: true }));

View File

@ -264,9 +264,9 @@ ReactDOM.render(<EditableTable />, mountNode);
} }
.editable-row:hover .editable-cell-value-wrap { .editable-row:hover .editable-cell-value-wrap {
padding: 4px 11px;
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
border-radius: 4px; border-radius: 4px;
padding: 4px 11px;
} }
[data-theme='dark'] .editable-row:hover .editable-cell-value-wrap { [data-theme='dark'] .editable-row:hover .editable-cell-value-wrap {

View File

@ -51,34 +51,34 @@ ReactDOM.render(
margin-top: -16px; margin-top: -16px;
} }
.card-container > .ant-tabs-card .ant-tabs-content > .ant-tabs-tabpane { .card-container > .ant-tabs-card .ant-tabs-content > .ant-tabs-tabpane {
background: #fff;
padding: 16px; padding: 16px;
background: #fff;
} }
.card-container > .ant-tabs-card > .ant-tabs-nav::before { .card-container > .ant-tabs-card > .ant-tabs-nav::before {
display: none; display: none;
} }
.card-container > .ant-tabs-card .ant-tabs-tab, .card-container > .ant-tabs-card .ant-tabs-tab,
[data-theme='compact'] .card-container > .ant-tabs-card .ant-tabs-tab { [data-theme='compact'] .card-container > .ant-tabs-card .ant-tabs-tab {
border-color: transparent;
background: transparent; background: transparent;
border-color: transparent;
} }
.card-container > .ant-tabs-card .ant-tabs-tab-active, .card-container > .ant-tabs-card .ant-tabs-tab-active,
[data-theme='compact'] .card-container > .ant-tabs-card .ant-tabs-tab-active { [data-theme='compact'] .card-container > .ant-tabs-card .ant-tabs-tab-active {
border-color: #fff;
background: #fff; background: #fff;
border-color: #fff;
} }
#components-tabs-demo-card-top .code-box-demo { #components-tabs-demo-card-top .code-box-demo {
background: #f5f5f5;
overflow: hidden;
padding: 24px; padding: 24px;
overflow: hidden;
background: #f5f5f5;
} }
[data-theme='compact'] .card-container > .ant-tabs-card .ant-tabs-content { [data-theme='compact'] .card-container > .ant-tabs-card .ant-tabs-content {
height: 120px; height: 120px;
margin-top: -8px; margin-top: -8px;
} }
[data-theme='dark'] .card-container > .ant-tabs-card .ant-tabs-tab { [data-theme='dark'] .card-container > .ant-tabs-card .ant-tabs-tab {
border-color: transparent;
background: transparent; background: transparent;
border-color: transparent;
} }
[data-theme='dark'] #components-tabs-demo-card-top .code-box-demo { [data-theme='dark'] #components-tabs-demo-card-top .code-box-demo {
background: #000; background: #000;
@ -87,7 +87,7 @@ ReactDOM.render(
background: #141414; background: #141414;
} }
[data-theme='dark'] .card-container > .ant-tabs-card .ant-tabs-tab-active { [data-theme='dark'] .card-container > .ant-tabs-card .ant-tabs-tab-active {
border-color: #141414;
background: #141414; background: #141414;
border-color: #141414;
} }
``` ```

View File

@ -273,10 +273,10 @@
&-ellipsis-multiple-line { &-ellipsis-multiple-line {
display: -webkit-box; display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
/*! autoprefixer: ignore next */ /*! autoprefixer: ignore next */
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden;
} }
} }

View File

@ -10,9 +10,9 @@
select:-webkit-autofill:hover, select:-webkit-autofill:hover,
select:-webkit-autofill:focus { select:-webkit-autofill:focus {
border: 1px solid @border-color-base; border: 1px solid @border-color-base;
-webkit-text-fill-color: @text-color;
box-shadow: none; box-shadow: none;
transition: background-color 5000s ease-in-out 0s; transition: background-color 5000s ease-in-out 0s;
-webkit-text-fill-color: @text-color;
} }
#header { #header {

View File

@ -10,10 +10,9 @@ const USE_REPLACEMENT = false;
const testDist = process.env.LIB_DIR === 'dist'; const testDist = process.env.LIB_DIR === 'dist';
/** /**
* Rc component will generate id for aria usage. * Rc component will generate id for aria usage. It's created as `test-uuid` when env === 'test'.
* It's created as `test-uuid` when env === 'test'. * Or `f7fa7a3c-a675-47bc-912e-0c45fb6a74d9`(randomly) when not test env. So we need hack of this
* Or `f7fa7a3c-a675-47bc-912e-0c45fb6a74d9`(randomly) when not test env. * to modify the `aria-controls`.
* So we need hack of this to modify the `aria-controls`.
*/ */
function ariaConvert(wrapper: CheerIO) { function ariaConvert(wrapper: CheerIO) {
if (!testDist || !USE_REPLACEMENT) return wrapper; if (!testDist || !USE_REPLACEMENT) return wrapper;