Skip to content

Commit 2dbb7be

Browse files
refactor(color-picker): update types and remove undeveloped props (#615)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 0173f9d commit 2dbb7be

File tree

26 files changed

+64
-202
lines changed

26 files changed

+64
-202
lines changed

db/TDesign.db

0 Bytes
Binary file not shown.

packages/products/tdesign-miniprogram/src/color-picker/README.en-US.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ auto-close | Boolean | true | \- | N
1212
enable-alpha | Boolean | false | \- | N
1313
fixed | Boolean | false | `1.8.5` | N
1414
footer | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
15-
format | String | RGB | options: RGB/RGBA/HSL/HSLA/HSB/HSV/HSVA/HEX/CMYK/CSS | N
15+
format | String | RGB | When `enableAlpha` is true, `HEX8/RGBA/HSLA/HSVA` are valid。options: HEX/HEX8/RGB/RGBA/HSL/HSLA/HSV/HSVA/CMYK/CSS | N
1616
header | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
1717
popup-props | Object | {} | Typescript:`PopupProps`[Popup API Documents](./popup?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts) | N
18-
swatch-colors | Array | - | swatch colors。Typescript:`Array<string> \| null` | N
18+
swatch-colors | Array | undefined | swatch colors。Typescript:`Array<string> \| null \| undefined` | N
1919
type | String | base | options: base/multiple。Typescript:`TypeEnum ` `type TypeEnum = 'base' \| 'multiple'`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts) | N
2020
use-popup | Boolean | false | \- | N
2121
value | String | - | color value | N

packages/products/tdesign-miniprogram/src/color-picker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ auto-close | Boolean | true | 自动关闭。在点击遮罩层时自动关闭
1212
enable-alpha | Boolean | false | 是否开启透明通道 | N
1313
fixed | Boolean | false | `1.8.5`。如果 color-picker 是在一个 `position:fixed` 的区域,需要显式指定属性 fixed 为 true | N
1414
footer | Slot | - | 底部插槽,仅在 `usePopup``true` 时有效。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
15-
format | String | RGB | 格式化色值。`enableAlpha` 为真时,`RGBA/HSLA/HSVA` 等值有效。可选项:RGB/RGBA/HSL/HSLA/HSB/HSV/HSVA/HEX/CMYK/CSS | N
15+
format | String | RGB | 格式化色值。`enableAlpha` 为真时,`HEX8/RGBA/HSLA/HSVA` 有效。可选项:HEX/HEX8/RGB/RGBA/HSL/HSLA/HSV/HSVA/CMYK/CSS | N
1616
header | Slot | - | 顶部插槽,仅在 `usePopup``true` 时有效。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
1717
popup-props | Object | {} | 透传 Popup 组件全部属性。TS 类型:`PopupProps`[Popup API Documents](./popup?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts) | N
18-
swatch-colors | Array | - | 系统预设的颜色样例,值为 `null``[]` 则不显示系统色,值为 `undefined` 会显示组件内置的系统默认色。TS 类型:`Array<string> \| null` | N
18+
swatch-colors | Array | undefined | 系统预设的颜色样例,值为 `null``[]` 则不显示系统色,值为 `undefined` 会显示组件内置的系统默认色。TS 类型:`Array<string> \| null \| undefined` | N
1919
type | String | base | 颜色选择器类型。(base 表示仅展示系统预设内容; multiple 表示展示色板和系统预设内容。可选项:base/multiple。TS 类型:`TypeEnum ` `type TypeEnum = 'base' \| 'multiple'`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts) | N
2020
use-popup | Boolean | false | 是否使用弹出层包裹颜色选择器 | N
2121
value | String | - | 色值 | N

packages/products/tdesign-miniprogram/src/color-picker/props.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const props: TdColorPickerProps = {
2121
type: Boolean,
2222
value: false,
2323
},
24-
/** 格式化色值。`enableAlpha` 为真时,`RGBA/HSLA/HSVA` 等值有效 */
24+
/** 格式化色值。`enableAlpha` 为真时,`HEX8/RGBA/HSLA/HSVA` 有效 */
2525
format: {
2626
type: String,
2727
value: 'RGB',
@@ -34,6 +34,7 @@ const props: TdColorPickerProps = {
3434
/** 系统预设的颜色样例,值为 `null` 或 `[]` 则不显示系统色,值为 `undefined` 会显示组件内置的系统默认色 */
3535
swatchColors: {
3636
type: Array,
37+
value: undefined,
3738
},
3839
/** 颜色选择器类型。(base 表示仅展示系统预设内容; multiple 表示展示色板和系统预设内容 */
3940
type: {

packages/products/tdesign-miniprogram/src/color-picker/type.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ export interface TdColorPickerProps {
3232
value?: boolean;
3333
};
3434
/**
35-
* 格式化色值。`enableAlpha` 为真时,`RGBA/HSLA/HSVA` 等值有效
35+
* 格式化色值。`enableAlpha` 为真时,`HEX8/RGBA/HSLA/HSVA` 有效
3636
* @default RGB
3737
*/
3838
format?: {
3939
type: StringConstructor;
40-
value?: 'RGB' | 'RGBA' | 'HSL' | 'HSLA' | 'HSB' | 'HSV' | 'HSVA' | 'HEX' | 'CMYK' | 'CSS';
40+
value?: 'HEX' | 'HEX8' | 'RGB' | 'RGBA' | 'HSL' | 'HSLA' | 'HSV' | 'HSVA' | 'CMYK' | 'CSS';
4141
};
4242
/**
4343
* 透传 Popup 组件全部属性
@@ -52,7 +52,7 @@ export interface TdColorPickerProps {
5252
*/
5353
swatchColors?: {
5454
type: ArrayConstructor;
55-
value?: Array<string> | null;
55+
value?: Array<string> | null | undefined;
5656
};
5757
/**
5858
* 颜色选择器类型。(base 表示仅展示系统预设内容; multiple 表示展示色板和系统预设内容

packages/products/tdesign-mobile-react/src/color-picker/color-picker.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ clearable | Boolean | false | \- | N
1212
enableAlpha | Boolean | false | \- | N
1313
fixed | Boolean | false | \- | N
1414
format | String | RGB | When `enableAlpha` is true, `HEX8/RGBA/HSLA/HSVA` are valid。options: HEX/HEX8/RGB/RGBA/HSL/HSLA/HSV/HSVA/CMYK/CSS | N
15-
swatchColors | Array | - | swatch colors。Typescript:`Array<string> \| null` | N
15+
swatchColors | Array | undefined | swatch colors。Typescript:`Array<string> \| null \| undefined` | N
1616
type | String | base | options: base/multiple。Typescript:`TypeEnum ` `type TypeEnum = 'base' \| 'multiple'`[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/color-picker/type.ts) | N
1717
value | String | - | color value | N
1818
defaultValue | String | - | color value。uncontrolled property | N

packages/products/tdesign-mobile-react/src/color-picker/color-picker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ clearable | Boolean | false | 是否可清空 | N
1212
enableAlpha | Boolean | false | 是否开启透明通道 | N
1313
fixed | Boolean | false | 如果 color-picker 是在一个 `position:fixed` 的区域,需要显式指定属性 fixed 为 true | N
1414
format | String | RGB | 格式化色值。`enableAlpha` 为真时,`HEX8/RGBA/HSLA/HSVA` 有效。可选项:HEX/HEX8/RGB/RGBA/HSL/HSLA/HSV/HSVA/CMYK/CSS | N
15-
swatchColors | Array | - | 系统预设的颜色样例,值为 `null``[]` 则不显示系统色,值为 `undefined` 会显示组件内置的系统默认色。TS 类型:`Array<string> \| null` | N
15+
swatchColors | Array | undefined | 系统预设的颜色样例,值为 `null``[]` 则不显示系统色,值为 `undefined` 会显示组件内置的系统默认色。TS 类型:`Array<string> \| null \| undefined` | N
1616
type | String | base | 颜色选择器类型。(base 表示仅展示系统预设内容; multiple 表示展示色板和系统预设内容。可选项:base/multiple。TS 类型:`TypeEnum ` `type TypeEnum = 'base' \| 'multiple'`[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/color-picker/type.ts) | N
1717
value | String | - | 色值 | N
1818
defaultValue | String | - | 色值。非受控属性 | N

packages/products/tdesign-mobile-react/src/color-picker/defaultProps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ export const colorPickerDefaultProps: TdColorPickerProps = {
99
enableAlpha: false,
1010
fixed: false,
1111
format: 'RGB',
12+
swatchColors: undefined,
1213
type: 'base',
1314
};

packages/products/tdesign-mobile-react/src/color-picker/type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface TdColorPickerProps {
2828
/**
2929
* 系统预设的颜色样例,值为 `null` 或 `[]` 则不显示系统色,值为 `undefined` 会显示组件内置的系统默认色
3030
*/
31-
swatchColors?: Array<string> | null;
31+
swatchColors?: Array<string> | null | undefined;
3232
/**
3333
* 颜色选择器类型。(base 表示仅展示系统预设内容; multiple 表示展示色板和系统预设内容
3434
* @default base

packages/products/tdesign-mobile-vue/src/color-picker/color-picker.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ clearable | Boolean | false | \- | N
1010
enableAlpha | Boolean | false | \- | N
1111
fixed | Boolean | false | \- | N
1212
format | String | RGB | When `enableAlpha` is true, `HEX8/RGBA/HSLA/HSVA` are valid。options: HEX/HEX8/RGB/RGBA/HSL/HSLA/HSV/HSVA/CMYK/CSS | N
13-
swatchColors | Array | - | swatch colors。Typescript:`Array<string> \| null` | N
13+
swatchColors | Array | undefined | swatch colors。Typescript:`Array<string> \| null \| undefined` | N
1414
type | String | base | options: base/multiple。Typescript:`TypeEnum ` `type TypeEnum = 'base' \| 'multiple'`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/color-picker/type.ts) | N
1515
value | String | - | color value。`v-model` and `v-model:value` is supported | N
1616
defaultValue | String | - | color value。uncontrolled property | N

0 commit comments

Comments
 (0)