feat: remove colorpicker

pull/1775/head
tanjinzhou 2020-07-03 18:12:44 +08:00
parent 535fb55ac9
commit 1a3a022bb5
7 changed files with 89 additions and 58 deletions

View File

@ -178,7 +178,7 @@ export default {
const prefixCls = getPrefixCls('color-picker', customizePrefixCls); const prefixCls = getPrefixCls('color-picker', customizePrefixCls);
const { disabled } = getOptionProps(this); const { disabled } = getOptionProps(this);
const classString = { const classString = {
[`${prefixCls}-box`]: true, [prefixCls]: true,
[`${prefixCls}-open`]: this.myOpen, [`${prefixCls}-open`]: this.myOpen,
[`${prefixCls}-lg`]: this.size === 'large', [`${prefixCls}-lg`]: this.size === 'large',
[`${prefixCls}-sm`]: this.size === 'small', [`${prefixCls}-sm`]: this.size === 'small',

View File

@ -0,0 +1,36 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders ./antdv-demo/docs/color-picker/demo/alpha.md correctly 1`] = `<a-color-picker alpha="true"></a-color-picker>`;
exports[`renders ./antdv-demo/docs/color-picker/demo/basic.md correctly 1`] = `
<div class="ant-row">
<div class="ant-col ant-col-12">
有默认值
<a-colorpicker></a-colorpicker>
</div>
<div class="ant-col ant-col-12">
无默认值
<a-colorpicker></a-colorpicker>
</div>
</div>
`;
exports[`renders ./antdv-demo/docs/color-picker/demo/colors.md correctly 1`] = `<a-color-picker config="[object Object]"></a-color-picker>`;
exports[`renders ./antdv-demo/docs/color-picker/demo/hue.md correctly 1`] = `<a-color-picker></a-color-picker>`;
exports[`renders ./antdv-demo/docs/color-picker/demo/size.md correctly 1`] = `
<div>
<div class="ant-row">
<div class="ant-col ant-col-8">
<a-colorpicker size="large"></a-colorpicker>
</div>
<div class="ant-col ant-col-8">
<a-colorpicker></a-colorpicker>
</div>
<div class="ant-col ant-col-8">
<a-colorpicker size="small"></a-colorpicker>
</div>
</div>
</div>
`;

View File

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ColorPicker prop locale should works 1`] = ` exports[`ColorPicker prop locale should works 1`] = `
<div tabindex="0" class="ant-color-picker-box ant-color-picker-open"> <div tabindex="0" class="ant-color-picker ant-color-picker-open">
<div class="ant-color-picker-selection"> <div class="ant-color-picker-selection">
<div id="color-picker-box25"> <div id="color-picker-box25">
<div class="pickr"> <div class="pickr">
@ -57,7 +57,7 @@ exports[`ColorPicker prop locale should works 1`] = `
`; `;
exports[`ColorPicker save event should works 1`] = ` exports[`ColorPicker save event should works 1`] = `
<div tabindex="0" class="ant-color-picker-box ant-color-picker-open"> <div tabindex="0" class="ant-color-picker ant-color-picker-open">
<div class="ant-color-picker-selection"> <div class="ant-color-picker-selection">
<div id="color-picker-box31"> <div id="color-picker-box31">
<div class="pickr"> <div class="pickr">
@ -113,7 +113,7 @@ exports[`ColorPicker save event should works 1`] = `
`; `;
exports[`ColorPicker should support default value 1`] = ` exports[`ColorPicker should support default value 1`] = `
<div tabindex="0" class="ant-color-picker-box ant-color-picker-open"> <div tabindex="0" class="ant-color-picker ant-color-picker-open">
<div class="ant-color-picker-selection"> <div class="ant-color-picker-selection">
<div id="color-picker-box1"> <div id="color-picker-box1">
<div class="pickr"> <div class="pickr">
@ -169,7 +169,7 @@ exports[`ColorPicker should support default value 1`] = `
`; `;
exports[`ColorPicker should support disabled 1`] = ` exports[`ColorPicker should support disabled 1`] = `
<div tabindex="-1" class="ant-color-picker-box ant-color-picker-disabled"> <div tabindex="-1" class="ant-color-picker ant-color-picker-disabled">
<div class="ant-color-picker-selection"> <div class="ant-color-picker-selection">
<div id="color-picker-box13"> <div id="color-picker-box13">
<div class="pickr"> <div class="pickr">
@ -225,7 +225,7 @@ exports[`ColorPicker should support disabled 1`] = `
`; `;
exports[`ColorPicker should support format 1`] = ` exports[`ColorPicker should support format 1`] = `
<div tabindex="0" class="ant-color-picker-box"> <div tabindex="0" class="ant-color-picker">
<div class="ant-color-picker-selection"> <div class="ant-color-picker-selection">
<div id="color-picker-box19"> <div id="color-picker-box19">
<div class="pickr"> <div class="pickr">
@ -281,7 +281,7 @@ exports[`ColorPicker should support format 1`] = `
`; `;
exports[`ColorPicker should support v-model 1`] = ` exports[`ColorPicker should support v-model 1`] = `
<div tabindex="0" class="ant-color-picker-box"> <div tabindex="0" class="ant-color-picker">
<div class="ant-color-picker-selection"> <div class="ant-color-picker-selection">
<div id="color-picker-box7"> <div id="color-picker-box7">
<div class="pickr"> <div class="pickr">

View File

@ -1,55 +1,51 @@
@import '../../style/themes/index'; @import '../../style/themes/index';
@import '../../input/style/mixin'; @import '../../input/style/mixin';
@import '~@simonwep/pickr/dist/themes/classic.min.css'; // 'classic' theme
@import '~@simonwep/pickr/dist/themes/monolith.min.css'; // 'monolith' theme
@import '~@simonwep/pickr/dist/themes/nano.min.css'; // 'nano' theme
@color-picker-prefix-cls: ~'@{ant-prefix}-color-picker'; @color-picker-prefix-cls: ~'@{ant-prefix}-color-picker';
.@{color-picker-prefix-cls} { .@{color-picker-prefix-cls} {
&-box{ box-sizing: border-box;
box-sizing: border-box; margin: 0;
margin: 0; padding: 0;
padding: 0; color: rgba(0, 0, 0, 0.65);
color: rgba(0, 0, 0, 0.65); font-size: 14px;
font-size: 14px; font-variant: tabular-nums;
font-variant: tabular-nums; line-height: 1.5;
line-height: 1.5; list-style: none;
list-style: none; font-feature-settings: 'tnum';
font-feature-settings: 'tnum'; position: relative;
position: relative; display: inline-block;
outline: none;
cursor: pointer;
transition: opacity 0.3s;
min-width: 55px;
.pickr {
display: inline-block; display: inline-block;
outline: none; .pcr-button {
cursor: pointer; width: 18px;
transition: opacity 0.3s; height: 18px;
min-width: 55px; margin-left: 7px;
.pickr{ &:focus {
display: inline-block; box-shadow: none;
button{
width: 18px;
height: 18px;
margin-left: 7px;
&:focus{
box-shadow: none;
}
} }
} }
&.@{color-picker-prefix-cls}-disabled{ }
cursor: not-allowed; &.@{color-picker-prefix-cls}-disabled {
.@{color-picker-prefix-cls}-selection { cursor: not-allowed;
background: @input-disabled-bg; .@{color-picker-prefix-cls}-selection {
box-shadow: none; background: @input-disabled-bg;
box-shadow: none;
border: @border-width-base @border-style-base @select-border-color;
&:hover,
&:focus,
&:active {
border: @border-width-base @border-style-base @select-border-color; border: @border-width-base @border-style-base @select-border-color;
&:hover, box-shadow: none;
&:focus,
&:active {
border: @border-width-base @border-style-base @select-border-color;
box-shadow: none;
}
} }
&.@{color-picker-prefix-cls}-open { }
.@{color-picker-prefix-cls}-icon { &.@{color-picker-prefix-cls}-open {
& svg { .@{color-picker-prefix-cls}-icon {
transform: none; & svg {
} transform: none;
} }
} }
} }
@ -64,7 +60,7 @@
.active(); .active();
} }
} }
&-selection{ &-selection {
display: block; display: block;
box-sizing: border-box; box-sizing: border-box;
background-color: @select-background; background-color: @select-background;
@ -82,7 +78,7 @@
.hover; .hover;
} }
} }
&-icon{ &-icon {
.iconfont-mixin(); .iconfont-mixin();
position: absolute; position: absolute;
top: 50%; top: 50%;
@ -112,7 +108,7 @@
line-height: @input-height-sm - 12; line-height: @input-height-sm - 12;
height: @input-height-sm; height: @input-height-sm;
} }
.pickr button{ .pickr .pcr-button {
width: 14px; width: 14px;
height: 14px; height: 14px;
} }

View File

@ -136,7 +136,7 @@ import { default as Skeleton } from './skeleton';
import { default as Comment } from './comment'; import { default as Comment } from './comment';
import { default as ColorPicker } from './color-picker'; // import { default as ColorPicker } from './color-picker';
import { default as ConfigProvider } from './config-provider'; import { default as ConfigProvider } from './config-provider';
@ -205,7 +205,7 @@ const components = [
Drawer, Drawer,
Skeleton, Skeleton,
Comment, Comment,
ColorPicker, // ColorPicker,
ConfigProvider, ConfigProvider,
Empty, Empty,
Result, Result,
@ -295,7 +295,7 @@ export {
Drawer, Drawer,
Skeleton, Skeleton,
Comment, Comment,
ColorPicker, // ColorPicker,
ConfigProvider, ConfigProvider,
Empty, Empty,
Result, Result,

View File

@ -60,4 +60,4 @@ import './result/style';
import './descriptions/style'; import './descriptions/style';
import './page-header/style'; import './page-header/style';
import './form-model/style'; import './form-model/style';
import './color-picker/style'; // import './color-picker/style';

View File

@ -63,7 +63,6 @@ Array [
"Drawer", "Drawer",
"Skeleton", "Skeleton",
"Comment", "Comment",
"ColorPicker",
"ConfigProvider", "ConfigProvider",
"Empty", "Empty",
"Result", "Result",