提交 50a55241 编写于 作者: fxy060608's avatar fxy060608

chore: build

上级 5cc22066
......@@ -2903,6 +2903,10 @@ const props$k = /* @__PURE__ */ shared.extend({}, {
confirmHold: {
type: Boolean,
default: false
},
ignoreCompositionEvent: {
type: Boolean,
default: true
}
}, props$n);
const emit = [
......@@ -2912,6 +2916,9 @@ const emit = [
"update:value",
"update:modelValue",
"update:focus",
"compositionstart",
"compositionupdate",
"compositionend",
...emit$1
];
function useBase(props2, rootRef, emit2) {
......@@ -3006,7 +3013,7 @@ function useAutoFocus(props2, fieldRef) {
}
});
}
function useEvent(fieldRef, state, trigger, triggerInput, beforeInput) {
function useEvent(fieldRef, state, props2, trigger, triggerInput, beforeInput) {
function checkSelection() {
const field = fieldRef.value;
if (field && state.focus && state.selectionStart > -1 && state.selectionEnd > -1 && field.type !== "number") {
......@@ -3043,7 +3050,7 @@ function useEvent(fieldRef, state, trigger, triggerInput, beforeInput) {
return;
}
state.value = field.value;
if (!state.composing) {
if (!state.composing || !props2.ignoreCompositionEvent) {
triggerInput(event, {
value: field.value,
cursor: getFieldSelectionEnd(field)
......@@ -3068,6 +3075,7 @@ function useEvent(fieldRef, state, trigger, triggerInput, beforeInput) {
field.addEventListener("compositionstart", (event) => {
event.stopPropagation();
state.composing = true;
_onComposition(event);
});
field.addEventListener("compositionend", (event) => {
event.stopPropagation();
......@@ -3075,7 +3083,16 @@ function useEvent(fieldRef, state, trigger, triggerInput, beforeInput) {
state.composing = false;
onInput(event);
}
_onComposition(event);
});
field.addEventListener("compositionupdate", _onComposition);
function _onComposition(event) {
if (!props2.ignoreCompositionEvent) {
trigger(event.type, event, {
value: event.data
});
}
}
}
vue.watch([() => state.selectionStart, () => state.selectionEnd], checkSelection);
vue.watch(() => state.cursor, checkCursor);
......@@ -3089,7 +3106,7 @@ function useField(props2, rootRef, emit2, beforeInput) {
useKeyboard$1(props2, fieldRef);
const { state: scopedAttrsState } = useScopedAttrs();
useFormField("name", state);
useEvent(fieldRef, state, trigger, triggerInput, beforeInput);
useEvent(fieldRef, state, props2, trigger, triggerInput, beforeInput);
const fixDisabledColor = false;
return {
fieldRef,
......@@ -6408,7 +6425,7 @@ let fixMargin = false;
var index$i = /* @__PURE__ */ defineBuiltInComponent({
name: "Textarea",
props: props$a,
emit: ["confirm", "linechange", ...emit],
emits: ["confirm", "linechange", ...emit],
setup(props2, {
emit: emit2
}) {
......
......@@ -8449,6 +8449,10 @@ const props$r = /* @__PURE__ */ extend({}, {
confirmHold: {
type: Boolean,
default: false
},
ignoreCompositionEvent: {
type: Boolean,
default: true
}
}, props$u);
const emit = [
......@@ -8458,6 +8462,9 @@ const emit = [
"update:value",
"update:modelValue",
"update:focus",
"compositionstart",
"compositionupdate",
"compositionend",
...emit$1
];
function useBase(props2, rootRef, emit2) {
......@@ -8561,7 +8568,7 @@ function useAutoFocus(props2, fieldRef) {
}
});
}
function useEvent(fieldRef, state2, trigger, triggerInput, beforeInput) {
function useEvent(fieldRef, state2, props2, trigger, triggerInput, beforeInput) {
function checkSelection() {
const field = fieldRef.value;
if (field && state2.focus && state2.selectionStart > -1 && state2.selectionEnd > -1 && field.type !== "number") {
......@@ -8598,7 +8605,7 @@ function useEvent(fieldRef, state2, trigger, triggerInput, beforeInput) {
return;
}
state2.value = field.value;
if (!state2.composing) {
if (!state2.composing || !props2.ignoreCompositionEvent) {
triggerInput(event, {
value: field.value,
cursor: getFieldSelectionEnd(field)
......@@ -8623,6 +8630,7 @@ function useEvent(fieldRef, state2, trigger, triggerInput, beforeInput) {
field.addEventListener("compositionstart", (event) => {
event.stopPropagation();
state2.composing = true;
_onComposition(event);
});
field.addEventListener("compositionend", (event) => {
event.stopPropagation();
......@@ -8630,7 +8638,16 @@ function useEvent(fieldRef, state2, trigger, triggerInput, beforeInput) {
state2.composing = false;
onInput(event);
}
_onComposition(event);
});
field.addEventListener("compositionupdate", _onComposition);
function _onComposition(event) {
if (!props2.ignoreCompositionEvent) {
trigger(event.type, event, {
value: event.data
});
}
}
}
watch([() => state2.selectionStart, () => state2.selectionEnd], checkSelection);
watch(() => state2.cursor, checkCursor);
......@@ -8644,7 +8661,7 @@ function useField(props2, rootRef, emit2, beforeInput) {
useKeyboard$1(props2, fieldRef);
const { state: scopedAttrsState } = useScopedAttrs();
useFormField("name", state2);
useEvent(fieldRef, state2, trigger, triggerInput, beforeInput);
useEvent(fieldRef, state2, props2, trigger, triggerInput, beforeInput);
const fixDisabledColor = String(navigator.vendor).indexOf("Apple") === 0 && CSS.supports("image-orientation:from-image");
return {
fieldRef,
......@@ -13397,7 +13414,7 @@ function setFixMargin() {
var index$i = /* @__PURE__ */ defineBuiltInComponent({
name: "Textarea",
props: props$h,
emit: ["confirm", "linechange", ...emit],
emits: ["confirm", "linechange", ...emit],
setup(props2, {
emit: emit2
}) {
......
......@@ -22,8 +22,7 @@ const ON_BACK_PRESS = 'onBackPress';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const ON_SHARE_APP_MESSAGE = 'onShareAppMessage';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const customizeRE = /:/g;
function customizeEvent(str) {
......@@ -315,9 +314,6 @@ const HOOKS = [
ON_PAGE_NOT_FOUND,
ON_UNHANDLE_REJECTION,
];
{
HOOKS.push(ON_SHARE_APP_MESSAGE);
}
function parseApp(instance, parseAppOptions) {
const internalInstance = instance.$;
const appOptions = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册