白色主题

This commit is contained in:
2023-02-12 19:04:01 +08:00
parent d736a5912f
commit 57ab6fbb49
411 changed files with 1752 additions and 5304 deletions

View File

@@ -31,37 +31,55 @@ let Textarea = class Textarea extends SuperComponent {
};
this.observers = {
value(val) {
this.updateValue(val);
this.updateCount(val);
},
};
this.lifetimes = {
ready() {
const { value } = this.properties;
this.updateValue(value);
},
};
this.methods = {
updateValue(value) {
updateCount(val) {
const { maxcharacter, maxlength } = this.properties;
const { count } = this.calculateValue(val, maxcharacter, maxlength);
this.setData({
count,
});
},
updateValue(val) {
const { maxcharacter, maxlength } = this.properties;
const { value, count } = this.calculateValue(val, maxcharacter, maxlength);
this.setData({
value,
count,
});
},
calculateValue(value, maxcharacter, maxlength) {
if (maxcharacter > 0 && !Number.isNaN(maxcharacter)) {
const { length, characters } = getCharacterLength('maxcharacter', value, maxcharacter);
this.setData({
computedValue: characters,
return {
value: characters,
count: length,
});
};
}
else if (maxlength > 0 && !Number.isNaN(maxlength)) {
if (maxlength > 0 && !Number.isNaN(maxlength)) {
const { length, characters } = getCharacterLength('maxlength', value, maxlength);
this.setData({
computedValue: characters,
return {
value: characters,
count: length,
});
}
else {
this.setData({
computedValue: value,
count: value ? String(value).length : 0,
});
};
}
return {
value,
count: value ? String(value).length : 0,
};
},
onInput(event) {
const { value } = event.detail;
this.updateValue(value);
this.triggerEvent('change', { value: this.data.computedValue });
this.triggerEvent('change', { value: this.data.value });
},
onFocus(event) {
this.triggerEvent('focus', Object.assign({}, event.detail));
@@ -75,6 +93,9 @@ let Textarea = class Textarea extends SuperComponent {
onLineChange(event) {
this.triggerEvent('lineChange', Object.assign({}, event.detail));
},
onKeyboardHeightChange(e) {
this.triggerEvent('keyboardheightchange', e.detail);
},
};
}
};