This commit is contained in:
Ling53666
2025-08-18 09:11:51 +08:00
commit 02554225da
2516 changed files with 133155 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<input
enableNative="{{enableNative}}"
name="{{name}}"
class="{{className}}"
style="{{style}}"
disabled="{{disabled}}"
value="{{state.value}}"
type="{{type}}"
password="{{password}}"
placeholder="{{placeholder}}"
placeholderClass="ant-input-item-placeholder-base {{placeholderClassName ? placeholderClassName : ''}}"
placeholderStyle="{{placeholderStyle ? placeholderStyle : ''}}"
maxlength="{{maxLength}}"
focus="{{focus}}"
confirmType="{{confirmType}}"
confirmHold="{{confirmHold}}"
alwaysSystem="{{alwaysSystem}}"
cursor="{{cursor}}"
selectionStart="{{selectionStart}}"
selectionEnd="{{selectionEnd}}"
randomNumber="{{randomNumber}}"
onInput="onChange"
onConfirm="onConfirm"
onFocus="onFocus"
onBlur="onBlur"
></input>

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,46 @@
import { Component, triggerEvent } from '../../_util/simply';
import { InputBlurDefaultProps } from './props';
import mixinValue from '../../mixins/value';
Component(InputBlurDefaultProps, {
onChange: function (e) {
var value = e.detail.value;
if (this.isControlled()) {
this.update(value, {}, true);
}
triggerEvent(this, 'change', value, e);
},
onFocus: function (e) {
var value = e.detail.value;
this.focus = true;
triggerEvent(this, 'focus', value, e);
},
onBlur: function (e) {
var value = e.detail.value;
this.focus = false;
if (this.isControlled()) {
this.update(this.props.value);
}
triggerEvent(this, 'blur', value, e);
},
onConfirm: function (e) {
var value = e.detail.value;
triggerEvent(this, 'confirm', value, e);
},
}, undefined, [
mixinValue({
scopeKey: 'state',
transformValue: function (value, extra, updateWithoutFocusCheck) {
if (value === null || (!updateWithoutFocusCheck && this.focus)) {
return {
needUpdate: false,
};
}
return {
needUpdate: true,
value: value,
};
},
}),
], {
focus: false,
});

View File

@ -0,0 +1,3 @@
{
"component": true
}

View File

@ -0,0 +1,41 @@
import { IBaseProps } from '../../_util/base';
export type InputType = 'text' | 'number' | 'idcard' | 'digit' | 'numberpad' | 'digitpad' | 'idcardpad';
/**
* @description 输入框。
*/
export interface InputBlurProps extends IBaseProps {
value: string;
defaultValue: string;
placeholder: string;
placeholderClassName: string;
placeholderStyle: string;
enableNative: boolean;
confirmType: string;
confirmHold: string;
alwaysSystem: boolean;
selectionStart: number;
selectionEnd: number;
cursor: number;
controlled: boolean;
maxLength?: number;
inputClassName: string;
inputStyle: string;
focus?: boolean;
password: boolean;
disabled?: boolean;
/**
* @description 组件名字,用于表单提交获取数据。
*/
name?: string;
type?: InputType;
/**
* @description 当 type 为 number, digit, idcard 数字键盘是否随机排列。
* @default false
*/
randomNumber?: boolean;
onChange?: (value: string, e: any) => void;
onBlur?: (value: string, e: any) => void;
onFocus?: (value: string, e: any) => void;
onConfirm?: (value: string, e: any) => void;
}
export declare const InputBlurDefaultProps: Partial<InputBlurProps>;

View File

@ -0,0 +1,23 @@
export var InputBlurDefaultProps = {
value: null,
defaultValue: null,
placeholder: null,
placeholderClassName: '',
placeholderStyle: '',
enableNative: null,
confirmType: null,
confirmHold: null,
alwaysSystem: null,
selectionStart: null,
selectionEnd: null,
cursor: null,
controlled: null,
inputClassName: null,
inputStyle: null,
focus: null,
password: null,
disabled: null,
name: null,
type: null,
randomNumber: null,
};