- 新增 precision 属性用于控制数字类型输入框的小数位数 - 实现输入值的精度校验与格式化逻辑 - 添加超出精度限制时的样式提示 - 支持深色模式下的精度超限颜色适配 - 在 demo 页面中增加精度控制示例
34 lines
806 B
TypeScript
34 lines
806 B
TypeScript
import type { ClInputType, PassThroughProps } from "../../types";
|
|
import type { ClIconProps } from "../cl-icon/props";
|
|
|
|
export type ClInputPassThrough = {
|
|
className?: string;
|
|
inner?: PassThroughProps;
|
|
prefixIcon?: ClIconProps;
|
|
suffixIcon?: ClIconProps;
|
|
};
|
|
|
|
export type ClInputProps = {
|
|
className?: string;
|
|
pt?: ClInputPassThrough;
|
|
modelValue?: string;
|
|
type?: ClInputType;
|
|
prefixIcon?: string;
|
|
suffixIcon?: string;
|
|
password?: boolean;
|
|
autofocus?: boolean;
|
|
disabled?: boolean;
|
|
readonly?: boolean;
|
|
placeholder?: string;
|
|
placeholderClass?: string;
|
|
border?: boolean;
|
|
clearable?: boolean;
|
|
cursorSpacing?: number;
|
|
confirmHold?: boolean;
|
|
confirmType?: "done" | "go" | "next" | "search" | "send";
|
|
adjustPosition?: boolean;
|
|
maxlength?: number;
|
|
holdKeyboard?: boolean;
|
|
precision?: number;
|
|
};
|