x-next 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI_USAGE.md +2 -2
- package/CHANGELOG.md +36 -0
- package/dist/_utils/color.d.ts +53 -0
- package/dist/components/color-picker/ColorPicker.d.ts +239 -0
- package/dist/components/color-picker/gradient-slider.d.ts +52 -0
- package/dist/components/color-picker/index.d.ts +238 -0
- package/dist/components/color-picker/panel.d.ts +721 -0
- package/dist/components/color-picker/sv-panel.d.ts +48 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +3 -3
- package/dist/components/date-picker/index.d.ts +6 -6
- package/dist/components/dropdown/Dropdown.vue.d.ts +34 -4
- package/dist/components/dropdown/DropdownButton.vue.d.ts +35 -5
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +34 -4
- package/dist/components/dropdown/dropdown-panel.vue.d.ts +30 -0
- package/dist/components/dropdown/index.d.ts +209 -29
- package/dist/components/form/FormItem.vue.d.ts +3 -3
- package/dist/components/form/form-item-label.vue.d.ts +3 -3
- package/dist/components/form/index.d.ts +6 -6
- package/dist/components/form-select/Select.d.ts +3 -3
- package/dist/components/form-select/SelectDropdown.vue.d.ts +30 -0
- package/dist/components/form-select/index.d.ts +66 -6
- package/dist/components/form-slider/Slider.vue.d.ts +3 -3
- package/dist/components/form-slider/index.d.ts +6 -6
- package/dist/components/form-slider/slider-button.vue.d.ts +3 -3
- package/dist/components/heatmap/Heatmap.d.ts +311 -0
- package/dist/components/heatmap/helpers/matrix.d.ts +58 -0
- package/dist/components/heatmap/index.d.ts +372 -0
- package/dist/components/heatmap/interface.d.ts +57 -0
- package/dist/components/image/Image.vue.d.ts +3 -3
- package/dist/components/image/ImagePreview.vue.d.ts +3 -3
- package/dist/components/image/ImagePreviewAction.d.ts +3 -3
- package/dist/components/image/ImagePreviewGroup.vue.d.ts +3 -3
- package/dist/components/image/index.d.ts +24 -24
- package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
- package/dist/components/index.d.ts +2 -0
- package/dist/components/menu/sub-menu-pop.vue.d.ts +3 -3
- package/dist/components/network/Network.vue.d.ts +1 -1
- package/dist/components/network/index.d.ts +3 -3
- package/dist/components/network/utils.d.ts +2 -0
- package/dist/components/pagination/page-item-ellipsis.vue.d.ts +9 -0
- package/dist/components/pagination/page-jumper.vue.d.ts +6 -0
- package/dist/components/pagination/page-options.vue.d.ts +6 -6
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popup/Popup.d.ts +1 -1
- package/dist/components/popup/index.d.ts +3 -3
- package/dist/components/skeleton/SkeletonShape.vue.d.ts +3 -3
- package/dist/components/skeleton/index.d.ts +6 -6
- package/dist/components/spin/Spin.d.ts +38 -0
- package/dist/components/spin/index.d.ts +30 -0
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/index.d.ts +3 -3
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/time-picker/TimePicker.vue.d.ts +3 -3
- package/dist/components/time-picker/index.d.ts +6 -6
- package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +3 -3
- package/dist/components/trigger/Trigger.d.ts +1 -1
- package/dist/components/trigger/index.d.ts +3 -3
- package/dist/components/watermark/Watermark.d.ts +1 -1
- package/dist/components/watermark/index.d.ts +3 -3
- package/dist/es/_styles/palette-aliases.js +8 -0
- package/dist/es/_utils/color.js +73 -0
- package/dist/es/components/button/Button.js +2 -2
- package/dist/es/components/color-picker/ColorPicker.js +239 -0
- package/dist/es/components/color-picker/gradient-slider.js +79 -0
- package/dist/es/components/color-picker/index.js +8 -0
- package/dist/es/components/color-picker/panel.js +307 -0
- package/dist/es/components/color-picker/sv-panel.js +99 -0
- package/dist/es/components/dropdown/dropdown-panel.vue.js +17 -17
- package/dist/es/components/form-input/Input.js +7 -7
- package/dist/es/components/form-input/InputPassword.vue2.js +2 -2
- package/dist/es/components/form-input/InputSearch.js +2 -2
- package/dist/es/components/form-input-number/InputNumber.js +12 -12
- package/dist/es/components/heatmap/Heatmap.js +334 -0
- package/dist/es/components/heatmap/helpers/matrix.js +106 -0
- package/dist/es/components/heatmap/index.js +8 -0
- package/dist/es/components/index.js +118 -114
- package/dist/es/components/menu/sub-menu-pop.vue2.js +12 -12
- package/dist/es/components/network/Network.vue2.js +72 -72
- package/dist/es/components/network/utils.js +44 -35
- package/dist/es/components/pagination/Pagination.js +113 -104
- package/dist/es/components/pagination/page-item-ellipsis.vue.js +13 -12
- package/dist/es/components/pagination/page-item-ellipsis.vue2.js +19 -15
- package/dist/es/components/pagination/page-jumper.vue.js +13 -12
- package/dist/es/components/pagination/page-jumper.vue2.js +7 -4
- package/dist/es/components/pagination/page-options.vue.js +4 -3
- package/dist/es/components/pagination/page-options.vue2.js +17 -15
- package/dist/es/components/skeleton/Skeleton.vue.js +11 -9
- package/dist/es/components/skeleton/SkeletonLine.vue.js +9 -8
- package/dist/es/components/skeleton/SkeletonShape.vue.js +8 -7
- package/dist/es/components/spin/Spin.js +124 -60
- package/dist/es/components/table/Table.js +3 -1
- package/dist/es/components/trigger/Trigger.js +19 -19
- package/dist/es/icons/_self/empty-better.js +25 -8
- package/dist/es/index.js +162 -158
- package/dist/es/locale/en-US.js +17 -1
- package/dist/es/locale/zh-CN.js +17 -1
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +28 -0
- package/dist/style/base.css +1 -1
- package/dist/style/button.css +1 -1
- package/dist/style/color-picker.css +1 -0
- package/dist/style/color-picker.js +2 -0
- package/dist/style/date-picker.css +1 -1
- package/dist/style/empty.css +1 -1
- package/dist/style/form-checkbox.css +1 -1
- package/dist/style/form-input-tag.css +1 -1
- package/dist/style/form-input.css +1 -1
- package/dist/style/form-radio.css +1 -1
- package/dist/style/form-textarea.css +1 -1
- package/dist/style/form.css +1 -1
- package/dist/style/heatmap.css +1 -0
- package/dist/style/heatmap.js +2 -0
- package/dist/style/image.css +1 -1
- package/dist/style/menu.css +1 -1
- package/dist/style/pagination.css +1 -1
- package/dist/style/skeleton.css +1 -1
- package/dist/style/spin.css +1 -1
- package/dist/style/steps.css +1 -1
- package/dist/style/table.css +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
- package/volar.d.ts +2 -0
package/AI_USAGE.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<!-- Generated by pnpm generate:ai-usage. Edit src/docs/guide/ai-usage-recipes.md and script/ai-usage/manifest.js. -->
|
|
2
2
|
# x-next AI 使用手册
|
|
3
3
|
|
|
4
|
-
适用版本:**x-next@1.
|
|
4
|
+
适用版本:**x-next@1.6.0**。Vue:`^3.5.0`;Node:`>=20.19.0`。
|
|
5
5
|
|
|
6
|
-
来源指纹(精选示例、映射、版本与公开类型声明):`
|
|
6
|
+
来源指纹(精选示例、映射、版本与公开类型声明):`8b4e92e3477781a27ff136cbc59a1f8508ba69d45a4f5539daeee1de7a5d9570`。
|
|
7
7
|
|
|
8
8
|
先按业务需要选择组件,不要求全部迁移。本手册限定在用户确认的 22 个组件及必要的同族子组件,未覆盖的导出不表示已完成业务验收。
|
|
9
9
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [1.6.0] - 2026-10-02
|
|
6
|
+
|
|
7
|
+
### 新增
|
|
8
|
+
|
|
9
|
+
- **Heatmap 热力图**:以「周 × 星期」网格展示按天聚合的数值分布,支持自然年与自定义跨度、五档色阶、尺寸与首日配置、月/周标签与图例开关、格子点击事件与自定义提示。整块网格只挂一个 `mousemove` 做事件委托 + 单个浮层节点,避免 371 个格子各挂一个 Trigger 带来的开销。
|
|
10
|
+
- **ColorPicker 颜色选择器**:SV 取色面板 + 色相条 + 透明度条 + hex/rgb/hsl 三格式输入 + 预设色板 + 确认/清除。受控与非受控、禁用与尺寸、表单校验联动、自定义触发器均支持;Esc 关闭并把焦点归还触发器。
|
|
11
|
+
- 新增 `_utils/color.ts` 颜色工具(含 alpha 的 hex/rgb/hsl 解析、HSV 双向换算、格式化与混色),附 44 项单测。
|
|
12
|
+
- **Spin `tipShimmer`**:提示文字扫光效果。新增 `--x-spin-tip-shimmer-color-highlight` / `--x-spin-tip-shimmer-duration` 两个 token;用 `background-clip: text` 实现,并包在 `@supports` 中兜底(不支持裁切时文字保持原色,不会变成空白)。
|
|
13
|
+
- **Spin `delay`**:延迟显示加载态,避免快速请求闪一下遮罩。语义与 AntDV 有一处刻意差异——只延迟出现、结束时立即收起,不会让已加载完的内容再被多盖一段时间。
|
|
14
|
+
- 修复 `Empty` 的插画色阶后新增 `--x-empty-illustration-*` 四个 token,使默认插画能随亮/暗主题换色。
|
|
15
|
+
|
|
16
|
+
### 修复
|
|
17
|
+
|
|
18
|
+
- **全库行高依赖宿主(系统性缺陷)**:组件文案未显式声明行高时会继承宿主(如 `body`)的行高,导致同一组件在不同项目中高度与文字位置不一致。实测宿主行高设为 3 时按钮内容盒涨到 42px、设为 1 时只有 14px。已为 Steps 描述、Pagination 跳转区、Image footer、Input/Select 前后缀、Input 字数统计、Radio/Checkbox、InputTag 输入框、Form 说明文字等补齐行高声明。
|
|
19
|
+
- **Input 字数统计类名漂移**:`.x-input-word-limit`(单横线)与运行时类名 `x-input--word-limit`(双横线)不匹配,整条规则从未生效——该元素字号一直是宿主默认值而非规定的 12px。
|
|
20
|
+
- **InputTag 输入框字号**:原生 `<input>` 不继承父级字体,此前一直渲染在 UA 默认的 `13.3333px`:既与标签字号(12/14px)不一致,也让内部测宽元素 `.x-input-tag--mirror` 的测量失准。现已显式 `font-size: inherit`。
|
|
21
|
+
- **Radio / Checkbox 的 `line-height: unset`**:该写法会主动丢弃行高、完全继承宿主,比不声明更糟;改为显式声明。
|
|
22
|
+
- **Table / Dropdown 空态来源标识**:两者渲染裸 `<Empty />`,导致 `ConfigProvider` 的 `#empty` 插槽回调 `component` 恒为 `'empty'`,文档承诺的「按来源区分空态」在这两个组件里失效。
|
|
23
|
+
- **Spin 容器模式的无障碍语义**:`loading=false` 时仍保留 `aria-label="加载中"`,屏幕阅读器会把已加载完成的区域播报为加载中。
|
|
24
|
+
- **Spin 默认图标旋转叠加**:默认图标同时叠加了 Icon 的 `spin` 层与图标自带的旋转动画,两层周期与缓动都不同,合成转速在 1~2 圈/秒之间波动,观感又快又乱。现只保留图标自带旋转;自定义 `icon` 插槽仍注入 `spin`。
|
|
25
|
+
- **Spin 点状动画与文案扫光的动效降级**:新增 `prefers-reduced-motion` 适配,扫光在降级时还原成纯色(而非停在某处留下一块亮斑)。
|
|
26
|
+
- **Network 字段缺失被误判为「较差」**:`navigator.connection` 存在但字段不全时(部分浏览器只给 `effectiveType`),旧逻辑把缺失值兜底成 `downlink=0 / rtt=Infinity` 再走阈值判断,结果一律判成 `poor`,比完全不支持该 API 还悲观,且与文档描述相反。现在字段不足回落为「检测中」,`4g` 直接判良好。
|
|
27
|
+
- **Network 其它缺陷**:`connection.onchange` 降级会顶掉使用方已注册的处理器(现改为转发并在卸载时归还);轮询无变化仍反复派发 `change`(现按语义字段去重,但仍保留首次状态派发);`refresh()` 可能返回 `undefined`(现始终返回 `Promise<NetworkStatus>`)。
|
|
28
|
+
- **Pagination `total` 非有限值导致死循环**:`total` 传 `Infinity`(「总数未知」)时会渲染出文案为 `Infinity` 的页码;若 `current` 同时非有限,页列表里的 `for (let i = Infinity; i <= Infinity; i++)` 条件恒为真(`Infinity++ === Infinity`),主线程死循环、页面卡死。现对 `total` / `current` 做归一化。
|
|
29
|
+
- **Pagination 无障碍与边界**:根节点补 `role="navigation"` 与可访问名称;跳转输入框补无障碍名称;省略号在禁用态下不再可聚焦、不再响应键盘;`pageSize` 不在 `pageSizeOptions` 中时不再显示空 placeholder;`pageSizeProps` 不再能覆盖 `disabled` / `modelValue`。
|
|
30
|
+
- **Skeleton 无障碍**:根节点补 `aria-busy`,装饰性的 `SkeletonLine` / `SkeletonShape` 补 `aria-hidden`(此前空 `<li>` 会被读屏念成一串无内容的列表项)。
|
|
31
|
+
- **Skeleton 动画时长**硬编码 `1.5s` 提到 token;`SkeletonShape.size` 类型收窄。
|
|
32
|
+
- **Empty 默认插画**:四个灰阶是硬编码浅色字面量,暗色主题下整块发白;现改为 `--x-empty-illustration-*` token,图形本身不变,亮色取值与原字面量逐位一致。
|
|
33
|
+
- **forced-colors 适配**:补齐分页当前页描边与骨架屏轮廓,避免背景被强制成 Canvas 后这些状态不可见。
|
|
34
|
+
- **Steps 描述行高**、**TimePicker / DatePicker 面板宽度自适应**等文档与样式细节。
|
|
35
|
+
|
|
36
|
+
### 测试
|
|
37
|
+
|
|
38
|
+
- 新增 Heatmap / ColorPicker / 颜色工具共 100+ 项单测。
|
|
39
|
+
- 新增 Empty 插画单色契约、Table/Dropdown 空态来源、Spin `delay` 与 `tipShimmer`、Spin `inert` 键盘兜底(显式移除 `inert` 原型属性以覆盖真实降级路径)、Network 字段缺失与 `onchange` 转发、Pagination 非有限 `total` 等回归测试,测试总数 2034。
|
|
40
|
+
|
|
5
41
|
## [1.5.0] - 2026-10-02
|
|
6
42
|
|
|
7
43
|
### 修复
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { hslToRgb, rgbToHsl } from './palette';
|
|
2
|
+
export { hslToRgb, rgbToHsl };
|
|
3
|
+
/**
|
|
4
|
+
* 带透明度的颜色工具。
|
|
5
|
+
*
|
|
6
|
+
* 与 `palette.ts` 的分工:那里的 `parseColor` 服务于主题色阶生成,语义是
|
|
7
|
+
* 「丢弃 alpha、只取不透明 RGB」(该行为被色阶测试锁定)。颜色选择器需要
|
|
8
|
+
* 保留 alpha、需要 HSV(取色面板的饱和度/明度轴)以及多格式输出,
|
|
9
|
+
* 因此单独放在这里,不修改 palette.ts 的既有语义。
|
|
10
|
+
*/
|
|
11
|
+
/** 通道 0-255,alpha 0-1 */
|
|
12
|
+
export interface RGBA {
|
|
13
|
+
r: number;
|
|
14
|
+
g: number;
|
|
15
|
+
b: number;
|
|
16
|
+
a: number;
|
|
17
|
+
}
|
|
18
|
+
/** h 0-360,s/v 0-100 */
|
|
19
|
+
export interface HSV {
|
|
20
|
+
h: number;
|
|
21
|
+
s: number;
|
|
22
|
+
v: number;
|
|
23
|
+
}
|
|
24
|
+
export type ColorFormat = 'hex' | 'rgb' | 'hsl';
|
|
25
|
+
/**
|
|
26
|
+
* 解析颜色字符串为 RGBA。
|
|
27
|
+
*
|
|
28
|
+
* 支持 `#rgb` / `#rgba` / `#rrggbb` / `#rrggbbaa`、`rgb()` / `rgba()`、
|
|
29
|
+
* `hsl()` / `hsla()`(通道可用百分比),逗号与空格两种语法均可。
|
|
30
|
+
* 无法解析时返回 null。
|
|
31
|
+
*/
|
|
32
|
+
export declare const parseColorAlpha: (input: string) => RGBA | null;
|
|
33
|
+
/** 解析失败时回退到给定颜色,便于受控输入容错 */
|
|
34
|
+
export declare const parseColorAlphaOr: (input: string, fallback: RGBA) => RGBA;
|
|
35
|
+
export declare const rgbToHsv: ({ r, g, b }: Pick<RGBA, "r" | "g" | "b">) => HSV;
|
|
36
|
+
export declare const hsvToRgb: ({ h, s, v }: HSV) => [number, number, number];
|
|
37
|
+
export declare const rgbaToHex: ({ r, g, b, a }: RGBA, showAlpha?: boolean) => string;
|
|
38
|
+
/** alpha 输入框展示用:整数百分比 */
|
|
39
|
+
export declare const formatAlphaPercent: (a: number) => number;
|
|
40
|
+
/**
|
|
41
|
+
* 按目标格式输出颜色字符串。
|
|
42
|
+
* `showAlpha` 为 false 时忽略 alpha;为 true 但 alpha 为 1 时省略 alpha 通道。
|
|
43
|
+
*/
|
|
44
|
+
export declare const formatColor: (rgba: RGBA, format: ColorFormat, showAlpha?: boolean) => string;
|
|
45
|
+
/**
|
|
46
|
+
* 输出 `rgba(r, g, b, a)`,用于渐变端点等需要精确 alpha 的场景。
|
|
47
|
+
* alpha 滑块的两端分别是「完全透明」与「当前色」,都靠它构造。
|
|
48
|
+
*/
|
|
49
|
+
export declare const toRgbaString: ({ r, g, b, a }: RGBA) => string;
|
|
50
|
+
/** alpha 滑轨的渐变终点色:始终输出不透明的 `rgba()` */
|
|
51
|
+
export declare const toAlphaSliderColor: ({ r, g, b }: RGBA) => string;
|
|
52
|
+
/** 十六进制输入框的即时校验(供输入过程的分支判断,允许带 alpha) */
|
|
53
|
+
export declare const isHexColor: (input: string) => boolean;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { PropType, SlotsType } from 'vue';
|
|
2
|
+
import { ColorFormat } from '../../_utils/color';
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
/**
|
|
5
|
+
* @zh 颜色值,支持 hex / rgb / hsl(含 alpha)
|
|
6
|
+
* @en Color value, supports hex / rgb / hsl with alpha
|
|
7
|
+
* @vModel
|
|
8
|
+
*/
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* @zh 非受控初值
|
|
15
|
+
* @en Default value for uncontrolled mode
|
|
16
|
+
*/
|
|
17
|
+
defaultValue: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* @zh 面板是否可见
|
|
23
|
+
* @en Whether the panel is visible
|
|
24
|
+
* @vModel
|
|
25
|
+
*/
|
|
26
|
+
show: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: undefined;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @zh 面板默认是否可见
|
|
32
|
+
* @en Whether the panel is visible by default
|
|
33
|
+
*/
|
|
34
|
+
defaultShow: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @zh 可选的颜色格式
|
|
40
|
+
* @en Available color formats
|
|
41
|
+
* @defaultValue ['hex', 'rgb', 'hsl']
|
|
42
|
+
*/
|
|
43
|
+
modes: {
|
|
44
|
+
type: PropType<ColorFormat[]>;
|
|
45
|
+
default: () => ColorFormat[];
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* @zh 是否启用透明度
|
|
49
|
+
* @en Whether alpha is enabled
|
|
50
|
+
* @defaultValue true
|
|
51
|
+
*/
|
|
52
|
+
showAlpha: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* @zh 预设色块
|
|
58
|
+
* @en Preset swatches
|
|
59
|
+
*/
|
|
60
|
+
swatches: {
|
|
61
|
+
type: PropType<string[]>;
|
|
62
|
+
default: () => never[];
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* @zh 是否展示确认按钮
|
|
66
|
+
* @en Whether to show the confirm button
|
|
67
|
+
* @defaultValue true
|
|
68
|
+
*/
|
|
69
|
+
showConfirm: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* @zh 是否展示清除按钮
|
|
75
|
+
* @en Whether to show the clear button
|
|
76
|
+
* @defaultValue true
|
|
77
|
+
*/
|
|
78
|
+
showClear: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
default: boolean;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* @zh 是否禁用
|
|
84
|
+
* @en Whether the picker is disabled
|
|
85
|
+
*/
|
|
86
|
+
disabled: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
default: boolean;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* @zh 尺寸
|
|
92
|
+
* @en Size
|
|
93
|
+
* @values 'mini', 'small', 'medium', 'large'
|
|
94
|
+
*/
|
|
95
|
+
size: {
|
|
96
|
+
type: PropType<"mini" | "small" | "medium" | "large">;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* @zh 面板挂载容器
|
|
100
|
+
* @en Mount container for the panel
|
|
101
|
+
*/
|
|
102
|
+
popupContainer: {
|
|
103
|
+
type: PropType<string | HTMLElement>;
|
|
104
|
+
};
|
|
105
|
+
}>, () => VNode, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
106
|
+
'update:modelValue': (_value: string, _ev?: Event) => true;
|
|
107
|
+
change: (_value: string, _ev?: Event) => true;
|
|
108
|
+
'update:show': (_visible: boolean) => true;
|
|
109
|
+
showChange: (_visible: boolean) => true;
|
|
110
|
+
confirm: (_value: string) => true;
|
|
111
|
+
clear: () => true;
|
|
112
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
113
|
+
/**
|
|
114
|
+
* @zh 颜色值,支持 hex / rgb / hsl(含 alpha)
|
|
115
|
+
* @en Color value, supports hex / rgb / hsl with alpha
|
|
116
|
+
* @vModel
|
|
117
|
+
*/
|
|
118
|
+
modelValue: {
|
|
119
|
+
type: StringConstructor;
|
|
120
|
+
default: undefined;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* @zh 非受控初值
|
|
124
|
+
* @en Default value for uncontrolled mode
|
|
125
|
+
*/
|
|
126
|
+
defaultValue: {
|
|
127
|
+
type: StringConstructor;
|
|
128
|
+
default: undefined;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* @zh 面板是否可见
|
|
132
|
+
* @en Whether the panel is visible
|
|
133
|
+
* @vModel
|
|
134
|
+
*/
|
|
135
|
+
show: {
|
|
136
|
+
type: BooleanConstructor;
|
|
137
|
+
default: undefined;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* @zh 面板默认是否可见
|
|
141
|
+
* @en Whether the panel is visible by default
|
|
142
|
+
*/
|
|
143
|
+
defaultShow: {
|
|
144
|
+
type: BooleanConstructor;
|
|
145
|
+
default: boolean;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* @zh 可选的颜色格式
|
|
149
|
+
* @en Available color formats
|
|
150
|
+
* @defaultValue ['hex', 'rgb', 'hsl']
|
|
151
|
+
*/
|
|
152
|
+
modes: {
|
|
153
|
+
type: PropType<ColorFormat[]>;
|
|
154
|
+
default: () => ColorFormat[];
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* @zh 是否启用透明度
|
|
158
|
+
* @en Whether alpha is enabled
|
|
159
|
+
* @defaultValue true
|
|
160
|
+
*/
|
|
161
|
+
showAlpha: {
|
|
162
|
+
type: BooleanConstructor;
|
|
163
|
+
default: boolean;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* @zh 预设色块
|
|
167
|
+
* @en Preset swatches
|
|
168
|
+
*/
|
|
169
|
+
swatches: {
|
|
170
|
+
type: PropType<string[]>;
|
|
171
|
+
default: () => never[];
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* @zh 是否展示确认按钮
|
|
175
|
+
* @en Whether to show the confirm button
|
|
176
|
+
* @defaultValue true
|
|
177
|
+
*/
|
|
178
|
+
showConfirm: {
|
|
179
|
+
type: BooleanConstructor;
|
|
180
|
+
default: boolean;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* @zh 是否展示清除按钮
|
|
184
|
+
* @en Whether to show the clear button
|
|
185
|
+
* @defaultValue true
|
|
186
|
+
*/
|
|
187
|
+
showClear: {
|
|
188
|
+
type: BooleanConstructor;
|
|
189
|
+
default: boolean;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* @zh 是否禁用
|
|
193
|
+
* @en Whether the picker is disabled
|
|
194
|
+
*/
|
|
195
|
+
disabled: {
|
|
196
|
+
type: BooleanConstructor;
|
|
197
|
+
default: boolean;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* @zh 尺寸
|
|
201
|
+
* @en Size
|
|
202
|
+
* @values 'mini', 'small', 'medium', 'large'
|
|
203
|
+
*/
|
|
204
|
+
size: {
|
|
205
|
+
type: PropType<"mini" | "small" | "medium" | "large">;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* @zh 面板挂载容器
|
|
209
|
+
* @en Mount container for the panel
|
|
210
|
+
*/
|
|
211
|
+
popupContainer: {
|
|
212
|
+
type: PropType<string | HTMLElement>;
|
|
213
|
+
};
|
|
214
|
+
}>> & Readonly<{
|
|
215
|
+
onClear?: (() => any) | undefined;
|
|
216
|
+
onChange?: ((_value: string, _ev?: Event | undefined) => any) | undefined;
|
|
217
|
+
onConfirm?: ((_value: string) => any) | undefined;
|
|
218
|
+
"onUpdate:modelValue"?: ((_value: string, _ev?: Event | undefined) => any) | undefined;
|
|
219
|
+
"onUpdate:show"?: ((_visible: boolean) => any) | undefined;
|
|
220
|
+
onShowChange?: ((_visible: boolean) => any) | undefined;
|
|
221
|
+
}>, {
|
|
222
|
+
disabled: boolean;
|
|
223
|
+
defaultValue: string;
|
|
224
|
+
show: boolean;
|
|
225
|
+
modelValue: string;
|
|
226
|
+
modes: ColorFormat[];
|
|
227
|
+
showAlpha: boolean;
|
|
228
|
+
swatches: string[];
|
|
229
|
+
showConfirm: boolean;
|
|
230
|
+
showClear: boolean;
|
|
231
|
+
defaultShow: boolean;
|
|
232
|
+
}, SlotsType<{
|
|
233
|
+
default?: () => unknown;
|
|
234
|
+
trigger?: (props: {
|
|
235
|
+
value: string;
|
|
236
|
+
visible: boolean;
|
|
237
|
+
}) => unknown;
|
|
238
|
+
}>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
239
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 通用渐变滑轨,色相条与透明度条共用。
|
|
3
|
+
*
|
|
4
|
+
* 差异只在背景:色相条是固定的色相环渐变,透明度条是「透明 → 当前色」。
|
|
5
|
+
* 通过 `background` prop 注入,组件本身不关心颜色语义。
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
8
|
+
/** 0-100 的位置百分比 */
|
|
9
|
+
value: {
|
|
10
|
+
type: NumberConstructor;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
/** 滑轨背景(CSS background 值) */
|
|
14
|
+
background: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
disabled: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
/** 无障碍名称,由父组件传入已本地化的文案 */
|
|
23
|
+
ariaLabel: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
};
|
|
26
|
+
}>, () => VNode, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
27
|
+
change: (_value: number) => true;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
29
|
+
/** 0-100 的位置百分比 */
|
|
30
|
+
value: {
|
|
31
|
+
type: NumberConstructor;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
/** 滑轨背景(CSS background 值) */
|
|
35
|
+
background: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
disabled: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
43
|
+
/** 无障碍名称,由父组件传入已本地化的文案 */
|
|
44
|
+
ariaLabel: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
};
|
|
47
|
+
}>> & Readonly<{
|
|
48
|
+
onChange?: ((_value: number) => any) | undefined;
|
|
49
|
+
}>, {
|
|
50
|
+
disabled: boolean;
|
|
51
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
52
|
+
export default _default;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
export declare const ColorPicker: {
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: undefined;
|
|
6
|
+
};
|
|
7
|
+
defaultValue: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: undefined;
|
|
10
|
+
};
|
|
11
|
+
show: {
|
|
12
|
+
type: BooleanConstructor;
|
|
13
|
+
default: undefined;
|
|
14
|
+
};
|
|
15
|
+
defaultShow: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
19
|
+
modes: {
|
|
20
|
+
type: import('vue').PropType<import('.').ColorFormat[]>;
|
|
21
|
+
default: () => import('.').ColorFormat[];
|
|
22
|
+
};
|
|
23
|
+
showAlpha: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
swatches: {
|
|
28
|
+
type: import('vue').PropType<string[]>;
|
|
29
|
+
default: () => never[];
|
|
30
|
+
};
|
|
31
|
+
showConfirm: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
35
|
+
showClear: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
39
|
+
disabled: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
43
|
+
size: {
|
|
44
|
+
type: import('vue').PropType<"mini" | "small" | "medium" | "large">;
|
|
45
|
+
};
|
|
46
|
+
popupContainer: {
|
|
47
|
+
type: import('vue').PropType<string | HTMLElement>;
|
|
48
|
+
};
|
|
49
|
+
}>> & Readonly<{
|
|
50
|
+
onClear?: (() => any) | undefined;
|
|
51
|
+
onChange?: ((_value: string, _ev?: Event | undefined) => any) | undefined;
|
|
52
|
+
onConfirm?: ((_value: string) => any) | undefined;
|
|
53
|
+
"onUpdate:modelValue"?: ((_value: string, _ev?: Event | undefined) => any) | undefined;
|
|
54
|
+
"onUpdate:show"?: ((_visible: boolean) => any) | undefined;
|
|
55
|
+
onShowChange?: ((_visible: boolean) => any) | undefined;
|
|
56
|
+
}>, () => VNode, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
57
|
+
'update:modelValue': (_value: string, _ev?: Event) => true;
|
|
58
|
+
change: (_value: string, _ev?: Event) => true;
|
|
59
|
+
'update:show': (_visible: boolean) => true;
|
|
60
|
+
showChange: (_visible: boolean) => true;
|
|
61
|
+
confirm: (_value: string) => true;
|
|
62
|
+
clear: () => true;
|
|
63
|
+
}, import('vue').PublicProps, {
|
|
64
|
+
disabled: boolean;
|
|
65
|
+
defaultValue: string;
|
|
66
|
+
show: boolean;
|
|
67
|
+
modelValue: string;
|
|
68
|
+
modes: import('.').ColorFormat[];
|
|
69
|
+
showAlpha: boolean;
|
|
70
|
+
swatches: string[];
|
|
71
|
+
showConfirm: boolean;
|
|
72
|
+
showClear: boolean;
|
|
73
|
+
defaultShow: boolean;
|
|
74
|
+
}, true, {}, import('vue').SlotsType<{
|
|
75
|
+
default?: () => unknown;
|
|
76
|
+
trigger?: (props: {
|
|
77
|
+
value: string;
|
|
78
|
+
visible: boolean;
|
|
79
|
+
}) => unknown;
|
|
80
|
+
}>, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
81
|
+
P: {};
|
|
82
|
+
B: {};
|
|
83
|
+
D: {};
|
|
84
|
+
C: {};
|
|
85
|
+
M: {};
|
|
86
|
+
Defaults: {};
|
|
87
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
88
|
+
modelValue: {
|
|
89
|
+
type: StringConstructor;
|
|
90
|
+
default: undefined;
|
|
91
|
+
};
|
|
92
|
+
defaultValue: {
|
|
93
|
+
type: StringConstructor;
|
|
94
|
+
default: undefined;
|
|
95
|
+
};
|
|
96
|
+
show: {
|
|
97
|
+
type: BooleanConstructor;
|
|
98
|
+
default: undefined;
|
|
99
|
+
};
|
|
100
|
+
defaultShow: {
|
|
101
|
+
type: BooleanConstructor;
|
|
102
|
+
default: boolean;
|
|
103
|
+
};
|
|
104
|
+
modes: {
|
|
105
|
+
type: import('vue').PropType<import('.').ColorFormat[]>;
|
|
106
|
+
default: () => import('.').ColorFormat[];
|
|
107
|
+
};
|
|
108
|
+
showAlpha: {
|
|
109
|
+
type: BooleanConstructor;
|
|
110
|
+
default: boolean;
|
|
111
|
+
};
|
|
112
|
+
swatches: {
|
|
113
|
+
type: import('vue').PropType<string[]>;
|
|
114
|
+
default: () => never[];
|
|
115
|
+
};
|
|
116
|
+
showConfirm: {
|
|
117
|
+
type: BooleanConstructor;
|
|
118
|
+
default: boolean;
|
|
119
|
+
};
|
|
120
|
+
showClear: {
|
|
121
|
+
type: BooleanConstructor;
|
|
122
|
+
default: boolean;
|
|
123
|
+
};
|
|
124
|
+
disabled: {
|
|
125
|
+
type: BooleanConstructor;
|
|
126
|
+
default: boolean;
|
|
127
|
+
};
|
|
128
|
+
size: {
|
|
129
|
+
type: import('vue').PropType<"mini" | "small" | "medium" | "large">;
|
|
130
|
+
};
|
|
131
|
+
popupContainer: {
|
|
132
|
+
type: import('vue').PropType<string | HTMLElement>;
|
|
133
|
+
};
|
|
134
|
+
}>> & Readonly<{
|
|
135
|
+
onClear?: (() => any) | undefined;
|
|
136
|
+
onChange?: ((_value: string, _ev?: Event | undefined) => any) | undefined;
|
|
137
|
+
onConfirm?: ((_value: string) => any) | undefined;
|
|
138
|
+
"onUpdate:modelValue"?: ((_value: string, _ev?: Event | undefined) => any) | undefined;
|
|
139
|
+
"onUpdate:show"?: ((_visible: boolean) => any) | undefined;
|
|
140
|
+
onShowChange?: ((_visible: boolean) => any) | undefined;
|
|
141
|
+
}>, () => VNode, {}, {}, {}, {
|
|
142
|
+
disabled: boolean;
|
|
143
|
+
defaultValue: string;
|
|
144
|
+
show: boolean;
|
|
145
|
+
modelValue: string;
|
|
146
|
+
modes: import('.').ColorFormat[];
|
|
147
|
+
showAlpha: boolean;
|
|
148
|
+
swatches: string[];
|
|
149
|
+
showConfirm: boolean;
|
|
150
|
+
showClear: boolean;
|
|
151
|
+
defaultShow: boolean;
|
|
152
|
+
}>;
|
|
153
|
+
__isFragment?: never;
|
|
154
|
+
__isTeleport?: never;
|
|
155
|
+
__isSuspense?: never;
|
|
156
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
157
|
+
modelValue: {
|
|
158
|
+
type: StringConstructor;
|
|
159
|
+
default: undefined;
|
|
160
|
+
};
|
|
161
|
+
defaultValue: {
|
|
162
|
+
type: StringConstructor;
|
|
163
|
+
default: undefined;
|
|
164
|
+
};
|
|
165
|
+
show: {
|
|
166
|
+
type: BooleanConstructor;
|
|
167
|
+
default: undefined;
|
|
168
|
+
};
|
|
169
|
+
defaultShow: {
|
|
170
|
+
type: BooleanConstructor;
|
|
171
|
+
default: boolean;
|
|
172
|
+
};
|
|
173
|
+
modes: {
|
|
174
|
+
type: import('vue').PropType<import('.').ColorFormat[]>;
|
|
175
|
+
default: () => import('.').ColorFormat[];
|
|
176
|
+
};
|
|
177
|
+
showAlpha: {
|
|
178
|
+
type: BooleanConstructor;
|
|
179
|
+
default: boolean;
|
|
180
|
+
};
|
|
181
|
+
swatches: {
|
|
182
|
+
type: import('vue').PropType<string[]>;
|
|
183
|
+
default: () => never[];
|
|
184
|
+
};
|
|
185
|
+
showConfirm: {
|
|
186
|
+
type: BooleanConstructor;
|
|
187
|
+
default: boolean;
|
|
188
|
+
};
|
|
189
|
+
showClear: {
|
|
190
|
+
type: BooleanConstructor;
|
|
191
|
+
default: boolean;
|
|
192
|
+
};
|
|
193
|
+
disabled: {
|
|
194
|
+
type: BooleanConstructor;
|
|
195
|
+
default: boolean;
|
|
196
|
+
};
|
|
197
|
+
size: {
|
|
198
|
+
type: import('vue').PropType<"mini" | "small" | "medium" | "large">;
|
|
199
|
+
};
|
|
200
|
+
popupContainer: {
|
|
201
|
+
type: import('vue').PropType<string | HTMLElement>;
|
|
202
|
+
};
|
|
203
|
+
}>> & Readonly<{
|
|
204
|
+
onClear?: (() => any) | undefined;
|
|
205
|
+
onChange?: ((_value: string, _ev?: Event | undefined) => any) | undefined;
|
|
206
|
+
onConfirm?: ((_value: string) => any) | undefined;
|
|
207
|
+
"onUpdate:modelValue"?: ((_value: string, _ev?: Event | undefined) => any) | undefined;
|
|
208
|
+
"onUpdate:show"?: ((_visible: boolean) => any) | undefined;
|
|
209
|
+
onShowChange?: ((_visible: boolean) => any) | undefined;
|
|
210
|
+
}>, () => VNode, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
211
|
+
'update:modelValue': (_value: string, _ev?: Event) => true;
|
|
212
|
+
change: (_value: string, _ev?: Event) => true;
|
|
213
|
+
'update:show': (_visible: boolean) => true;
|
|
214
|
+
showChange: (_visible: boolean) => true;
|
|
215
|
+
confirm: (_value: string) => true;
|
|
216
|
+
clear: () => true;
|
|
217
|
+
}, string, {
|
|
218
|
+
disabled: boolean;
|
|
219
|
+
defaultValue: string;
|
|
220
|
+
show: boolean;
|
|
221
|
+
modelValue: string;
|
|
222
|
+
modes: import('.').ColorFormat[];
|
|
223
|
+
showAlpha: boolean;
|
|
224
|
+
swatches: string[];
|
|
225
|
+
showConfirm: boolean;
|
|
226
|
+
showClear: boolean;
|
|
227
|
+
defaultShow: boolean;
|
|
228
|
+
}, {}, string, import('vue').SlotsType<{
|
|
229
|
+
default?: () => unknown;
|
|
230
|
+
trigger?: (props: {
|
|
231
|
+
value: string;
|
|
232
|
+
visible: boolean;
|
|
233
|
+
}) => unknown;
|
|
234
|
+
}>, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
|
|
235
|
+
install(app: import('vue').App): void;
|
|
236
|
+
};
|
|
237
|
+
export { ColorPicker as default };
|
|
238
|
+
export type { ColorFormat } from '../../_utils/color';
|