diff --git a/examples/color-picker/color-picker.md b/examples/color-picker/color-picker.md index 946f24ad6..c4fa00acd 100644 --- a/examples/color-picker/color-picker.md +++ b/examples/color-picker/color-picker.md @@ -5,20 +5,28 @@ 名称 | 类型 | 默认值 | 说明 | 必传 -- | -- | -- | -- | -- +closeBtn | String / Boolean / Slot / Function | true | 关闭按钮,值为 `true` 显示默认关闭按钮;值为 `false` 或 `undefined` 则不显示关闭按钮;值类型为函数,则表示自定义关闭按钮。TS 类型:`string | boolean | TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N +colorModes | Array | ()=> ['monochrome', 'linear-gradient'] | 颜色模式选择。同时支持单色和渐变两种模式,可仅使用单色或者渐变其中一种模式,也可以同时使用。`monochrome` 表示单色,`linear-gradient` 表示渐变色。TS 类型:`Array<'monochrome' | 'linear-gradient'>` | N disabled | Boolean | false | 是否禁用组件 | N enableAlpha | Boolean | false | 是否开启透明通道 | N -format | String | RGB | 格式化色值。`enableAlpha` 为真时,`RGBA/HSLA/HSVA/HEX8` 等值有效。可选项:RGB/RGBA/HSL/HSLA/HSB/HSV/HSVA/HEX/HEX8/CMYK/CSS | N -multiple | Boolean | false | 是否允许选中多个颜色 | N -popupProps | Object | - | 透传 Popup 组件全部属性,如 `placement` `overlayStyle` `overlayClassName` 等。TS 类型:`PopupProps`,[Popup API Documents](./popup?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/color-picker/type.ts) | N -swatchColors | Array | - | 颜色样例。TS 类型:`Array` | N +format | String | RGB | 格式化色值。`enableAlpha` 为真时,`RGBA/HSLA/HSVA` 等值有效。可选项:RGB/RGBA/HSL/HSLA/HSB/HSV/HSVA/HEX/CMYK/CSS | N +inputProps | Object | - | 透传 Input 输入框组件全部属性。TS 类型:`InputProps`,[Input API Documents](./input?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/color-picker/type.ts) | N +multiple | Boolean | false | 【开发中】是否允许选中多个颜色 | N +popupProps | Object | - | 透传 Popup 组件全部属性,如 `placement` `overlayStyle` `overlayClassName` `trigger`等。TS 类型:`PopupProps`,[Popup API Documents](./popup?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/color-picker/type.ts) | N +recentColors | Array | [] | 最近使用的颜色。值为 [] 表示以组件内部的“最近使用颜色”为准,值长度大于 0 则以该值为准显示“最近使用颜色”。值为 null 则完全不显示“最近使用颜色”。支持语法糖 `.sync`。TS 类型:`boolean | Array` | N +defaultRecentColors | Array | [] | 最近使用的颜色。值为 [] 表示以组件内部的“最近使用颜色”为准,值长度大于 0 则以该值为准显示“最近使用颜色”。值为 null 则完全不显示“最近使用颜色”。非受控属性。TS 类型:`boolean | Array` | N +selectInputProps | Object | - | 透传 SelectInputProps 筛选器输入框组件全部属性。TS 类型:`SelectInputProps`,[SelectInput API Documents](./select-input?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/color-picker/type.ts) | N +swatchColors | Array | - | 系统预设的颜色样例,值为 `null` 或 `[]` 则不显示系统色,值为 `undefined` 会显示组件内置的系统默认色。TS 类型:`Array` | N value | String | - | 色值。支持语法糖 `v-model` | N defaultValue | String | - | 色值。非受控属性 | N -onChange | Function | | TS 类型:`(value: string, context: { colors: string[]; trigger: ColorPickerChangeTrigger }) => void`
选中的色值发生变化时触发,第一个参数 `value` 表示新色值,`context.colors` 表示当前调色板的所有色值,`context.trigger` 表示触发颜色变化的来源。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/color-picker/type.ts)。
`type ColorPickerChangeTrigger = 'palette' | 'input'`
| N -onPaletteChange | Function | | TS 类型:`(context: { colors: string[] }) => void`
调色板变化时触发,当前色板的色值 | N +onChange | Function | | TS 类型:`(value: string, context: { color: ColorObject; trigger: ColorPickerChangeTrigger }) => void`
选中的色值发生变化时触发,第一个参数 `value` 表示新色值,`context.color` 表示当前调色板控制器的色值,`context.trigger` 表示触发颜色变化的来源。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/color-picker/type.ts)。
`type ColorPickerChangeTrigger = 'palette-saturation-brightness' | 'palette-saturation' | 'palette-brightness' | 'palette-hue-bar' | 'palette-alpha-bar' | 'input'`
| N +onPaletteBarChange | Function | | TS 类型:`(context: { color: ColorObject }) => void`
调色板控制器的值变化时触发,`context.color` 指调色板控制器的值。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/color-picker/type.ts)。
`interface ColorObject { alpha: number; css: string; hex: string; hex8: string; hsl: string; hsla: string; hsv: string; hsva: string; rgb: string; rgba: string; saturation: number; value: number; isGradient: boolean; linearGradient?: string; }`
| N +onRecentColorsChange | Function | | TS 类型:`(value: Array) => void`
最近使用颜色发生变化时触发 | N ### ColorPicker Events 名称 | 参数 | 描述 -- | -- | -- -change | `(value: string, context: { colors: string[]; trigger: ColorPickerChangeTrigger })` | 选中的色值发生变化时触发,第一个参数 `value` 表示新色值,`context.colors` 表示当前调色板的所有色值,`context.trigger` 表示触发颜色变化的来源。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/color-picker/type.ts)。
`type ColorPickerChangeTrigger = 'palette' | 'input'`
-palette-change | `(context: { colors: string[] })` | 调色板变化时触发,当前色板的色值 +change | `(value: string, context: { color: ColorObject; trigger: ColorPickerChangeTrigger })` | 选中的色值发生变化时触发,第一个参数 `value` 表示新色值,`context.color` 表示当前调色板控制器的色值,`context.trigger` 表示触发颜色变化的来源。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/color-picker/type.ts)。
`type ColorPickerChangeTrigger = 'palette-saturation-brightness' | 'palette-saturation' | 'palette-brightness' | 'palette-hue-bar' | 'palette-alpha-bar' | 'input'`
+palette-bar-change | `(context: { color: ColorObject })` | 调色板控制器的值变化时触发,`context.color` 指调色板控制器的值。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/color-picker/type.ts)。
`interface ColorObject { alpha: number; css: string; hex: string; hex8: string; hsl: string; hsla: string; hsv: string; hsva: string; rgb: string; rgba: string; saturation: number; value: number; isGradient: boolean; linearGradient?: string; }`
+recent-colors-change | `(value: Array)` | 最近使用颜色发生变化时触发 diff --git a/examples/color-picker/demos/color-mode.vue b/examples/color-picker/demos/color-mode.vue new file mode 100644 index 000000000..b5d9c61ca --- /dev/null +++ b/examples/color-picker/demos/color-mode.vue @@ -0,0 +1,40 @@ + + + + diff --git a/examples/color-picker/demos/enable-alpha.vue b/examples/color-picker/demos/enable-alpha.vue new file mode 100644 index 000000000..e77be5567 --- /dev/null +++ b/examples/color-picker/demos/enable-alpha.vue @@ -0,0 +1,19 @@ + + diff --git a/examples/color-picker/demos/panel.vue b/examples/color-picker/demos/panel.vue new file mode 100644 index 000000000..17d8b1d61 --- /dev/null +++ b/examples/color-picker/demos/panel.vue @@ -0,0 +1,30 @@ + + diff --git a/examples/color-picker/demos/recent-color.vue b/examples/color-picker/demos/recent-color.vue new file mode 100644 index 000000000..7c0313ddf --- /dev/null +++ b/examples/color-picker/demos/recent-color.vue @@ -0,0 +1,41 @@ + + + diff --git a/examples/color-picker/demos/status-disabled.vue b/examples/color-picker/demos/status-disabled.vue new file mode 100644 index 000000000..9e9d92140 --- /dev/null +++ b/examples/color-picker/demos/status-disabled.vue @@ -0,0 +1,14 @@ + + diff --git a/examples/color-picker/demos/status-readonly.vue b/examples/color-picker/demos/status-readonly.vue new file mode 100644 index 000000000..d4aff3bfa --- /dev/null +++ b/examples/color-picker/demos/status-readonly.vue @@ -0,0 +1,14 @@ + + diff --git a/examples/color-picker/demos/swatch-color.vue b/examples/color-picker/demos/swatch-color.vue new file mode 100644 index 000000000..02d19ae10 --- /dev/null +++ b/examples/color-picker/demos/swatch-color.vue @@ -0,0 +1,31 @@ + + + + diff --git a/examples/color-picker/demos/trigger.vue b/examples/color-picker/demos/trigger.vue new file mode 100644 index 000000000..3840affdd --- /dev/null +++ b/examples/color-picker/demos/trigger.vue @@ -0,0 +1,14 @@ + + diff --git a/examples/color-picker/usage/props.json b/examples/color-picker/usage/props.json new file mode 100644 index 000000000..88f0762b5 --- /dev/null +++ b/examples/color-picker/usage/props.json @@ -0,0 +1,16 @@ +[ + + { + "name": "enableAlpha", + "type": "Boolean", + "defaultValue": false, + "options": [] + }, + + { + "name": "disabled", + "type": "Boolean", + "defaultValue": false, + "options": [] + } +] \ No newline at end of file diff --git a/examples/dialog/demos/custom/bottom.vue b/examples/dialog/demos/custom/bottom.vue index f1b8ea734..4f41a9082 100644 --- a/examples/dialog/demos/custom/bottom.vue +++ b/examples/dialog/demos/custom/bottom.vue @@ -1,6 +1,7 @@