feat(color-picker): new component - #1055
Open
liweijie0812 wants to merge 29 commits into
Open
Conversation
colorScheme.dividerColor 在较新 Flutter 版本中已从 ColorScheme 移除, 改用 DividerTheme.of(context).color ?? colorScheme.outlineVariant 保持双版本兼容。
- 格式区由只读整串文本改为分段通道展示(RGB | 0 | 26 | 87 | 100%),格式名框+连体分段框,对齐 mobile-vue __format - 色相条渐变 stop 对齐 mobile-vue 非均匀分布(17%/33%/50%/67%/83%) - 滑块轨道包裹 thumb 区域、白圆底内嵌当前色圆点 - 透明条底改斜向棋盘格(6px 网格 #c5c5c5) - 饱和度面板改三层渐变叠加(基色/白色横渐/黑色纵渐) - 区块间距对齐 mobile-vue(16/20/28),swatch 改单行横向滚动、间距 12 - 清除按钮移至系统预设色彩标题行右侧 - 修复三处 num→double 隐式转型(clamp 补 toDouble())
…-105/feat/color-picker
- 展示按钮用 SizedBox 包裹展开为通栏宽度,对齐 mobile-vue popup 示例 (新 TButton 契约下按钮收缩内容宽,原先纵向堆叠视觉不符) - 拖拽取色改为弹窗内草稿值,「确定」才提交、「取消 / 蒙层」回显旧值, 对齐 calendar 等示例的确认链路 - 文案统一使用 TText;站点文档弹窗示例同步
Member
|
npc/CodeBuddy(glm-5.3-flash) seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Contributor
Web DemoAPK 下载 |
修复 check-flutter-component-contracts.mjs 报 'missing API manifest entry for site route: color-picker' 的问题: - 在 tool/components.json 中为 color-picker 添加 API manifest 条目 - 新增生成的 example/assets/api/color-picker_api.md
- fix(color-picker): TColorPickerThemeData 注册进全局主题管道,主题子树注入生效 - fix(color-picker): HEX/HEX8/CSS 格式区补右端 alpha 固定段(对齐 getFormatList) - fix(color-picker): 透明条棋盘格调整到彩色渐变 rail 下层,避免污染不透明区 - refactor(ColorPicker): onChanged 收敛为具名双参签名 (value, change) - style(ColorPicker): 格式区文字与色板标题改用 placeholder 弱化色 Token - test(ColorPicker): 补拖拽交互/主题注册/alpha 段用例并修正存量断言, 新增 light/dark Golden 基线,ColorPicker 测试纳入 CI 门禁
Resolve conflict in .cnb/.reusable-stages.yml: adopt develop's .component-regression-tests mechanism and register color_picker into run_component_regression.dart / check_component_coverage.dart.
- didUpdateWidget 外部受控 value 变化重新解析 - clearable + 空 swatchColors 的底部清除分支 - HSL/HSV/CMYK 格式分段展示 - 不可解析 swatch 颜色降级为透明 - 无 onPaletteBarChange 时色板拖拽安全 - TColorPickerThemeData copyWith/lerp 契约 修复组件回归覆盖率低于 95% 阈值。
新增 color_picker 演示页视觉回归测试并注册到视觉回归套件, 补齐 run_visual_regression_test.dart 中组件套件与视觉套件的同步校验。
PR #106 引入的 color_picker 弹窗示例使用了重构前 TPopupOptions.bottom 已删除的 titleWidget/cancelBuilder/confirmBuilder/closeOnOverlayClick 参数, 导致 flutter analyze 与 apk 构建失败。适配重构后的 API: - 不传 headerBuilder 即无标题栏与按钮 - 点击遮罩关闭是 TPopupOverlayConfig 默认行为,无需显式配置
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🤔 这个 PR 的性质是?
🔗 相关 Issue
参考 tdesign-mobile-vue 新增颜色选择器组件,示例与 API 尽量对齐。
设计文档见 Spec:
specs/009-color-picker/💡 需求背景和解决方案
新增
TColorPicker颜色选择器组件,API 与交互对齐 tdesign-mobile-vueTdColorPickerProps:base(仅系统预设色板)与multiple(色板 + 色相条 + 透明条 + 系统预设色板)两种类型。enableAlpha时自动升级为带 alpha 的格式。swatchColors自定义系统预设色板、clearable清空、onPaletteBarChange色板拖拽回调。TColorObject,无第三方依赖。TColorPickerThemeData。📝 更新日志
feat(ColorPicker): 新增颜色选择器组件本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单
type(<scope>?): 修改描述。示例:
fix(TBottomTabBar): 修复 iconText 模式底部溢出