EShortcutPicker 快捷键
示例与代码
快捷键
属性
accessibleNamestring辅助技术读取的名称;建议为无文字控件设置可读名称。
placeholderTextappendComponentComponent自定义输入附加区或列表尾部的 Component 插槽;null 使用默认内容。 委托上下文见本页示例。
nullcapturingbool是否正在等待快捷键输入。
falseclearIconint组件使用的图标。
EIcons.*
0(无图标)
EIcons.CIRCLE_XMARKclearablebool显示清除操作;评分中允许再次点击当前分数清零。
trueechoModeenum输入内容的显示模式。
TextInput.NormalTextInput.PasswordTextInput.NoEchoTextInput.PasswordEchoOnEdit
动态绑定enabledbool是否允许交互;false 时控件禁用。
truefontfont字体配置,控制字体、字号及文字样式。
常用字段:
family、pixelSize、pointSize
bold、italic、weight
underline、strikeout
letterSpacing、wordSpacing
应用字体formattervar格式化回调,把当前值转换为显示文字。
nullheightreal组件尺寸,单位为像素;可绑定父布局尺寸。
implicitHeightmaximumLengthint最多允许输入的字符数。
32767parservar输入解析函数,把显示文字转换为底层值。
nullpasswordVisiblebool密码是否以明文显示。
falseplaceholderTextstring空值时显示的占位文字。
随当前语言变化prefixComponentComponent自定义前缀的 Component 插槽;null 使用默认内容。 委托上下文见本页示例。
nullprefixIconint组件使用的图标。
EIcons.*
0(无图标)
0prependComponentComponent自定义输入前置区的 Component 插槽;null 使用默认内容。 委托上下文见本页示例。
nullreadOnlybool禁止用户编辑或评分,仍可通过属性设置值。
truesequencestring当前键盘快捷键字符串。
""showPasswordbool启用密码输入及密码显示切换。
falseshowWordLimitbool显示当前字数与长度上限。
falsesizeint控件尺寸;默认继承最近的 EConfigProvider。
EStyle.SmallEStyle.MediumEStyle.Large
继承 Provider,默认 EStyle.MediumstyleTypeint语义配色风格。
EStyle.DefaultEStyle.PrimaryEStyle.SuccessEStyle.InfoEStyle.WarningEStyle.Danger
EStyle.PrimarysuffixComponentComponent自定义后缀的 Component 插槽;null 使用默认内容。 委托上下文见本页示例。
nullsuffixIconint组件使用的图标。
EIcons.*
0(无图标)
0textstring显示的文字内容。
sequencetextColorcolor文字颜色。
动态绑定validateEventbool值变化时是否向所属表单派发校验请求。
truevalidationMessagestring校验结果说明或外部错误文字。
""validationStateint输入校验状态。
EValidationState.NoneEValidationState.SuccessEValidationState.WarningEValidationState.Error
EValidationState.Nonevisiblebool是否显示组件。
truewidthreal组件尺寸,单位为像素;可绑定父布局尺寸。
implicitWidthhasValidationErrorbool只读当前校验状态是否为 Error。
由运行时计算wordCountint只读当前输入字符数量。
由运行时计算showPasswordStrengthbool聚焦密码输入时显示强度与规则检查。
falsepasswordRulesvar密码规则数组;每项包含 label 及 minLength 或 pattern。
展开默认值
[ {label: ELocale.texts.PasswordLength, minLength: 8}, {label: ELocale.texts.PasswordUppercase, pattern: /[A-Z]/}, {label: ELocale.texts.PasswordLowercase, pattern: /[a-z]/}, {label: ELocale.texts.PasswordNumber, pattern: /[0-9]/}, {label: ELocale.texts.PasswordSymbol, pattern: /[^A-Za-z0-9]/} ]passwordStrengthreal只读通过规则的比例,范围为 0 到 1。
展开默认值
passwordRequirements.length ? passwordRequirements.filter(function(rule) { return rule.passed }).length / passwordRequirements.length : 0passwordRequirementsvar只读包含 label 与 passed 的规则检查结果。
展开默认值
Array.isArray(passwordRules) ? passwordRules.map(function(rule) { let passed = false try { if (rule && rule.minLength !== undefined) passed = text.length >= Number(rule.minLength) else if (rule && rule.pattern) { const expression = new RegExp(rule.pattern) passed = expression.test(text) } } catch (error) { passed = false } return {label: rule && rule.label ? String(rule.label) : "", passed: passed} }) : []信号
captured(string sequence)录入快捷键后触发,sequence 为快捷键组合。
方法
cancel()取消当前操作。