first commit
This commit is contained in:
13
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/input/computed.js
vendored
Normal file
13
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/input/computed.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
function getInputClass(classPrefix, suffix, align, disabled) {
|
||||
const className = [`${classPrefix}__control`];
|
||||
if (align) {
|
||||
className.push(`${classPrefix}--${align}`);
|
||||
}
|
||||
if (disabled) {
|
||||
className.push(`${classPrefix}__control--disabled`);
|
||||
}
|
||||
return className.join(" ");
|
||||
}
|
||||
exports.getInputClass = getInputClass;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/input/computed.js.map
|
||||
336
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/input/input.js
vendored
Normal file
336
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/input/input.js
vendored
Normal file
@@ -0,0 +1,336 @@
|
||||
"use strict";
|
||||
const uni_modules_tdesignUniapp_components_common_validator = require("../common/validator.js");
|
||||
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
|
||||
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
|
||||
const uni_modules_tdesignUniapp_components_input_props = require("./props.js");
|
||||
const uni_modules_tdesignUniapp_components_common_utils = require("../common/utils.js");
|
||||
const uni_modules_tdesignUniapp_components_input_computed = require("./computed.js");
|
||||
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
|
||||
const uni_modules_tdesignUniapp_components_common_relation_parentMap = require("../common/relation/parent-map.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const TIcon = () => "../icon/icon.js";
|
||||
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-input`;
|
||||
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
|
||||
name,
|
||||
options: {
|
||||
styleIsolation: "shared"
|
||||
},
|
||||
inject: {
|
||||
[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey]: {
|
||||
default: null
|
||||
}
|
||||
},
|
||||
externalClasses: [
|
||||
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`,
|
||||
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-prefix-icon`,
|
||||
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-label`,
|
||||
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-input`,
|
||||
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-clearable`,
|
||||
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-suffix`,
|
||||
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-suffix-icon`,
|
||||
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-tips`
|
||||
],
|
||||
components: {
|
||||
TIcon
|
||||
},
|
||||
props: {
|
||||
...uni_modules_tdesignUniapp_components_input_props.props
|
||||
},
|
||||
emits: [
|
||||
"blur",
|
||||
"change",
|
||||
"clear",
|
||||
"click",
|
||||
"enter",
|
||||
"focus",
|
||||
"keyboardheightchange",
|
||||
"nicknamereview",
|
||||
"validate",
|
||||
"update:value"
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
|
||||
classPrefix: name,
|
||||
classBasePrefix: uni_modules_tdesignUniapp_components_common_config.prefix,
|
||||
showClearIcon: true,
|
||||
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools,
|
||||
dataValue: uni_modules_tdesignUniapp_components_common_utils.coalesce(this.value, this.defaultValue)
|
||||
// rawValue: '',
|
||||
// innerMaxLen: -1,
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {
|
||||
prefixIcon: {
|
||||
handler(v) {
|
||||
this._prefixIcon = uni_modules_tdesignUniapp_components_common_utils.calcIcon(v);
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
suffixIcon: {
|
||||
handler(v) {
|
||||
this._suffixIcon = uni_modules_tdesignUniapp_components_common_utils.calcIcon(v);
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
clearable: {
|
||||
handler(v) {
|
||||
this._clearIcon = uni_modules_tdesignUniapp_components_common_utils.calcIcon(v, "close-circle-filled");
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
clearTrigger: "updateClearIconVisible",
|
||||
disabled: "updateClearIconVisible",
|
||||
readonly: "updateClearIconVisible",
|
||||
value: {
|
||||
handler(v) {
|
||||
this.dataValue = v;
|
||||
uni_modules_tdesignUniapp_components_common_utils.nextTick().then(() => {
|
||||
this.dataValue = v;
|
||||
if (this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey] && this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey].onValueChange) {
|
||||
this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey].onValueChange(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const { value, defaultValue } = this;
|
||||
this.updateValue(uni_modules_tdesignUniapp_components_common_utils.coalesce(value, defaultValue, ""));
|
||||
this.updateClearIconVisible();
|
||||
},
|
||||
methods: {
|
||||
getInputClass: uni_modules_tdesignUniapp_components_input_computed.getInputClass,
|
||||
updateValue(value) {
|
||||
this.dataValue = value;
|
||||
const { allowInputOverMax, maxcharacter, maxlength } = this;
|
||||
if (!allowInputOverMax && maxcharacter && maxcharacter > 0 && !Number.isNaN(maxcharacter)) {
|
||||
const { length, characters } = uni_modules_tdesignUniapp_components_common_utils.getCharacterLength("maxcharacter", value, maxcharacter);
|
||||
uni_modules_tdesignUniapp_components_common_utils.nextTick().then(() => {
|
||||
this.dataValue = characters;
|
||||
});
|
||||
this.count = length;
|
||||
} else if (!allowInputOverMax && maxlength && maxlength > 0 && !Number.isNaN(maxlength)) {
|
||||
const { length, characters } = uni_modules_tdesignUniapp_components_common_utils.getCharacterLength("maxlength", value, maxlength);
|
||||
uni_modules_tdesignUniapp_components_common_utils.nextTick().then(() => {
|
||||
this.dataValue = characters;
|
||||
});
|
||||
this.count = length;
|
||||
} else {
|
||||
uni_modules_tdesignUniapp_components_common_utils.nextTick().then(() => {
|
||||
this.dataValue = value;
|
||||
});
|
||||
this.dataValue = value;
|
||||
this.count = uni_modules_tdesignUniapp_components_common_validator.isDef(value) ? String(value).length : 0;
|
||||
}
|
||||
},
|
||||
// updateInnerMaxLen() {
|
||||
// this.innerMaxLen = this.getInnerMaxLen();
|
||||
// },
|
||||
// getInnerMaxLen() {
|
||||
// const {
|
||||
// allowInputOverMax,
|
||||
// maxcharacter,
|
||||
// maxlength,
|
||||
// dataValue,
|
||||
// rawValue,
|
||||
// count,
|
||||
// } = this;
|
||||
// return getInnerMaxLen({
|
||||
// allowInputOverMax,
|
||||
// maxcharacter,
|
||||
// maxlength,
|
||||
// dataValue,
|
||||
// rawValue,
|
||||
// count,
|
||||
// });
|
||||
// },
|
||||
updateClearIconVisible(value = false) {
|
||||
const { clearTrigger, disabled, readonly } = this;
|
||||
if (disabled || readonly) {
|
||||
this.showClearIcon = false;
|
||||
return;
|
||||
}
|
||||
this.showClearIcon = value || clearTrigger === "always";
|
||||
},
|
||||
onInput(e) {
|
||||
const { value, cursor, keyCode } = e.detail;
|
||||
this.updateValue(value);
|
||||
this.emitChange({ value: this.dataValue, cursor, keyCode });
|
||||
},
|
||||
onChange(e) {
|
||||
if (this.type !== "nickname")
|
||||
return;
|
||||
const { value } = e.detail;
|
||||
this.updateValue(value);
|
||||
this.emitChange({ value: this.dataValue });
|
||||
},
|
||||
emitChange(data) {
|
||||
this.$emit("change", data);
|
||||
this.$emit("update:value", data.value);
|
||||
},
|
||||
onFocus(e) {
|
||||
this.updateClearIconVisible(true);
|
||||
this.$emit("focus", e.detail);
|
||||
},
|
||||
onBlur(e) {
|
||||
this.updateClearIconVisible();
|
||||
if (this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey] && this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey].onBlur) {
|
||||
this[uni_modules_tdesignUniapp_components_common_relation_parentMap.RELATION_MAP.FormKey].onBlur(this.dataValue);
|
||||
}
|
||||
if (typeof this.format === "function") {
|
||||
const v = this.format(e.detail.value);
|
||||
this.updateValue(v);
|
||||
this.$emit("blur", { value: this.dataValue, cursor: this.count });
|
||||
return;
|
||||
}
|
||||
this.$emit("blur", e.detail);
|
||||
},
|
||||
onConfirm(e) {
|
||||
this.$emit("enter", e.detail);
|
||||
},
|
||||
onSuffixClick() {
|
||||
this.$emit("click", { trigger: "suffix" });
|
||||
},
|
||||
onSuffixIconClick() {
|
||||
this.$emit("click", { trigger: "suffix-icon" });
|
||||
},
|
||||
clearInput(e) {
|
||||
this.$emit("clear", e.detail);
|
||||
this.dataValue = "";
|
||||
},
|
||||
onKeyboardHeightChange(e) {
|
||||
this.$emit("keyboardheightchange", e.detail);
|
||||
},
|
||||
onNickNameReview(e) {
|
||||
this.$emit("nicknamereview", e.detail);
|
||||
},
|
||||
onClick() {
|
||||
this.$emit("click", { trigger: "input" });
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!Array) {
|
||||
const _easycom_t_icon2 = common_vendor.resolveComponent("t-icon");
|
||||
_easycom_t_icon2();
|
||||
}
|
||||
const _easycom_t_icon = () => "../icon/icon.js";
|
||||
if (!Math) {
|
||||
_easycom_t_icon();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: _ctx._prefixIcon
|
||||
}, _ctx._prefixIcon ? {
|
||||
b: common_vendor.o(($event) => _ctx._prefixIcon.click || ""),
|
||||
c: common_vendor.p({
|
||||
["custom-style"]: _ctx._prefixIcon.style || "",
|
||||
["t-class"]: _ctx.tClassPrefixIcon,
|
||||
prefix: _ctx._prefixIcon.prefix,
|
||||
name: _ctx._prefixIcon.name,
|
||||
size: _ctx._prefixIcon.size,
|
||||
color: _ctx._prefixIcon.color,
|
||||
["aria-hidden"]: true,
|
||||
["aria-label"]: _ctx._prefixIcon.ariaLabel,
|
||||
["aria-role"]: _ctx._prefixIcon.ariaRole
|
||||
})
|
||||
} : {}, {
|
||||
d: common_vendor.n(_ctx.classPrefix + "__icon--prefix"),
|
||||
e: _ctx.label
|
||||
}, _ctx.label ? {
|
||||
f: common_vendor.t(_ctx.label)
|
||||
} : {}, {
|
||||
g: common_vendor.n(_ctx.classPrefix + "__label " + _ctx.tClassLabel),
|
||||
h: common_vendor.n(_ctx.classPrefix + "__wrap--prefix"),
|
||||
i: common_vendor.n(_ctx.getInputClass(_ctx.classPrefix, _ctx.suffix, _ctx.align, _ctx.disabled) + " " + _ctx.tClassInput),
|
||||
j: _ctx.allowInputOverMax ? -1 : _ctx.maxlength,
|
||||
k: _ctx.disabled || _ctx.readonly,
|
||||
l: _ctx.placeholder,
|
||||
m: _ctx.placeholderStyle,
|
||||
n: _ctx.tools.cls(_ctx.classPrefix + "__placeholder", [["disabled", _ctx.disabled]]) + " " + _ctx.placeholderClass,
|
||||
o: _ctx.dataValue,
|
||||
p: _ctx.type === "password",
|
||||
q: _ctx.type === "password" ? "text" : _ctx.type,
|
||||
r: _ctx.focus,
|
||||
s: _ctx.confirmType,
|
||||
t: _ctx.confirmHold,
|
||||
v: _ctx.cursor,
|
||||
w: _ctx.cursorColor,
|
||||
x: _ctx.cursorSpacing,
|
||||
y: _ctx.adjustPosition,
|
||||
z: _ctx.autoFocus,
|
||||
A: _ctx.alwaysEmbed,
|
||||
B: _ctx.selectionStart,
|
||||
C: _ctx.selectionEnd,
|
||||
D: _ctx.holdKeyboard,
|
||||
E: _ctx.safePasswordCertPath,
|
||||
F: _ctx.safePasswordLength,
|
||||
G: _ctx.safePasswordTimeStamp,
|
||||
H: _ctx.safePasswordNonce,
|
||||
I: _ctx.safePasswordSalt,
|
||||
J: _ctx.safePasswordCustomHash,
|
||||
K: _ctx.label,
|
||||
L: _ctx.label,
|
||||
M: common_vendor.o((...args) => _ctx.onInput && _ctx.onInput(...args)),
|
||||
N: common_vendor.o((...args) => _ctx.onChange && _ctx.onChange(...args)),
|
||||
O: common_vendor.o((...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
||||
P: common_vendor.o((...args) => _ctx.onBlur && _ctx.onBlur(...args)),
|
||||
Q: common_vendor.o((...args) => _ctx.onConfirm && _ctx.onConfirm(...args)),
|
||||
R: common_vendor.o((...args) => _ctx.onKeyboardHeightChange && _ctx.onKeyboardHeightChange(...args)),
|
||||
S: common_vendor.o((...args) => _ctx.onNickNameReview && _ctx.onNickNameReview(...args)),
|
||||
T: _ctx._clearIcon && _ctx.dataValue && _ctx.dataValue.length && _ctx.showClearIcon
|
||||
}, _ctx._clearIcon && _ctx.dataValue && _ctx.dataValue.length && _ctx.showClearIcon ? {
|
||||
U: common_vendor.o(($event) => _ctx._clearIcon.click || ""),
|
||||
V: common_vendor.p({
|
||||
["custom-style"]: _ctx._clearIcon.style || "",
|
||||
["t-class"]: _ctx.tClassClearable,
|
||||
prefix: _ctx._clearIcon.prefix,
|
||||
name: _ctx._clearIcon.name,
|
||||
size: _ctx._clearIcon.size,
|
||||
color: _ctx._clearIcon.color,
|
||||
["aria-hidden"]: false,
|
||||
["aria-label"]: _ctx._clearIcon.ariaLabel || "清除",
|
||||
["aria-role"]: _ctx._clearIcon.ariaRole || "button"
|
||||
}),
|
||||
W: common_vendor.n(_ctx.classPrefix + "__wrap--clearable-icon"),
|
||||
X: common_vendor.o((...args) => _ctx.clearInput && _ctx.clearInput(...args))
|
||||
} : {}, {
|
||||
Y: _ctx.suffix
|
||||
}, _ctx.suffix ? {
|
||||
Z: common_vendor.t(_ctx.suffix)
|
||||
} : {}, {
|
||||
aa: common_vendor.n(_ctx.classPrefix + "__wrap--suffix " + _ctx.tClassSuffix),
|
||||
ab: common_vendor.o((...args) => _ctx.onSuffixClick && _ctx.onSuffixClick(...args)),
|
||||
ac: _ctx._suffixIcon
|
||||
}, _ctx._suffixIcon ? {
|
||||
ad: common_vendor.o(($event) => _ctx._suffixIcon.click || ""),
|
||||
ae: common_vendor.p({
|
||||
["custom-style"]: _ctx._suffixIcon.style || "",
|
||||
["t-class"]: _ctx.tClassSuffixIcon,
|
||||
prefix: _ctx._suffixIcon.prefix,
|
||||
name: _ctx._suffixIcon.name,
|
||||
size: _ctx._suffixIcon.size,
|
||||
color: _ctx._suffixIcon.color,
|
||||
["aria-hidden"]: true,
|
||||
["aria-label"]: _ctx._suffixIcon.ariaLabel,
|
||||
["aria-role"]: _ctx._suffixIcon.ariaRole || "button"
|
||||
})
|
||||
} : {}, {
|
||||
af: common_vendor.n(_ctx.classPrefix + "__wrap--suffix-icon"),
|
||||
ag: common_vendor.o((...args) => _ctx.onSuffixIconClick && _ctx.onSuffixIconClick(...args)),
|
||||
ah: common_vendor.n(_ctx.classPrefix + "__content " + _ctx.classPrefix + "--" + _ctx.status),
|
||||
ai: common_vendor.o((...args) => _ctx.onClick && _ctx.onClick(...args)),
|
||||
aj: _ctx.tips && _ctx.tips.length > 0
|
||||
}, _ctx.tips && _ctx.tips.length > 0 ? {
|
||||
ak: common_vendor.t(_ctx.tips),
|
||||
al: common_vendor.n(_ctx.classPrefix + "__tips " + _ctx.classPrefix + "--" + _ctx.align + " " + _ctx.tClassTips)
|
||||
} : {}, {
|
||||
am: common_vendor.n(_ctx.classPrefix + "__wrap"),
|
||||
an: common_vendor.s(_ctx.tools._style([_ctx.customStyle])),
|
||||
ao: common_vendor.n(_ctx.tools.cls(_ctx.classPrefix, [["border", !_ctx.borderless], ["readonly", _ctx.readonly], ["disabled", _ctx.disabled]]) + " " + _ctx.classPrefix + "--layout-" + _ctx.layout + " " + _ctx.tClass)
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-bdad3b11"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/input/input.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/input/input.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/input/input.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-icon": "../icon/icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/input/input.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/input/input.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view style="{{an}}" class="{{['data-v-bdad3b11', ao]}}" aria-describedby><view class="{{['data-v-bdad3b11', h]}}"><view class="{{['data-v-bdad3b11', d]}}"><slot name="prefix-icon"/><block wx:if="{{a}}" name="icon"><t-icon wx:if="{{c}}" class="data-v-bdad3b11" bindclick="{{b}}" u-i="bdad3b11-0" bind:__l="__l" u-p="{{c}}"/></block></view><view class="{{['data-v-bdad3b11', g]}}" aria-hidden><slot name="label"/><block wx:if="{{e}}">{{f}}</block></view></view><view class="{{['data-v-bdad3b11', am]}}"><view class="{{['data-v-bdad3b11', ah]}}" bindtap="{{ai}}"><block wx:if="{{r0}}"><input class="{{['data-v-bdad3b11', i]}}" maxlength="{{j}}" disabled="{{k}}" placeholder="{{l}}" placeholder-style="{{m}}" placeholder-class="{{n}}" value="{{o}}" password="{{p}}" type="{{q}}" focus="{{r}}" confirm-type="{{s}}" confirm-hold="{{t}}" cursor="{{v}}" cursor-color="{{w}}" cursor-spacing="{{x}}" adjust-position="{{y}}" auto-focus="{{z}}" always-embed="{{A}}" selection-start="{{B}}" selection-end="{{C}}" hold-keyboard="{{D}}" safe-password-cert-path="{{E}}" safe-password-length="{{F}}" safe-password-time-stamp="{{G}}" safe-password-nonce="{{H}}" safe-password-salt="{{I}}" safe-password-custom-hash="{{J}}" aria-role="textbox" aria-label="{{K}}" aria-roledescription="{{L}}" bindinput="{{M}}" bindchange="{{N}}" bindfocus="{{O}}" bindblur="{{P}}" bindconfirm="{{Q}}" bindkeyboardheightchange="{{R}}" bindnicknamereview="{{S}}"></input></block><view wx:if="{{T}}" class="{{['data-v-bdad3b11', W]}}" catchtap="{{X}}"><t-icon wx:if="{{V}}" class="data-v-bdad3b11" bindclick="{{U}}" u-i="bdad3b11-1" bind:__l="__l" u-p="{{V}}"/></view><view class="{{['data-v-bdad3b11', aa]}}" bindtap="{{ab}}"><text wx:if="{{Y}}" class="data-v-bdad3b11">{{Z}}</text><slot name="suffix"/></view><view class="{{['data-v-bdad3b11', af]}}" bindtap="{{ag}}"><slot name="suffix-icon"/><block wx:if="{{ac}}" name="icon"><t-icon wx:if="{{ae}}" class="data-v-bdad3b11" bindclick="{{ad}}" u-i="bdad3b11-2" bind:__l="__l" u-p="{{ae}}"/></block></view></view><view wx:if="{{aj}}" class="{{['data-v-bdad3b11', al]}}">{{ak}}</view><slot name="tips"/></view><slot name="extra"/></view>
|
||||
173
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/input/input.wxss
vendored
Normal file
173
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/input/input.wxss
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
.t-input.data-v-bdad3b11 {
|
||||
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.data-v-bdad3b11 {
|
||||
position: relative;
|
||||
}
|
||||
.t-input--border.data-v-bdad3b11::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.data-v-bdad3b11::after {
|
||||
height: 1px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
.t-input--border.data-v-bdad3b11:after {
|
||||
left: var(--td-input-border-left-space, 32rpx);
|
||||
right: var(--td-input-border-right-space, 0);
|
||||
}
|
||||
.t-input--layout-vertical.data-v-bdad3b11 {
|
||||
flex-direction: column;
|
||||
align-items: start;
|
||||
}
|
||||
.t-input__wrap--prefix.data-v-bdad3b11 {
|
||||
display: flex;
|
||||
}
|
||||
.t-input__icon--prefix.data-v-bdad3b11 {
|
||||
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.data-v-bdad3b11:not(:empty) {
|
||||
min-width: var(--td-input-label-min-width, 2em);
|
||||
max-width: var(--td-input-label-max-width, 5em);
|
||||
font: var(--td-input-label-text-font, var(--td-font-body-large, 32rpx / 48rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular)));
|
||||
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.data-v-bdad3b11:not(:empty) {
|
||||
font-size: var(--td-font-size-base, 28rpx);
|
||||
padding-bottom: 8rpx;
|
||||
}
|
||||
.t-input__icon--prefix:not(:empty) + .t-input__label.data-v-bdad3b11:not(:empty) {
|
||||
padding-left: 8rpx;
|
||||
}
|
||||
.t-input__label:not(:empty) + .t-input__wrap.data-v-bdad3b11 {
|
||||
margin-left: var(--td-spacer-2, 32rpx);
|
||||
}
|
||||
.t-input__icon--prefix:not(:empty) + .t-input__label.data-v-bdad3b11:empty {
|
||||
margin-right: var(--td-spacer-2, 32rpx);
|
||||
}
|
||||
.t-input__wrap.data-v-bdad3b11 {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
flex-shrink: 1;
|
||||
flex: 1;
|
||||
}
|
||||
.t-input__wrap .t-input__content.data-v-bdad3b11 {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
font: var(--td-font-body-large, 32rpx / 48rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular));
|
||||
}
|
||||
.t-input__wrap--clearable-icon.data-v-bdad3b11,
|
||||
.t-input__wrap--suffix-icon.data-v-bdad3b11,
|
||||
.t-input__wrap--suffix.data-v-bdad3b11 {
|
||||
flex: 0 0 auto;
|
||||
padding-left: var(--td-spacer-1, 24rpx);
|
||||
}
|
||||
.t-input__wrap--clearable-icon.data-v-bdad3b11:empty,
|
||||
.t-input__wrap--suffix-icon.data-v-bdad3b11:empty,
|
||||
.t-input__wrap--suffix.data-v-bdad3b11:empty {
|
||||
display: none;
|
||||
}
|
||||
.t-input__wrap--clearable-icon.data-v-bdad3b11,
|
||||
.t-input__wrap--suffix-icon.data-v-bdad3b11 {
|
||||
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.data-v-bdad3b11 {
|
||||
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.data-v-bdad3b11:empty,
|
||||
.t-input__tips.data-v-bdad3b11:empty,
|
||||
.t-input__wrap--clearable-icon.data-v-bdad3b11:empty,
|
||||
.t-input__wrap--suffix-icon.data-v-bdad3b11:empty,
|
||||
.t-input__wrap--suffix.data-v-bdad3b11:empty {
|
||||
display: none;
|
||||
}
|
||||
.t-input__control.data-v-bdad3b11 {
|
||||
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.data-v-bdad3b11 {
|
||||
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.data-v-bdad3b11 {
|
||||
cursor: default;
|
||||
}
|
||||
.t-input--left.data-v-bdad3b11 {
|
||||
text-align: left;
|
||||
}
|
||||
.t-input--right.data-v-bdad3b11 {
|
||||
text-align: right;
|
||||
}
|
||||
.t-input--center.data-v-bdad3b11 {
|
||||
text-align: center;
|
||||
}
|
||||
.t-input__placeholder.data-v-bdad3b11 {
|
||||
color: var(--td-input-placeholder-text-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
|
||||
font: var(--td-input-placeholder-text-font, var(--td-font-body-large, 32rpx / 48rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular)));
|
||||
}
|
||||
.t-input__placeholder--disabled.data-v-bdad3b11 {
|
||||
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.data-v-bdad3b11 {
|
||||
font: var(--td-font-body-small, 24rpx / 40rpx var(--td-font-family, PingFang SC, Microsoft YaHei, Arial Regular));
|
||||
padding-top: 8rpx;
|
||||
}
|
||||
.t-input--default + .t-input__tips.data-v-bdad3b11 {
|
||||
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.data-v-bdad3b11 {
|
||||
color: var(--td-input-success-tips-color, var(--td-success-color, var(--td-success-color-5, #2ba471)));
|
||||
}
|
||||
.t-input--warning + .t-input__tips.data-v-bdad3b11 {
|
||||
color: var(--td-input-warning-tips-color, var(--td-warning-color, var(--td-warning-color-5, #e37318)));
|
||||
}
|
||||
.t-input--error + .t-input__tips.data-v-bdad3b11 {
|
||||
color: var(--td-input-error-tips-color, var(--td-error-color, var(--td-error-color-6, #d54941)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
249
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/input/props.js
vendored
Normal file
249
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/input/props.js
vendored
Normal file
@@ -0,0 +1,249 @@
|
||||
"use strict";
|
||||
const props = {
|
||||
/** 键盘弹起时,是否自动上推页面 */
|
||||
adjustPosition: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
/** 文本内容位置,居左/居中/居右 */
|
||||
align: {
|
||||
type: String,
|
||||
default: "left",
|
||||
validator(val) {
|
||||
if (!val)
|
||||
return true;
|
||||
return ["left", "center", "right"].includes(val);
|
||||
}
|
||||
},
|
||||
/** 超出 `maxlength` 或 `maxcharacter` 之后是否允许继续输入 */
|
||||
allowInputOverMax: Boolean,
|
||||
/** 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效) */
|
||||
alwaysEmbed: Boolean,
|
||||
/** (即将废弃,请直接使用 focus )自动聚焦,拉起键盘 */
|
||||
autoFocus: Boolean,
|
||||
/** 是否开启无边框模式 */
|
||||
borderless: Boolean,
|
||||
/** 清空图标触发方式,仅在输入框有值时有效 */
|
||||
clearTrigger: {
|
||||
type: String,
|
||||
default: "always",
|
||||
validator(val) {
|
||||
if (!val)
|
||||
return true;
|
||||
return ["always", "focus"].includes(val);
|
||||
}
|
||||
},
|
||||
/** 是否可清空,默认不启动。值为 `true` 表示使用默认清空按钮,值为 `Object` 表示透传至 `icon` */
|
||||
clearable: {
|
||||
type: [Boolean, Object],
|
||||
default: false
|
||||
},
|
||||
/** 点击键盘右下角按钮时是否保持键盘不收起 */
|
||||
confirmHold: Boolean,
|
||||
/** 设置键盘右下角按钮的文字,仅在type='text'时生效。<br />具体释义:<br />`send` 右下角按钮为“发送”;<br />`search` 右下角按钮为“搜索”;<br />`next` 右下角按钮为“下一个”;<br />`go` 右下角按钮为“前往”;<br />`done` 右下角按钮为“完成”。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/input.html) */
|
||||
confirmType: {
|
||||
type: String,
|
||||
default: "done",
|
||||
validator(val) {
|
||||
if (!val)
|
||||
return true;
|
||||
return ["send", "search", "next", "go", "done"].includes(val);
|
||||
}
|
||||
},
|
||||
/** 指定 focus 时的光标位置 */
|
||||
cursor: {
|
||||
type: Number,
|
||||
default: -1
|
||||
},
|
||||
/** 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制 */
|
||||
cursorColor: {
|
||||
type: String,
|
||||
default: "#0052d9"
|
||||
},
|
||||
/** 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 */
|
||||
cursorSpacing: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
/** 是否禁用输入框 */
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: void 0
|
||||
},
|
||||
/** 获取焦点 */
|
||||
focus: Boolean,
|
||||
/** 指定输入框展示值的格式 */
|
||||
format: {
|
||||
type: Function
|
||||
},
|
||||
/** focus时,点击页面的时候不收起键盘 */
|
||||
holdKeyboard: Boolean,
|
||||
/** 左侧文本 */
|
||||
label: {
|
||||
type: String
|
||||
},
|
||||
/** 标题输入框布局方式 */
|
||||
layout: {
|
||||
type: String,
|
||||
default: "horizontal",
|
||||
validator(val) {
|
||||
if (!val)
|
||||
return true;
|
||||
return ["vertical", "horizontal"].includes(val);
|
||||
}
|
||||
},
|
||||
/** 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 */
|
||||
maxcharacter: {
|
||||
type: Number
|
||||
},
|
||||
/** 用户最多可以输入的文本长度,一个中文等于一个计数长度。默认为 -1,不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用 */
|
||||
maxlength: {
|
||||
type: Number,
|
||||
default: -1
|
||||
},
|
||||
/** 占位符 */
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: void 0
|
||||
},
|
||||
/** 指定 placeholder 的样式类 */
|
||||
placeholderClass: {
|
||||
type: String,
|
||||
default: "input-placeholder"
|
||||
},
|
||||
/** 指定 placeholder 的样式 */
|
||||
placeholderStyle: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
/** 组件前置图标。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon` */
|
||||
prefixIcon: {
|
||||
type: [String, Object]
|
||||
},
|
||||
/** 只读状态 */
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: void 0
|
||||
},
|
||||
/** 安全键盘加密公钥的路径,只支持包内路径 */
|
||||
safePasswordCertPath: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
/** 安全键盘计算 hash 的算法表达式,如 `md5(sha1('foo' + sha256(sm3(password + 'bar'))))` */
|
||||
safePasswordCustomHash: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
/** 安全键盘输入密码长度 */
|
||||
safePasswordLength: {
|
||||
type: Number
|
||||
},
|
||||
/** 安全键盘加密盐值 */
|
||||
safePasswordNonce: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
/** 安全键盘计算 hash 盐值,若指定custom-hash 则无效 */
|
||||
safePasswordSalt: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
/** 安全键盘加密时间戳 */
|
||||
safePasswordTimeStamp: {
|
||||
type: Number
|
||||
},
|
||||
/** 光标结束位置,自动聚集时有效,需与 selection-start 搭配使用 */
|
||||
selectionEnd: {
|
||||
type: Number,
|
||||
default: -1
|
||||
},
|
||||
/** 光标起始位置,自动聚集时有效,需与 selection-end 搭配使用 */
|
||||
selectionStart: {
|
||||
type: Number,
|
||||
default: -1
|
||||
},
|
||||
/** 输入框状态 */
|
||||
status: {
|
||||
type: String,
|
||||
default: "default",
|
||||
validator(val) {
|
||||
if (!val)
|
||||
return true;
|
||||
return ["default", "success", "warning", "error"].includes(val);
|
||||
}
|
||||
},
|
||||
/** 后置图标前的后置内容 */
|
||||
suffix: {
|
||||
type: String
|
||||
},
|
||||
/** 后置文本内容。值为字符串则表示图标名称,值为 `Object` 类型,表示透传至 `icon` */
|
||||
suffixIcon: {
|
||||
type: [String, Object]
|
||||
},
|
||||
/** 输入框下方提示文本,会根据不同的 `status` 呈现不同的样式 */
|
||||
tips: {
|
||||
type: String
|
||||
},
|
||||
/** 输入框类型 */
|
||||
type: {
|
||||
type: String,
|
||||
default: "text",
|
||||
validator(val) {
|
||||
if (!val)
|
||||
return true;
|
||||
return ["text", "number", "idcard", "digit", "safe-password", "password", "nickname"].includes(val);
|
||||
}
|
||||
},
|
||||
/** 输入框的值 */
|
||||
value: {
|
||||
type: [String, Number]
|
||||
},
|
||||
/** 失去焦点时触发 */
|
||||
onBlur: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
/** 输入框值发生变化时触发;cursor 为光标位置; */
|
||||
onChange: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
/** 清空按钮点击时触发 */
|
||||
onClear: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
/** 点击事件。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts)。 */
|
||||
onClick: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
/** 回车键按下时触发 */
|
||||
onEnter: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
/** 获得焦点时触发 */
|
||||
onFocus: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
/** 键盘高度发生变化的时候触发此事件 */
|
||||
onKeyboardheightchange: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
/** 用户昵称审核完毕后触发,仅在 type 为 "nickname" 时有效 */
|
||||
onNicknamereview: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
/** 字数超出限制时触发 */
|
||||
onValidate: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
}
|
||||
};
|
||||
exports.props = props;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/input/props.js.map
|
||||
Reference in New Issue
Block a user