start
This commit is contained in:
110
miniprogram_npm/tdesign-miniprogram/input/README.en-US.md
Normal file
110
miniprogram_npm/tdesign-miniprogram/input/README.en-US.md
Normal file
@@ -0,0 +1,110 @@
|
||||
:: BASE_DOC ::
|
||||
|
||||
## API
|
||||
|
||||
### Input Props
|
||||
|
||||
name | type | default | description | required
|
||||
-- | -- | -- | -- | --
|
||||
style | Object | - | CSS(Cascading Style Sheets) | N
|
||||
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
|
||||
adjust-position | Boolean | true | \- | N
|
||||
align | String | left | text align type。options: left/center/right | N
|
||||
allow-input-over-max | Boolean | false | allow to continue input on value length is over `maxlength` or `maxcharacter` | N
|
||||
always-embed | Boolean | false | \- | N
|
||||
auto-focus | Boolean | false | \- | N
|
||||
borderless | Boolean | false | input without border | N
|
||||
clear-trigger | String | always | show clear icon, clicked to clear input value。options: always / focus | N
|
||||
clearable | Boolean / Object | false | show clear icon, clicked to clear input value | N
|
||||
confirm-hold | Boolean | false | \- | N
|
||||
confirm-type | String | done | options: send/search/next/go/done | N
|
||||
cursor | Number | - | required | Y
|
||||
cursor-color | String | #0052d9 | \- | N
|
||||
cursor-spacing | Number | 0 | \- | N
|
||||
disabled | Boolean | undefined | make input to be disabled | N
|
||||
error-message | String | - | `deprecated` | N
|
||||
focus | Boolean | false | \- | N
|
||||
format | Function | - | input value formatter, `type=number` does not work. if you need to format number, `InputNumber` Component might be better。Typescript:`InputFormatType` `type InputFormatType = (value: InputValue) => string`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N
|
||||
hold-keyboard | Boolean | false | \- | N
|
||||
label | String / Slot | - | text on the left of input。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
|
||||
layout | String | horizontal | options: vertical/horizontal | N
|
||||
maxcharacter | Number | - | \- | N
|
||||
maxlength | Number | -1 | \- | N
|
||||
password | Boolean | false | `deprecated` | N
|
||||
placeholder | String | undefined | \- | N
|
||||
placeholder-class | String | input-placeholder | \- | N
|
||||
placeholder-style | String | - | required | Y
|
||||
prefix-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
|
||||
readonly | Boolean | undefined | \- | N
|
||||
safe-password-cert-path | String | - | \- | N
|
||||
safe-password-custom-hash | String | - | \- | N
|
||||
safe-password-length | Number | - | \- | N
|
||||
safe-password-nonce | String | - | \- | N
|
||||
safe-password-salt | String | - | \- | N
|
||||
safe-password-time-stamp | Number | - | \- | N
|
||||
selection-end | Number | -1 | \- | N
|
||||
selection-start | Number | -1 | \- | N
|
||||
size | String | medium | `deprecated`。options: small/medium。Typescript:`'medium' \| 'small'` | N
|
||||
status | String | default | options: default/success/warning/error | N
|
||||
suffix | String / Slot | - | suffix content before suffixIcon。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
|
||||
suffix-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
|
||||
tips | String / Slot | - | tips on the bottom of input, different `status` can make tips to be different color。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
|
||||
type | String | text | options: text/number/idcard/digit/safe-password/password/nickname | N
|
||||
value | String / Number | - | input value。Typescript:`InputValue` `type InputValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N
|
||||
default-value | String / Number | undefined | input value。uncontrolled property。Typescript:`InputValue` `type InputValue = string \| number`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N
|
||||
|
||||
### Input Events
|
||||
|
||||
name | params | description
|
||||
-- | -- | --
|
||||
blur | `(value: InputValue)` | \-
|
||||
change | `(value: InputValue, cursor: number, keyCode: number)` | \-
|
||||
clear | \- | \-
|
||||
click | `(trigger: InputTrigger)` | `0.32.0`
|
||||
enter | `(value: InputValue)` | \-
|
||||
focus | `(value: InputValue)` | \-
|
||||
keyboardheightchange | `(height: number, duration: number)` | \-
|
||||
nicknamereview | `(pass: boolean, timeout: boolean)` | \-
|
||||
validate | `(detail: { error?: 'exceed-maximum' \| 'below-minimum' })` | trigger on text length being over max length or max character
|
||||
|
||||
### Input External Classes
|
||||
|
||||
className | Description
|
||||
-- | --
|
||||
t-class | \-
|
||||
t-class-clearable | \-
|
||||
t-class-input | \-
|
||||
t-class-label | \-
|
||||
t-class-prefix-icon | \-
|
||||
t-class-suffix | \-
|
||||
t-class-suffix-icon | \-
|
||||
t-class-tips | \-
|
||||
|
||||
### CSS Variables
|
||||
|
||||
The component provides the following CSS variables, which can be used to customize styles.
|
||||
Name | Default Value | Description
|
||||
-- | -- | --
|
||||
--td-input-align-items | center | -
|
||||
--td-input-bg-color | @bg-color-container | -
|
||||
--td-input-border-color | @component-stroke | -
|
||||
--td-input-border-left-space | 32rpx | -
|
||||
--td-input-border-right-space | 0 | -
|
||||
--td-input-default-text-color | @text-color-primary | -
|
||||
--td-input-default-tips-color | @text-color-placeholder | -
|
||||
--td-input-disabled-text-color | @text-color-disabled | -
|
||||
--td-input-error-text-color | @error-color | -
|
||||
--td-input-error-tips-color | @error-color | -
|
||||
--td-input-label-max-width | 5em | -
|
||||
--td-input-label-min-width | 2em | -
|
||||
--td-input-label-text-color | @text-color-primary | -
|
||||
--td-input-placeholder-text-color | @text-color-placeholder | -
|
||||
--td-input-placeholder-text-font-size | @font-size-m | -
|
||||
--td-input-prefix-icon-color | @text-color-primary | -
|
||||
--td-input-success-text-color | @success-color | -
|
||||
--td-input-success-tips-color | @success-color | -
|
||||
--td-input-suffix-icon-color | @text-color-placeholder | -
|
||||
--td-input-suffix-text-color | @text-color-primary | -
|
||||
--td-input-vertical-padding | 32rpx | -
|
||||
--td-input-warning-text-color | @warning-color | -
|
||||
--td-input-warning-tips-color | @warning-color | -
|
||||
190
miniprogram_npm/tdesign-miniprogram/input/README.md
Normal file
190
miniprogram_npm/tdesign-miniprogram/input/README.md
Normal file
@@ -0,0 +1,190 @@
|
||||
---
|
||||
title: Input 输入框
|
||||
description: 用于单行文本信息输入。
|
||||
spline: form
|
||||
isComponent: true
|
||||
---
|
||||
|
||||
<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-97%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-88%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-97%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-92%25-blue" /></span>
|
||||
|
||||
## 引入
|
||||
|
||||
全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
|
||||
|
||||
```json
|
||||
"usingComponents": {
|
||||
"t-input": "tdesign-miniprogram/input/input"
|
||||
}
|
||||
```
|
||||
|
||||
## 代码演示
|
||||
|
||||
<a href="https://developers.weixin.qq.com/s/Id60eimj76Ss" title="在开发者工具中预览效果" target="_blank" rel="noopener noreferrer"> 在开发者工具中预览效果 </a>
|
||||
|
||||
<blockquote style="background-color: #d9e1ff; font-size: 15px; line-height: 26px;margin: 16px 0 0;padding: 16px; border-radius: 6px; color: #0052d9" >
|
||||
<p>Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"</p>
|
||||
</blockquote>
|
||||
|
||||
### 01 组件类型
|
||||
|
||||
基础输入框
|
||||
|
||||
{{ base }}
|
||||
|
||||
带字数限制输入框
|
||||
|
||||
{{ maxlength }}
|
||||
|
||||
带操作输入框
|
||||
|
||||
{{ suffix }}
|
||||
|
||||
带图标输入框
|
||||
|
||||
{{ prefix }}
|
||||
|
||||
特定类型输入框
|
||||
|
||||
{{ special }}
|
||||
|
||||
### 02 组件状态
|
||||
|
||||
输入框状态
|
||||
|
||||
{{ status }}
|
||||
|
||||
信息超长状态
|
||||
|
||||
{{ label }}
|
||||
|
||||
### 03 组件样式
|
||||
|
||||
内容位置
|
||||
|
||||
{{ align }}
|
||||
|
||||
竖排样式
|
||||
|
||||
{{ layout }}
|
||||
|
||||
非通栏样式
|
||||
|
||||
{{ banner }}
|
||||
|
||||
标签外置样式
|
||||
|
||||
{{ bordered }}
|
||||
|
||||
自定义样式文本框
|
||||
|
||||
{{ custom }}
|
||||
|
||||
## API
|
||||
|
||||
### Input Props
|
||||
|
||||
名称 | 类型 | 默认值 | 描述 | 必传
|
||||
-- | -- | -- | -- | --
|
||||
style | Object | - | 样式 | N
|
||||
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
|
||||
adjust-position | Boolean | true | 键盘弹起时,是否自动上推页面 | N
|
||||
align | String | left | 文本内容位置,居左/居中/居右。可选项:left/center/right | N
|
||||
allow-input-over-max | Boolean | false | 超出 `maxlength` 或 `maxcharacter` 之后是否允许继续输入 | N
|
||||
always-embed | Boolean | false | 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效) | N
|
||||
auto-focus | Boolean | false | (即将废弃,请直接使用 focus )自动聚焦,拉起键盘 | N
|
||||
borderless | Boolean | false | 是否开启无边框模式 | N
|
||||
clear-trigger | String | always | 清空图标触发方式,仅在输入框有值时有效。可选项:always / focus | N
|
||||
clearable | Boolean / Object | false | 是否可清空,默认不启动。值为 `true` 表示使用默认清空按钮,值为 `Object` 表示透传至 `icon` | N
|
||||
confirm-hold | Boolean | false | 点击键盘右下角按钮时是否保持键盘不收起 | N
|
||||
confirm-type | String | done | 设置键盘右下角按钮的文字,仅在type='text'时生效。<br />具体释义:<br />`send` 右下角按钮为“发送”;<br />`search` 右下角按钮为“搜索”;<br />`next` 右下角按钮为“下一个”;<br />`go` 右下角按钮为“前往”;<br />`done` 右下角按钮为“完成”。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/input.html)。可选项:send/search/next/go/done | N
|
||||
cursor | Number | - | 必需。指定 focus 时的光标位置 | Y
|
||||
cursor-color | String | #0052d9 | 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制 | N
|
||||
cursor-spacing | Number | 0 | 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 | N
|
||||
disabled | Boolean | undefined | 是否禁用输入框 | N
|
||||
error-message | String | - | 已废弃。错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips) | N
|
||||
focus | Boolean | false | 获取焦点 | N
|
||||
format | Function | - | 指定输入框展示值的格式。TS 类型:`InputFormatType` `type InputFormatType = (value: InputValue) => string`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N
|
||||
hold-keyboard | Boolean | false | focus时,点击页面的时候不收起键盘 | N
|
||||
label | String / Slot | - | 左侧文本。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
|
||||
layout | String | horizontal | 标题输入框布局方式。可选项:vertical/horizontal | N
|
||||
maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 | N
|
||||
maxlength | Number | -1 | 用户最多可以输入的文本长度,一个中文等于一个计数长度。默认为 -1,不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用 | N
|
||||
password | Boolean | false | 已废弃。是否是密码类型(已废弃,请更为使用 type 指定输入框类型) | N
|
||||
placeholder | String | undefined | 占位符 | N
|
||||
placeholder-class | String | input-placeholder | 指定 placeholder 的样式类 | N
|
||||
placeholder-style | String | - | 必需。指定 placeholder 的样式 | Y
|
||||
prefix-icon | String / Object / Slot | - | 组件前置图标。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
|
||||
readonly | Boolean | undefined | 只读状态 | N
|
||||
safe-password-cert-path | String | - | 安全键盘加密公钥的路径,只支持包内路径 | N
|
||||
safe-password-custom-hash | String | - | 安全键盘计算 hash 的算法表达式,如 `md5(sha1('foo' + sha256(sm3(password + 'bar'))))` | N
|
||||
safe-password-length | Number | - | 安全键盘输入密码长度 | N
|
||||
safe-password-nonce | String | - | 安全键盘加密盐值 | N
|
||||
safe-password-salt | String | - | 安全键盘计算 hash 盐值,若指定custom-hash 则无效 | N
|
||||
safe-password-time-stamp | Number | - | 安全键盘加密时间戳 | N
|
||||
selection-end | Number | -1 | 光标结束位置,自动聚集时有效,需与 selection-start 搭配使用 | N
|
||||
selection-start | Number | -1 | 光标起始位置,自动聚集时有效,需与 selection-end 搭配使用 | N
|
||||
size | String | medium | 已废弃。输入框尺寸。可选项:small/medium。TS 类型:`'medium' \| 'small'` | N
|
||||
status | String | default | 输入框状态。可选项:default/success/warning/error | N
|
||||
suffix | String / Slot | - | 后置图标前的后置内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
|
||||
suffix-icon | String / Object / Slot | - | 后置文本内容。值为字符串则表示图标名称,值为 `Object` 类型,表示透传至 `icon`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
|
||||
tips | String / Slot | - | 输入框下方提示文本,会根据不同的 `status` 呈现不同的样式。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
|
||||
type | String | text | 输入框类型。可选项:text/number/idcard/digit/safe-password/password/nickname | N
|
||||
value | String / Number | - | 输入框的值。TS 类型:`InputValue` `type InputValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N
|
||||
default-value | String / Number | undefined | 输入框的值。非受控属性。TS 类型:`InputValue` `type InputValue = string \| number`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N
|
||||
|
||||
### Input Events
|
||||
|
||||
名称 | 参数 | 描述
|
||||
-- | -- | --
|
||||
blur | `(value: InputValue)` | 失去焦点时触发
|
||||
change | `(value: InputValue, cursor: number, keyCode: number)` | 输入框值发生变化时触发;cursor 为光标位置;
|
||||
clear | \- | 清空按钮点击时触发
|
||||
click | `(trigger: InputTrigger)` | `0.32.0`。点击事件。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts)。<br/>`type InputTrigger = 'suffix' \| 'suffix-icon';`<br/>
|
||||
enter | `(value: InputValue)` | 回车键按下时触发
|
||||
focus | `(value: InputValue)` | 获得焦点时触发
|
||||
keyboardheightchange | `(height: number, duration: number)` | 键盘高度发生变化的时候触发此事件
|
||||
nicknamereview | `(pass: boolean, timeout: boolean)` | 用户昵称审核完毕后触发,仅在 type 为 "nickname" 时有效
|
||||
validate | `(detail: { error?: 'exceed-maximum' \| 'below-minimum' })` | 字数超出限制时触发
|
||||
|
||||
### Input External Classes
|
||||
|
||||
类名 | 描述
|
||||
-- | --
|
||||
t-class | 根节点样式类
|
||||
t-class-clearable | 清空按钮样式类
|
||||
t-class-input | 输入框样式类
|
||||
t-class-label | 标签样式类
|
||||
t-class-prefix-icon | 前置图标样式类
|
||||
t-class-suffix | 后置样式类
|
||||
t-class-suffix-icon | 后置图标样式类
|
||||
t-class-tips | 提示样式类
|
||||
|
||||
### CSS Variables
|
||||
|
||||
组件提供了下列 CSS 变量,可用于自定义样式。
|
||||
|
||||
名称 | 默认值 | 描述
|
||||
-- | -- | --
|
||||
--td-input-align-items | center | -
|
||||
--td-input-bg-color | @bg-color-container | -
|
||||
--td-input-border-color | @component-stroke | -
|
||||
--td-input-border-left-space | 32rpx | -
|
||||
--td-input-border-right-space | 0 | -
|
||||
--td-input-default-text-color | @text-color-primary | -
|
||||
--td-input-default-tips-color | @text-color-placeholder | -
|
||||
--td-input-disabled-text-color | @text-color-disabled | -
|
||||
--td-input-error-text-color | @error-color | -
|
||||
--td-input-error-tips-color | @error-color | -
|
||||
--td-input-label-max-width | 5em | -
|
||||
--td-input-label-min-width | 2em | -
|
||||
--td-input-label-text-color | @text-color-primary | -
|
||||
--td-input-placeholder-text-color | @text-color-placeholder | -
|
||||
--td-input-placeholder-text-font-size | @font-size-m | -
|
||||
--td-input-prefix-icon-color | @text-color-primary | -
|
||||
--td-input-success-text-color | @success-color | -
|
||||
--td-input-success-tips-color | @success-color | -
|
||||
--td-input-suffix-icon-color | @text-color-placeholder | -
|
||||
--td-input-suffix-text-color | @text-color-primary | -
|
||||
--td-input-vertical-padding | 32rpx | -
|
||||
--td-input-warning-text-color | @warning-color | -
|
||||
--td-input-warning-tips-color | @warning-color | -
|
||||
37
miniprogram_npm/tdesign-miniprogram/input/input.d.ts
vendored
Normal file
37
miniprogram_npm/tdesign-miniprogram/input/input.d.ts
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import { SuperComponent } from '../common/src/index';
|
||||
export default class Input extends SuperComponent {
|
||||
options: {
|
||||
multipleSlots: boolean;
|
||||
};
|
||||
externalClasses: string[];
|
||||
behaviors: string[];
|
||||
properties: import("./type").TdInputProps;
|
||||
data: {
|
||||
prefix: string;
|
||||
classPrefix: string;
|
||||
classBasePrefix: string;
|
||||
showClearIcon: boolean;
|
||||
};
|
||||
lifetimes: {
|
||||
ready(): void;
|
||||
};
|
||||
observers: {
|
||||
prefixIcon(v: any): void;
|
||||
suffixIcon(v: any): void;
|
||||
clearable(v: any): void;
|
||||
'clearTrigger, clearable, disabled, readonly'(): void;
|
||||
};
|
||||
methods: {
|
||||
updateValue(value: any): void;
|
||||
updateClearIconVisible(value?: boolean): void;
|
||||
onInput(e: any): void;
|
||||
onFocus(e: any): void;
|
||||
onBlur(e: any): void;
|
||||
onConfirm(e: any): void;
|
||||
onSuffixClick(): void;
|
||||
onSuffixIconClick(): void;
|
||||
clearInput(e: any): void;
|
||||
onKeyboardHeightChange(e: any): void;
|
||||
onNickNameReview(e: any): void;
|
||||
};
|
||||
}
|
||||
140
miniprogram_npm/tdesign-miniprogram/input/input.js
Normal file
140
miniprogram_npm/tdesign-miniprogram/input/input.js
Normal file
@@ -0,0 +1,140 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
import { SuperComponent, wxComponent } from '../common/src/index';
|
||||
import config from '../common/config';
|
||||
import props from './props';
|
||||
import { getCharacterLength, calcIcon, isDef } from '../common/utils';
|
||||
const { prefix } = config;
|
||||
const name = `${prefix}-input`;
|
||||
let Input = class Input extends SuperComponent {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.options = {
|
||||
multipleSlots: true,
|
||||
};
|
||||
this.externalClasses = [
|
||||
`${prefix}-class`,
|
||||
`${prefix}-class-prefix-icon`,
|
||||
`${prefix}-class-label`,
|
||||
`${prefix}-class-input`,
|
||||
`${prefix}-class-clearable`,
|
||||
`${prefix}-class-suffix`,
|
||||
`${prefix}-class-suffix-icon`,
|
||||
`${prefix}-class-tips`,
|
||||
];
|
||||
this.behaviors = ['wx://form-field'];
|
||||
this.properties = props;
|
||||
this.data = {
|
||||
prefix,
|
||||
classPrefix: name,
|
||||
classBasePrefix: prefix,
|
||||
showClearIcon: true,
|
||||
};
|
||||
this.lifetimes = {
|
||||
ready() {
|
||||
var _a;
|
||||
const { value, defaultValue } = this.properties;
|
||||
this.updateValue((_a = value !== null && value !== void 0 ? value : defaultValue) !== null && _a !== void 0 ? _a : '');
|
||||
},
|
||||
};
|
||||
this.observers = {
|
||||
prefixIcon(v) {
|
||||
this.setData({
|
||||
_prefixIcon: calcIcon(v),
|
||||
});
|
||||
},
|
||||
suffixIcon(v) {
|
||||
this.setData({
|
||||
_suffixIcon: calcIcon(v),
|
||||
});
|
||||
},
|
||||
clearable(v) {
|
||||
this.setData({
|
||||
_clearIcon: calcIcon(v, 'close-circle-filled'),
|
||||
});
|
||||
},
|
||||
'clearTrigger, clearable, disabled, readonly'() {
|
||||
this.updateClearIconVisible();
|
||||
},
|
||||
};
|
||||
this.methods = {
|
||||
updateValue(value) {
|
||||
const { allowInputOverMax, maxcharacter, maxlength } = this.properties;
|
||||
if (!allowInputOverMax && maxcharacter && maxcharacter > 0 && !Number.isNaN(maxcharacter)) {
|
||||
const { length, characters } = getCharacterLength('maxcharacter', value, maxcharacter);
|
||||
this.setData({
|
||||
value: characters,
|
||||
count: length,
|
||||
});
|
||||
}
|
||||
else if (!allowInputOverMax && maxlength && maxlength > 0 && !Number.isNaN(maxlength)) {
|
||||
const { length, characters } = getCharacterLength('maxlength', value, maxlength);
|
||||
this.setData({
|
||||
value: characters,
|
||||
count: length,
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.setData({
|
||||
value,
|
||||
count: isDef(value) ? String(value).length : 0,
|
||||
});
|
||||
}
|
||||
},
|
||||
updateClearIconVisible(value = false) {
|
||||
const { clearTrigger, disabled, readonly } = this.properties;
|
||||
if (disabled || readonly) {
|
||||
this.setData({ showClearIcon: false });
|
||||
return;
|
||||
}
|
||||
this.setData({ showClearIcon: value || clearTrigger === 'always' });
|
||||
},
|
||||
onInput(e) {
|
||||
const { value, cursor, keyCode } = e.detail;
|
||||
this.updateValue(value);
|
||||
this.triggerEvent('change', { value: this.data.value, cursor, keyCode });
|
||||
},
|
||||
onFocus(e) {
|
||||
this.updateClearIconVisible(true);
|
||||
this.triggerEvent('focus', e.detail);
|
||||
},
|
||||
onBlur(e) {
|
||||
this.updateClearIconVisible();
|
||||
if (typeof this.properties.format === 'function') {
|
||||
const v = this.properties.format(e.detail.value);
|
||||
this.updateValue(v);
|
||||
this.triggerEvent('blur', { value: this.data.value, cursor: this.data.count });
|
||||
return;
|
||||
}
|
||||
this.triggerEvent('blur', e.detail);
|
||||
},
|
||||
onConfirm(e) {
|
||||
this.triggerEvent('enter', e.detail);
|
||||
},
|
||||
onSuffixClick() {
|
||||
this.triggerEvent('click', { trigger: 'suffix' });
|
||||
},
|
||||
onSuffixIconClick() {
|
||||
this.triggerEvent('click', { trigger: 'suffix-icon' });
|
||||
},
|
||||
clearInput(e) {
|
||||
this.triggerEvent('clear', e.detail);
|
||||
this.setData({ value: '' });
|
||||
},
|
||||
onKeyboardHeightChange(e) {
|
||||
this.triggerEvent('keyboardheightchange', e.detail);
|
||||
},
|
||||
onNickNameReview(e) {
|
||||
this.triggerEvent('nicknamereview', e.detail);
|
||||
},
|
||||
};
|
||||
}
|
||||
};
|
||||
Input = __decorate([
|
||||
wxComponent()
|
||||
], Input);
|
||||
export default Input;
|
||||
7
miniprogram_npm/tdesign-miniprogram/input/input.json
Normal file
7
miniprogram_npm/tdesign-miniprogram/input/input.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"styleIsolation": "apply-shared",
|
||||
"usingComponents": {
|
||||
"t-icon": "../icon/icon"
|
||||
}
|
||||
}
|
||||
101
miniprogram_npm/tdesign-miniprogram/input/input.wxml
Normal file
101
miniprogram_npm/tdesign-miniprogram/input/input.wxml
Normal file
@@ -0,0 +1,101 @@
|
||||
<import src="../common/template/icon.wxml" />
|
||||
<wxs src="../common/utils.wxs" module="_" />
|
||||
<wxs src="./input.wxs" module="_this" />
|
||||
|
||||
<view
|
||||
style="{{_._style([style, customStyle])}}"
|
||||
class="{{_.cls(classPrefix, [['border', !borderless]])}} {{classPrefix}}--layout-{{layout}} class {{prefix}}-class"
|
||||
aria-describedby
|
||||
>
|
||||
<!-- aria-describedby用于关联该行设置了aria-hidden的元素最近的焦点,解决触发焦点过度上下偏移的问题 -->
|
||||
<view class="{{classPrefix}}__wrap--prefix">
|
||||
<view class="{{classPrefix}}__icon--prefix">
|
||||
<slot name="prefix-icon" />
|
||||
<template
|
||||
wx:if="{{_prefixIcon}}"
|
||||
is="icon"
|
||||
data="{{tClass: prefix + '-class-prefix-icon', ariaHidden: true, ..._prefixIcon}}"
|
||||
/>
|
||||
</view>
|
||||
<view class="{{classPrefix}}__label {{prefix}}-class-label" aria-hidden>
|
||||
<slot name="label" />
|
||||
<block wx:if="{{label}}">{{label}}</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="{{classPrefix}}__wrap">
|
||||
<view class="{{classPrefix}}__content {{classPrefix}}--{{status}}">
|
||||
<input
|
||||
class="{{_this.getInputClass(classPrefix, suffix, align, disabled)}} {{prefix}}-class-input"
|
||||
maxlength="{{allowInputOverMax ? -1 : maxlength}}"
|
||||
disabled="{{disabled || readonly}}"
|
||||
placeholder="{{placeholder}}"
|
||||
placeholder-style="{{placeholderStyle}}"
|
||||
placeholder-class="{{_.cls(classPrefix + '__placeholder', [['disabled', disabled]])}} {{placeholderClass}}"
|
||||
value="{{value}}"
|
||||
password="{{type === 'password'}}"
|
||||
type="{{type === 'password' ? 'text' : type}}"
|
||||
focus="{{focus}}"
|
||||
confirm-type="{{confirmType}}"
|
||||
confirm-hold="{{confirmHold}}"
|
||||
cursor="{{cursor}}"
|
||||
cursor-color="{{cursorColor}}"
|
||||
cursor-spacing="{{cursorSpacing}}"
|
||||
adjust-position="{{adjustPosition}}"
|
||||
auto-focus="{{autoFocus}}"
|
||||
always-embed="{{alwaysEmbed}}"
|
||||
selection-start="{{selectionStart}}"
|
||||
selection-end="{{selectionEnd}}"
|
||||
hold-keyboard="{{holdKeyboard}}"
|
||||
safe-password-cert-path="{{safePasswordCertPath}}"
|
||||
safe-password-length="{{safePasswordLength}}"
|
||||
safe-password-time-stamp="{{safePasswordTimeStamp}}"
|
||||
safe-password-nonce="{{safePasswordNonce}}"
|
||||
safe-password-salt="{{safePasswordSalt}}"
|
||||
safe-password-custom-hash="{{safePasswordCustomHash}}"
|
||||
aria-role="textbox"
|
||||
aria-label="{{label}}"
|
||||
aria-roledescription="{{label}}"
|
||||
bindinput="onInput"
|
||||
bindfocus="onFocus"
|
||||
bindblur="onBlur"
|
||||
bindconfirm="onConfirm"
|
||||
bindkeyboardheightchange="onKeyboardHeightChange"
|
||||
bindnicknamereview="onNickNameReview"
|
||||
/>
|
||||
<!--
|
||||
这里aria-role="textbox"和aria-label组合使用实现ios的聚合焦点播报效果。
|
||||
ios会播报aria-label,不会重复播报aria-roledescription的内容;
|
||||
安卓不会播报aria-label,会播报aria-roledescription的内容
|
||||
-->
|
||||
<view
|
||||
wx:if="{{_clearIcon && value.length > 0 && showClearIcon}}"
|
||||
class="{{classPrefix}}__wrap--clearable-icon"
|
||||
bind:tap="clearInput"
|
||||
>
|
||||
<template
|
||||
is="icon"
|
||||
data="{{tClass: prefix + '-class-clearable', ariaRole: 'button', ariaLabel: '清除', ..._clearIcon }}"
|
||||
/>
|
||||
</view>
|
||||
<view class="{{classPrefix}}__wrap--suffix {{prefix}}-class-suffix" bind:tap="onSuffixClick">
|
||||
<text wx:if="{{suffix}}">{{suffix}}</text>
|
||||
<slot name="suffix" />
|
||||
</view>
|
||||
<view class="{{classPrefix}}__wrap--suffix-icon" bind:tap="onSuffixIconClick">
|
||||
<slot name="suffix-icon" />
|
||||
<template
|
||||
wx:if="{{_suffixIcon}}"
|
||||
is="icon"
|
||||
data="{{tClass: prefix + '-class-suffix-icon', ariaRole: 'button', ..._suffixIcon }}"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
wx:if="{{tips && tips.length > 0}}"
|
||||
class="{{classPrefix}}__tips {{classPrefix}}--{{align}} {{prefix}}-class-tips"
|
||||
>{{tips}}
|
||||
</view>
|
||||
<slot name="tips" />
|
||||
</view>
|
||||
</view>
|
||||
16
miniprogram_npm/tdesign-miniprogram/input/input.wxs
Normal file
16
miniprogram_npm/tdesign-miniprogram/input/input.wxs
Normal file
@@ -0,0 +1,16 @@
|
||||
function getInputClass(classPrefix, suffix, align, disabled) {
|
||||
var className = [classPrefix + '__control'];
|
||||
|
||||
if (align) {
|
||||
className.push(classPrefix + '--' + align);
|
||||
}
|
||||
|
||||
if (disabled) {
|
||||
className.push(classPrefix + '__control--disabled');
|
||||
}
|
||||
return className.join(' ');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getInputClass: getInputClass,
|
||||
};
|
||||
191
miniprogram_npm/tdesign-miniprogram/input/input.wxss
Normal file
191
miniprogram_npm/tdesign-miniprogram/input/input.wxss
Normal file
@@ -0,0 +1,191 @@
|
||||
.t-float-left {
|
||||
float: left;
|
||||
}
|
||||
.t-float-right {
|
||||
float: right;
|
||||
}
|
||||
@keyframes tdesign-fade-out {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
.hotspot-expanded.relative {
|
||||
position: relative;
|
||||
}
|
||||
.hotspot-expanded::after {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
transform: scale(1.5);
|
||||
}
|
||||
.t-input {
|
||||
background-color: var(--td-input-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
|
||||
display: flex;
|
||||
align-items: var(--td-input-align-items, center);
|
||||
flex: 1;
|
||||
padding: var(--td-input-vertical-padding, 32rpx);
|
||||
overflow: hidden;
|
||||
}
|
||||
.t-input--border {
|
||||
position: relative;
|
||||
}
|
||||
.t-input--border::after {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: unset;
|
||||
bottom: 0;
|
||||
left: unset;
|
||||
right: unset;
|
||||
background-color: var(--td-input-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
|
||||
}
|
||||
.t-input--border::after {
|
||||
height: 1px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
.t-input--border:after {
|
||||
left: var(--td-input-border-left-space, 32rpx);
|
||||
right: var(--td-input-border-right-space, 0);
|
||||
}
|
||||
.t-input--layout-vertical {
|
||||
flex-direction: column;
|
||||
align-items: start;
|
||||
}
|
||||
.t-input__wrap--prefix {
|
||||
display: flex;
|
||||
}
|
||||
.t-input__icon--prefix {
|
||||
font-size: 48rpx;
|
||||
color: var(--td-input-prefix-icon-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
|
||||
}
|
||||
.t-input__label:not(:empty) {
|
||||
min-width: var(--td-input-label-min-width, 2em);
|
||||
max-width: var(--td-input-label-max-width, 5em);
|
||||
font-size: var(--td-font-size-m, 32rpx);
|
||||
line-height: 48rpx;
|
||||
color: var(--td-input-label-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
|
||||
margin-right: var(--td-spacer-2, 32rpx);
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.t-input--layout-vertical .t-input__label:not(:empty) {
|
||||
font-size: var(--td-font-size-base, 28rpx);
|
||||
padding-bottom: 8rpx;
|
||||
}
|
||||
.t-input__icon--prefix:not(:empty) + .t-input__label:not(:empty) {
|
||||
padding-left: 8rpx;
|
||||
}
|
||||
.t-input__label:not(:empty) + .t-input__wrap {
|
||||
margin-left: var(--td-spacer-2, 32rpx);
|
||||
}
|
||||
.t-input__icon--prefix:not(:empty) + .t-input__label:empty {
|
||||
margin-right: var(--td-spacer-2, 32rpx);
|
||||
}
|
||||
.t-input__wrap {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
flex-shrink: 1;
|
||||
flex: 1;
|
||||
}
|
||||
.t-input__wrap .t-input__content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
line-height: 48rpx;
|
||||
font-size: var(--td-font-size-m, 32rpx);
|
||||
}
|
||||
.t-input__wrap--clearable-icon,
|
||||
.t-input__wrap--suffix-icon,
|
||||
.t-input__wrap--suffix {
|
||||
flex: 0 0 auto;
|
||||
padding-left: var(--td-spacer-1, 24rpx);
|
||||
}
|
||||
.t-input__wrap--clearable-icon:empty,
|
||||
.t-input__wrap--suffix-icon:empty,
|
||||
.t-input__wrap--suffix:empty {
|
||||
display: none;
|
||||
}
|
||||
.t-input__wrap--clearable-icon,
|
||||
.t-input__wrap--suffix-icon {
|
||||
font-size: 48rpx;
|
||||
color: var(--td-input-suffix-icon-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
|
||||
}
|
||||
.t-input__wrap--suffix {
|
||||
font-size: var(--td-font-size-m, 32rpx);
|
||||
color: var(--td-input-suffix-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
|
||||
}
|
||||
.t-input__icon--prefix:empty,
|
||||
.t-input__tips:empty,
|
||||
.t-input__wrap--clearable-icon:empty,
|
||||
.t-input__wrap--suffix-icon:empty,
|
||||
.t-input__wrap--suffix:empty {
|
||||
display: none;
|
||||
}
|
||||
.t-input__control {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
min-height: 48rpx;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: var(--td-input-default-text-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
|
||||
line-height: inherit;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
resize: none;
|
||||
font-size: inherit;
|
||||
}
|
||||
.t-input__control--disabled {
|
||||
color: var(--td-input-disabled-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
|
||||
cursor: not-allowed;
|
||||
opacity: 1;
|
||||
-webkit-text-fill-color: currentColor;
|
||||
}
|
||||
.t-input__control--read-only {
|
||||
cursor: default;
|
||||
}
|
||||
.t-input--left {
|
||||
text-align: left;
|
||||
}
|
||||
.t-input--right {
|
||||
text-align: right;
|
||||
}
|
||||
.t-input--center {
|
||||
text-align: center;
|
||||
}
|
||||
.t-input__placeholder {
|
||||
color: var(--td-input-placeholder-text-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
|
||||
font-size: var(--td-input-placeholder-text-font-size, var(--td-font-size-m, 32rpx));
|
||||
}
|
||||
.t-input__placeholder--disabled {
|
||||
color: var(--td-input-disabled-text-color, var(--td-text-color-disabled, var(--td-font-gray-4, rgba(0, 0, 0, 0.26))));
|
||||
}
|
||||
.t-input__tips {
|
||||
font-size: var(--td-font-size-s, 24rpx);
|
||||
line-height: 40rpx;
|
||||
padding-top: 8rpx;
|
||||
}
|
||||
.t-input--default + .t-input__tips {
|
||||
color: var(--td-input-default-tips-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
|
||||
}
|
||||
.t-input--success + .t-input__tips {
|
||||
color: var(--td-input-success-tips-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
|
||||
}
|
||||
.t-input--warning + .t-input__tips {
|
||||
color: var(--td-input-warning-tips-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
|
||||
}
|
||||
.t-input--error + .t-input__tips {
|
||||
color: var(--td-input-error-tips-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
|
||||
}
|
||||
3
miniprogram_npm/tdesign-miniprogram/input/props.d.ts
vendored
Normal file
3
miniprogram_npm/tdesign-miniprogram/input/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdInputProps } from './type';
|
||||
declare const props: TdInputProps;
|
||||
export default props;
|
||||
154
miniprogram_npm/tdesign-miniprogram/input/props.js
Normal file
154
miniprogram_npm/tdesign-miniprogram/input/props.js
Normal file
@@ -0,0 +1,154 @@
|
||||
const props = {
|
||||
adjustPosition: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
align: {
|
||||
type: String,
|
||||
value: 'left',
|
||||
},
|
||||
allowInputOverMax: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
alwaysEmbed: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
autoFocus: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
borderless: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
clearTrigger: {
|
||||
type: String,
|
||||
value: 'always',
|
||||
},
|
||||
clearable: {
|
||||
type: null,
|
||||
value: false,
|
||||
},
|
||||
confirmHold: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
confirmType: {
|
||||
type: String,
|
||||
value: 'done',
|
||||
},
|
||||
cursor: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
cursorColor: {
|
||||
type: String,
|
||||
value: '#0052d9',
|
||||
},
|
||||
cursorSpacing: {
|
||||
type: Number,
|
||||
value: 0,
|
||||
},
|
||||
disabled: {
|
||||
type: null,
|
||||
value: undefined,
|
||||
},
|
||||
focus: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
format: {
|
||||
type: null,
|
||||
},
|
||||
holdKeyboard: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
},
|
||||
layout: {
|
||||
type: String,
|
||||
value: 'horizontal',
|
||||
},
|
||||
maxcharacter: {
|
||||
type: Number,
|
||||
},
|
||||
maxlength: {
|
||||
type: Number,
|
||||
value: -1,
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
value: undefined,
|
||||
},
|
||||
placeholderClass: {
|
||||
type: String,
|
||||
value: 'input-placeholder',
|
||||
},
|
||||
placeholderStyle: {
|
||||
type: String,
|
||||
value: '',
|
||||
required: true,
|
||||
},
|
||||
prefixIcon: {
|
||||
type: null,
|
||||
},
|
||||
readonly: {
|
||||
type: null,
|
||||
value: undefined,
|
||||
},
|
||||
safePasswordCertPath: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
safePasswordCustomHash: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
safePasswordLength: {
|
||||
type: Number,
|
||||
},
|
||||
safePasswordNonce: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
safePasswordSalt: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
safePasswordTimeStamp: {
|
||||
type: Number,
|
||||
},
|
||||
selectionEnd: {
|
||||
type: Number,
|
||||
value: -1,
|
||||
},
|
||||
selectionStart: {
|
||||
type: Number,
|
||||
value: -1,
|
||||
},
|
||||
status: {
|
||||
type: String,
|
||||
value: 'default',
|
||||
},
|
||||
suffix: {
|
||||
type: String,
|
||||
},
|
||||
suffixIcon: {
|
||||
type: null,
|
||||
},
|
||||
tips: {
|
||||
type: String,
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
value: 'text',
|
||||
},
|
||||
value: {
|
||||
type: null,
|
||||
},
|
||||
};
|
||||
export default props;
|
||||
166
miniprogram_npm/tdesign-miniprogram/input/type.d.ts
vendored
Normal file
166
miniprogram_npm/tdesign-miniprogram/input/type.d.ts
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
export interface TdInputProps {
|
||||
adjustPosition?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
align?: {
|
||||
type: StringConstructor;
|
||||
value?: 'left' | 'center' | 'right';
|
||||
};
|
||||
allowInputOverMax?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
alwaysEmbed?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
autoFocus?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
borderless?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
clearTrigger?: {
|
||||
type: StringConstructor;
|
||||
value?: 'always' | 'focus';
|
||||
};
|
||||
clearable?: {
|
||||
type: null;
|
||||
value?: boolean | object;
|
||||
};
|
||||
confirmHold?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
confirmType?: {
|
||||
type: StringConstructor;
|
||||
value?: 'send' | 'search' | 'next' | 'go' | 'done';
|
||||
};
|
||||
cursor: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
required?: boolean;
|
||||
};
|
||||
cursorColor?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
cursorSpacing?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
disabled?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
focus?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
format?: {
|
||||
type: undefined;
|
||||
value?: InputFormatType;
|
||||
};
|
||||
holdKeyboard?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
label?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
layout?: {
|
||||
type: StringConstructor;
|
||||
value?: 'vertical' | 'horizontal';
|
||||
};
|
||||
maxcharacter?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
maxlength?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
placeholder?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
placeholderClass?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
placeholderStyle: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
required?: boolean;
|
||||
};
|
||||
prefixIcon?: {
|
||||
type: null;
|
||||
value?: string | object;
|
||||
};
|
||||
readonly?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
safePasswordCertPath?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
safePasswordCustomHash?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
safePasswordLength?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
safePasswordNonce?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
safePasswordSalt?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
safePasswordTimeStamp?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
selectionEnd?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
selectionStart?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
status?: {
|
||||
type: StringConstructor;
|
||||
value?: 'default' | 'success' | 'warning' | 'error';
|
||||
};
|
||||
suffix?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
suffixIcon?: {
|
||||
type: null;
|
||||
value?: string | object;
|
||||
};
|
||||
tips?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
type?: {
|
||||
type: StringConstructor;
|
||||
value?: 'text' | 'number' | 'idcard' | 'digit' | 'safe-password' | 'password' | 'nickname';
|
||||
};
|
||||
value?: {
|
||||
type: null;
|
||||
value?: InputValue;
|
||||
};
|
||||
}
|
||||
export declare type InputFormatType = (value: InputValue) => string;
|
||||
export declare type InputValue = string | number;
|
||||
1
miniprogram_npm/tdesign-miniprogram/input/type.js
Normal file
1
miniprogram_npm/tdesign-miniprogram/input/type.js
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
Reference in New Issue
Block a user