feat: establish composed color field and input group protocols

This commit is contained in:
maoyingjie
2026-10-25 15:20:02 +08:00
parent a41517aa76
commit db18d0d3da
31 changed files with 1859 additions and 39 deletions
+17
View File
@@ -55,3 +55,20 @@ const invalidOrientation: ColorSliderOptions = {
};
void verticalSlider;
void invalidOrientation;
import type { ColorFieldProps } from "../../packages/vue/src/components/color-field/context";
const field: ColorFieldProps = {
modelValue: color,
channel: "alpha",
validate: (value) =>
value?.getChannelValue("alpha") === 0 ? "transparent" : true,
};
const wrongValidator: ColorFieldProps = {
// @ts-expect-error invalid validation argument type
validate: (value: number) => (value > 0 ? true : "invalid"),
};
// @ts-expect-error no numeric color models
const wrongFieldModel: ColorFieldProps = { modelValue: 123 };
void field;
void wrongValidator;
void wrongFieldModel;