优化
This commit is contained in:
@@ -50,8 +50,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
k: $props.weeks.beforeMultiple ? 1 : "",
|
||||
l: $props.weeks.multiple ? 1 : "",
|
||||
m: $props.weeks.afterMultiple ? 1 : "",
|
||||
n: common_vendor.o$1(($event) => $options.choiceDate($props.weeks)),
|
||||
o: common_vendor.o$1(($event) => $options.handleMousemove($props.weeks))
|
||||
n: common_vendor.o(($event) => $options.choiceDate($props.weeks)),
|
||||
o: common_vendor.o(($event) => $options.handleMousemove($props.weeks))
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
|
||||
@@ -503,18 +503,18 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
a: !$props.insert && $data.show
|
||||
}, !$props.insert && $data.show ? {
|
||||
b: $data.aniMaskShow ? 1 : "",
|
||||
c: common_vendor.o$1((...args) => $options.maskClick && $options.maskClick(...args))
|
||||
c: common_vendor.o((...args) => $options.maskClick && $options.maskClick(...args))
|
||||
} : {}, {
|
||||
d: $props.insert || $data.show
|
||||
}, $props.insert || $data.show ? common_vendor.e({
|
||||
e: common_vendor.o$1(($event) => $options.changeMonth("pre")),
|
||||
e: common_vendor.o(($event) => $options.changeMonth("pre")),
|
||||
f: common_vendor.t(($data.nowDate.year || "") + $options.yearText + ($data.nowDate.month || "") + $options.monthText),
|
||||
g: $props.date,
|
||||
h: common_vendor.o$1((...args) => $options.bindDateChange && $options.bindDateChange(...args)),
|
||||
i: common_vendor.o$1(($event) => $options.changeMonth("next")),
|
||||
h: common_vendor.o((...args) => $options.bindDateChange && $options.bindDateChange(...args)),
|
||||
i: common_vendor.o(($event) => $options.changeMonth("next")),
|
||||
j: !$props.insert
|
||||
}, !$props.insert ? {
|
||||
k: common_vendor.o$1((...args) => $options.maskClick && $options.maskClick(...args))
|
||||
k: common_vendor.o((...args) => $options.maskClick && $options.maskClick(...args))
|
||||
} : {}, {
|
||||
l: !$props.insert ? 1 : "",
|
||||
m: $props.showMonth
|
||||
@@ -532,8 +532,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.f(item, (weeks, weeksIndex, i1) => {
|
||||
return {
|
||||
a: common_vendor.o$1($options.choiceDate, weeksIndex),
|
||||
b: common_vendor.o$1($options.handleMouse, weeksIndex),
|
||||
a: common_vendor.o($options.choiceDate, weeksIndex),
|
||||
b: common_vendor.o($options.handleMouse, weeksIndex),
|
||||
c: "9e80a514-0-" + i0 + "-" + i1,
|
||||
d: common_vendor.p({
|
||||
weeks,
|
||||
@@ -550,7 +550,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
x: !$props.insert && !$props.range && $props.hasTime
|
||||
}, !$props.insert && !$props.range && $props.hasTime ? {
|
||||
y: common_vendor.t($data.tempSingleDate ? $data.tempSingleDate : $options.selectDateText),
|
||||
z: common_vendor.o$1(($event) => $data.time = $event),
|
||||
z: common_vendor.o(($event) => $data.time = $event),
|
||||
A: common_vendor.p({
|
||||
type: "time",
|
||||
start: $options.timepickerStartTime,
|
||||
@@ -564,7 +564,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
B: !$props.insert && $props.range && $props.hasTime
|
||||
}, !$props.insert && $props.range && $props.hasTime ? {
|
||||
C: common_vendor.t($data.tempRange.before ? $data.tempRange.before : $options.startDateText),
|
||||
D: common_vendor.o$1(($event) => $data.timeRange.startTime = $event),
|
||||
D: common_vendor.o(($event) => $data.timeRange.startTime = $event),
|
||||
E: common_vendor.p({
|
||||
type: "time",
|
||||
start: $options.timepickerStartTime,
|
||||
@@ -578,7 +578,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
color: "#999"
|
||||
}),
|
||||
G: common_vendor.t($data.tempRange.after ? $data.tempRange.after : $options.endDateText),
|
||||
H: common_vendor.o$1(($event) => $data.timeRange.endTime = $event),
|
||||
H: common_vendor.o(($event) => $data.timeRange.endTime = $event),
|
||||
I: common_vendor.p({
|
||||
type: "time",
|
||||
end: $options.timepickerEndTime,
|
||||
@@ -591,13 +591,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
J: !$props.insert
|
||||
}, !$props.insert ? {
|
||||
K: common_vendor.t($options.confirmText),
|
||||
L: common_vendor.o$1((...args) => $options.confirm && $options.confirm(...args))
|
||||
L: common_vendor.o((...args) => $options.confirm && $options.confirm(...args))
|
||||
} : {}, {
|
||||
M: !$props.insert ? 1 : "",
|
||||
N: $data.aniMaskShow ? 1 : "",
|
||||
O: $data.aniMaskShow ? 1 : ""
|
||||
}) : {}, {
|
||||
P: common_vendor.o$1((...args) => $options.leaveCale && $options.leaveCale(...args))
|
||||
P: common_vendor.o((...args) => $options.leaveCale && $options.leaveCale(...args))
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
|
||||
@@ -618,10 +618,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
} : {}, {
|
||||
d: $props.disabled ? 1 : "",
|
||||
e: $props.border ? 1 : "",
|
||||
f: common_vendor.o$1((...args) => $options.initTimePicker && $options.initTimePicker(...args)),
|
||||
f: common_vendor.o((...args) => $options.initTimePicker && $options.initTimePicker(...args)),
|
||||
g: $data.visible
|
||||
}, $data.visible ? {
|
||||
h: common_vendor.o$1((...args) => $options.tiggerTimePicker && $options.tiggerTimePicker(...args))
|
||||
h: common_vendor.o((...args) => $options.tiggerTimePicker && $options.tiggerTimePicker(...args))
|
||||
} : {}, {
|
||||
i: $data.visible
|
||||
}, $data.visible ? common_vendor.e({
|
||||
@@ -648,7 +648,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
}),
|
||||
o: $data.indicatorStyle,
|
||||
p: $options.ymd,
|
||||
q: common_vendor.o$1((...args) => $options.bindDateChange && $options.bindDateChange(...args))
|
||||
q: common_vendor.o((...args) => $options.bindDateChange && $options.bindDateChange(...args))
|
||||
} : {}, {
|
||||
r: $data.timeShow
|
||||
}, $data.timeShow ? common_vendor.e({
|
||||
@@ -676,16 +676,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
x: common_vendor.n($props.hideSecond ? "time-hide-second" : ""),
|
||||
y: $data.indicatorStyle,
|
||||
z: $options.hms,
|
||||
A: common_vendor.o$1((...args) => $options.bindTimeChange && $options.bindTimeChange(...args)),
|
||||
A: common_vendor.o((...args) => $options.bindTimeChange && $options.bindTimeChange(...args)),
|
||||
B: common_vendor.n($props.hideSecond ? "sign-center" : "sign-left"),
|
||||
C: !$props.hideSecond
|
||||
}, !$props.hideSecond ? {} : {}) : {}, {
|
||||
D: common_vendor.t($options.clearText),
|
||||
E: common_vendor.o$1((...args) => $options.clearTime && $options.clearTime(...args)),
|
||||
E: common_vendor.o((...args) => $options.clearTime && $options.clearTime(...args)),
|
||||
F: common_vendor.t($options.cancelText),
|
||||
G: common_vendor.o$1((...args) => $options.tiggerTimePicker && $options.tiggerTimePicker(...args)),
|
||||
G: common_vendor.o((...args) => $options.tiggerTimePicker && $options.tiggerTimePicker(...args)),
|
||||
H: common_vendor.t($options.okText),
|
||||
I: common_vendor.o$1((...args) => $options.setTime && $options.setTime(...args)),
|
||||
I: common_vendor.o((...args) => $options.setTime && $options.setTime(...args)),
|
||||
J: common_vendor.n($data.dateShow && $data.timeShow ? "" : "fix-nvue-height"),
|
||||
K: common_vendor.s($data.fixNvueBug)
|
||||
}) : {});
|
||||
|
||||
@@ -704,13 +704,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
color: "#c0c4cc",
|
||||
size: "22"
|
||||
}),
|
||||
j: common_vendor.o$1((...args) => $options.clear && $options.clear(...args))
|
||||
j: common_vendor.o((...args) => $options.clear && $options.clear(...args))
|
||||
} : {}, {
|
||||
k: $props.disabled ? 1 : "",
|
||||
l: $props.border ? 1 : "",
|
||||
m: common_vendor.o$1((...args) => $options.show && $options.show(...args)),
|
||||
m: common_vendor.o((...args) => $options.show && $options.show(...args)),
|
||||
n: $data.pickerVisible,
|
||||
o: common_vendor.o$1((...args) => $options.close && $options.close(...args)),
|
||||
o: common_vendor.o((...args) => $options.close && $options.close(...args)),
|
||||
p: !$data.isPhone
|
||||
}, !$data.isPhone ? common_vendor.e({
|
||||
q: !$data.isRange
|
||||
@@ -719,12 +719,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
}, $data.hasTime ? {
|
||||
s: $options.selectDateText,
|
||||
t: $data.inputDate,
|
||||
v: common_vendor.o$1(($event) => $data.inputDate = $event.detail.value),
|
||||
v: common_vendor.o(($event) => $data.inputDate = $event.detail.value),
|
||||
w: $options.selectTimeText,
|
||||
x: !$data.inputDate,
|
||||
y: $data.pickerTime,
|
||||
z: common_vendor.o$1(($event) => $data.pickerTime = $event.detail.value),
|
||||
A: common_vendor.o$1(($event) => $data.pickerTime = $event),
|
||||
z: common_vendor.o(($event) => $data.pickerTime = $event.detail.value),
|
||||
A: common_vendor.o(($event) => $data.pickerTime = $event),
|
||||
B: common_vendor.p({
|
||||
type: "time",
|
||||
border: false,
|
||||
@@ -736,7 +736,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
})
|
||||
} : {}, {
|
||||
C: common_vendor.sr("pcSingle", "347f72bb-4"),
|
||||
D: common_vendor.o$1($options.singleChange),
|
||||
D: common_vendor.o($options.singleChange),
|
||||
E: common_vendor.p({
|
||||
showMonth: false,
|
||||
["start-date"]: $data.calendarRange.startDate,
|
||||
@@ -747,7 +747,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
F: $data.hasTime
|
||||
}, $data.hasTime ? {
|
||||
G: common_vendor.t($options.okText),
|
||||
H: common_vendor.o$1((...args) => $options.confirmSingleChange && $options.confirmSingleChange(...args))
|
||||
H: common_vendor.o((...args) => $options.confirmSingleChange && $options.confirmSingleChange(...args))
|
||||
} : {}, {
|
||||
I: common_vendor.s($data.pickerPositionStyle)
|
||||
}) : common_vendor.e({
|
||||
@@ -755,12 +755,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
}, $data.hasTime ? {
|
||||
K: $options.startDateText,
|
||||
L: $data.tempRange.startDate,
|
||||
M: common_vendor.o$1(($event) => $data.tempRange.startDate = $event.detail.value),
|
||||
M: common_vendor.o(($event) => $data.tempRange.startDate = $event.detail.value),
|
||||
N: $options.startTimeText,
|
||||
O: !$data.tempRange.startDate,
|
||||
P: $data.tempRange.startTime,
|
||||
Q: common_vendor.o$1(($event) => $data.tempRange.startTime = $event.detail.value),
|
||||
R: common_vendor.o$1(($event) => $data.tempRange.startTime = $event),
|
||||
Q: common_vendor.o(($event) => $data.tempRange.startTime = $event.detail.value),
|
||||
R: common_vendor.o(($event) => $data.tempRange.startTime = $event),
|
||||
S: common_vendor.p({
|
||||
type: "time",
|
||||
start: $options.timepickerStartTime,
|
||||
@@ -775,12 +775,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
}),
|
||||
U: $options.endDateText,
|
||||
V: $data.tempRange.endDate,
|
||||
W: common_vendor.o$1(($event) => $data.tempRange.endDate = $event.detail.value),
|
||||
W: common_vendor.o(($event) => $data.tempRange.endDate = $event.detail.value),
|
||||
X: $options.endTimeText,
|
||||
Y: !$data.tempRange.endDate,
|
||||
Z: $data.tempRange.endTime,
|
||||
aa: common_vendor.o$1(($event) => $data.tempRange.endTime = $event.detail.value),
|
||||
ab: common_vendor.o$1(($event) => $data.tempRange.endTime = $event),
|
||||
aa: common_vendor.o(($event) => $data.tempRange.endTime = $event.detail.value),
|
||||
ab: common_vendor.o(($event) => $data.tempRange.endTime = $event),
|
||||
ac: common_vendor.p({
|
||||
type: "time",
|
||||
end: $options.timepickerEndTime,
|
||||
@@ -791,8 +791,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
})
|
||||
} : {}, {
|
||||
ad: common_vendor.sr("left", "347f72bb-8"),
|
||||
ae: common_vendor.o$1($options.leftChange),
|
||||
af: common_vendor.o$1($options.updateRightCale),
|
||||
ae: common_vendor.o($options.leftChange),
|
||||
af: common_vendor.o($options.updateRightCale),
|
||||
ag: common_vendor.p({
|
||||
showMonth: false,
|
||||
["start-date"]: $data.calendarRange.startDate,
|
||||
@@ -801,8 +801,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
pleStatus: $data.endMultipleStatus
|
||||
}),
|
||||
ah: common_vendor.sr("right", "347f72bb-9"),
|
||||
ai: common_vendor.o$1($options.rightChange),
|
||||
aj: common_vendor.o$1($options.updateLeftCale),
|
||||
ai: common_vendor.o($options.rightChange),
|
||||
aj: common_vendor.o($options.updateLeftCale),
|
||||
ak: common_vendor.p({
|
||||
showMonth: false,
|
||||
["start-date"]: $data.calendarRange.startDate,
|
||||
@@ -813,9 +813,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
al: $data.hasTime
|
||||
}, $data.hasTime ? {
|
||||
am: common_vendor.t($options.clearText),
|
||||
an: common_vendor.o$1((...args) => $options.clear && $options.clear(...args)),
|
||||
an: common_vendor.o((...args) => $options.clear && $options.clear(...args)),
|
||||
ao: common_vendor.t($options.okText),
|
||||
ap: common_vendor.o$1((...args) => $options.confirmRangeChange && $options.confirmRangeChange(...args))
|
||||
ap: common_vendor.o((...args) => $options.confirmRangeChange && $options.confirmRangeChange(...args))
|
||||
} : {}, {
|
||||
aq: common_vendor.s($data.pickerPositionStyle)
|
||||
}), {
|
||||
@@ -824,9 +824,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
as: $data.isPhone
|
||||
}, $data.isPhone ? {
|
||||
at: common_vendor.sr("mobile", "347f72bb-10"),
|
||||
av: common_vendor.o$1($options.mobileChange),
|
||||
aw: common_vendor.o$1($options.close),
|
||||
ax: common_vendor.o$1($options.calendarClick),
|
||||
av: common_vendor.o($options.mobileChange),
|
||||
aw: common_vendor.o($options.close),
|
||||
ax: common_vendor.o($options.calendarClick),
|
||||
ay: common_vendor.p({
|
||||
clearDate: false,
|
||||
date: $data.calendarDate,
|
||||
|
||||
@@ -387,7 +387,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: $props.prefixIcon
|
||||
}, $props.prefixIcon ? {
|
||||
b: common_vendor.o$1(($event) => $options.onClickIcon("prefix")),
|
||||
b: common_vendor.o(($event) => $options.onClickIcon("prefix")),
|
||||
c: common_vendor.p({
|
||||
type: $props.prefixIcon,
|
||||
color: "#c0c4cc",
|
||||
@@ -407,11 +407,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
m: $props.autoHeight,
|
||||
n: $props.cursorSpacing,
|
||||
o: $props.adjustPosition,
|
||||
p: common_vendor.o$1((...args) => $options.onInput && $options.onInput(...args)),
|
||||
q: common_vendor.o$1((...args) => $options._Blur && $options._Blur(...args)),
|
||||
r: common_vendor.o$1((...args) => $options._Focus && $options._Focus(...args)),
|
||||
s: common_vendor.o$1((...args) => $options.onConfirm && $options.onConfirm(...args)),
|
||||
t: common_vendor.o$1((...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args))
|
||||
p: common_vendor.o((...args) => $options.onInput && $options.onInput(...args)),
|
||||
q: common_vendor.o((...args) => $options._Blur && $options._Blur(...args)),
|
||||
r: common_vendor.o((...args) => $options._Focus && $options._Focus(...args)),
|
||||
s: common_vendor.o((...args) => $options.onConfirm && $options.onConfirm(...args)),
|
||||
t: common_vendor.o((...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args))
|
||||
} : {
|
||||
v: $props.type === "password" ? "text" : $props.type,
|
||||
w: common_vendor.s($options.inputStyle),
|
||||
@@ -426,18 +426,18 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
F: $props.confirmType,
|
||||
G: $props.cursorSpacing,
|
||||
H: $props.adjustPosition,
|
||||
I: common_vendor.o$1((...args) => $options._Focus && $options._Focus(...args)),
|
||||
J: common_vendor.o$1((...args) => $options._Blur && $options._Blur(...args)),
|
||||
K: common_vendor.o$1((...args) => $options.onInput && $options.onInput(...args)),
|
||||
L: common_vendor.o$1((...args) => $options.onConfirm && $options.onConfirm(...args)),
|
||||
M: common_vendor.o$1((...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args))
|
||||
I: common_vendor.o((...args) => $options._Focus && $options._Focus(...args)),
|
||||
J: common_vendor.o((...args) => $options._Blur && $options._Blur(...args)),
|
||||
K: common_vendor.o((...args) => $options.onInput && $options.onInput(...args)),
|
||||
L: common_vendor.o((...args) => $options.onConfirm && $options.onConfirm(...args)),
|
||||
M: common_vendor.o((...args) => $options.onkeyboardheightchange && $options.onkeyboardheightchange(...args))
|
||||
}, {
|
||||
N: $props.type === "password" && $props.passwordIcon
|
||||
}, $props.type === "password" && $props.passwordIcon ? common_vendor.e({
|
||||
O: $options.isVal
|
||||
}, $options.isVal ? {
|
||||
P: $props.type === "textarea" ? 1 : "",
|
||||
Q: common_vendor.o$1($options.onEyes),
|
||||
Q: common_vendor.o($options.onEyes),
|
||||
R: common_vendor.p({
|
||||
type: $data.showPassword ? "eye-slash-filled" : "eye-filled",
|
||||
size: 22,
|
||||
@@ -448,7 +448,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
}, $props.suffixIcon ? common_vendor.e({
|
||||
T: $props.suffixIcon
|
||||
}, $props.suffixIcon ? {
|
||||
U: common_vendor.o$1(($event) => $options.onClickIcon("suffix")),
|
||||
U: common_vendor.o(($event) => $options.onClickIcon("suffix")),
|
||||
V: common_vendor.p({
|
||||
type: $props.suffixIcon,
|
||||
color: "#c0c4cc",
|
||||
@@ -458,7 +458,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
W: $props.clearable && $options.isVal && !$props.disabled && $props.type !== "textarea"
|
||||
}, $props.clearable && $options.isVal && !$props.disabled && $props.type !== "textarea" ? {
|
||||
X: $props.type === "textarea" ? 1 : "",
|
||||
Y: common_vendor.o$1($options.onClear),
|
||||
Y: common_vendor.o($options.onClear),
|
||||
Z: common_vendor.p({
|
||||
type: "clear",
|
||||
size: $props.clearSize,
|
||||
|
||||
@@ -65,7 +65,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
b: common_vendor.n("uniui-" + $props.type),
|
||||
c: common_vendor.n($props.customPrefix),
|
||||
d: common_vendor.n($props.customPrefix ? $props.type : ""),
|
||||
e: common_vendor.o$1((...args) => $options._onClick && $options._onClick(...args))
|
||||
e: common_vendor.o((...args) => $options._onClick && $options._onClick(...args))
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
|
||||
@@ -133,20 +133,20 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: $data.inputValue <= $props.min || $props.disabled ? 1 : "",
|
||||
b: $props.color,
|
||||
c: common_vendor.o$1(($event) => $options._calcValue("minus")),
|
||||
c: common_vendor.o(($event) => $options._calcValue("minus")),
|
||||
d: $props.background,
|
||||
e: $props.disabled,
|
||||
f: common_vendor.o$1((...args) => $options._onFocus && $options._onFocus(...args)),
|
||||
g: common_vendor.o$1((...args) => $options._onBlur && $options._onBlur(...args)),
|
||||
f: common_vendor.o((...args) => $options._onFocus && $options._onFocus(...args)),
|
||||
g: common_vendor.o((...args) => $options._onBlur && $options._onBlur(...args)),
|
||||
h: $props.step < 1 ? "digit" : "number",
|
||||
i: $props.background,
|
||||
j: $props.color,
|
||||
k: $options.widthWithPx,
|
||||
l: $data.inputValue,
|
||||
m: common_vendor.o$1(($event) => $data.inputValue = $event.detail.value),
|
||||
m: common_vendor.o(($event) => $data.inputValue = $event.detail.value),
|
||||
n: $data.inputValue >= $props.max || $props.disabled ? 1 : "",
|
||||
o: $props.color,
|
||||
p: common_vendor.o$1(($event) => $options._calcValue("plus")),
|
||||
p: common_vendor.o(($event) => $options._calcValue("plus")),
|
||||
q: $props.background
|
||||
};
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
}, $data.showPopup ? common_vendor.e({
|
||||
b: $data.maskShow
|
||||
}, $data.maskShow ? {
|
||||
c: common_vendor.o$1($options.onTap),
|
||||
c: common_vendor.o($options.onTap),
|
||||
d: common_vendor.p({
|
||||
name: "mask",
|
||||
["mode-class"]: "fade",
|
||||
@@ -378,8 +378,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
} : {}, {
|
||||
e: common_vendor.s($options.getStyles),
|
||||
f: common_vendor.n($data.popupstyle),
|
||||
g: common_vendor.o$1((...args) => $options.clear && $options.clear(...args)),
|
||||
h: common_vendor.o$1($options.onTap),
|
||||
g: common_vendor.o((...args) => $options.clear && $options.clear(...args)),
|
||||
h: common_vendor.o($options.onTap),
|
||||
i: common_vendor.p({
|
||||
["mode-class"]: $data.ani,
|
||||
name: "content",
|
||||
@@ -387,7 +387,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
duration: $data.duration,
|
||||
show: $data.showTrans
|
||||
}),
|
||||
j: common_vendor.o$1((...args) => $options.touchstart && $options.touchstart(...args)),
|
||||
j: common_vendor.o((...args) => $options.touchstart && $options.touchstart(...args)),
|
||||
k: common_vendor.n($data.popupstyle),
|
||||
l: common_vendor.n($options.isDesktop ? "fixforpc-z-index" : "")
|
||||
}) : {});
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
let bindIngXMixins = {};
|
||||
exports.bindIngXMixins = bindIngXMixins;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-swipe-action/components/uni-swipe-action-item/bindingx.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
let otherMixins = {};
|
||||
exports.otherMixins = otherMixins;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpother.js.map
|
||||
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
let mpMixins = {};
|
||||
mpMixins = {
|
||||
data() {
|
||||
return {
|
||||
is_show: "none"
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
show(newVal) {
|
||||
this.is_show = this.show;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.swipeaction = this.getSwipeAction();
|
||||
if (this.swipeaction && Array.isArray(this.swipeaction.children)) {
|
||||
this.swipeaction.children.push(this);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.is_show = this.show;
|
||||
},
|
||||
methods: {
|
||||
// wxs 中调用
|
||||
closeSwipe(e) {
|
||||
if (this.autoClose && this.swipeaction) {
|
||||
this.swipeaction.closeOther(this);
|
||||
}
|
||||
},
|
||||
change(e) {
|
||||
this.$emit("change", e.open);
|
||||
if (this.is_show !== e.open) {
|
||||
this.is_show = e.open;
|
||||
}
|
||||
},
|
||||
appTouchStart(e) {
|
||||
const {
|
||||
clientX
|
||||
} = e.changedTouches[0];
|
||||
this.clientX = clientX;
|
||||
this.timestamp = (/* @__PURE__ */ new Date()).getTime();
|
||||
},
|
||||
appTouchEnd(e, index, item, position) {
|
||||
const {
|
||||
clientX
|
||||
} = e.changedTouches[0];
|
||||
let diff = Math.abs(this.clientX - clientX);
|
||||
let time = (/* @__PURE__ */ new Date()).getTime() - this.timestamp;
|
||||
if (diff < 40 && time < 300) {
|
||||
this.$emit("click", {
|
||||
content: item,
|
||||
index,
|
||||
position
|
||||
});
|
||||
}
|
||||
},
|
||||
onClickForPC(index, item, position) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
const mpwxs = mpMixins;
|
||||
exports.mpwxs = mpwxs;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-swipe-action/components/uni-swipe-action-item/mpwxs.js.map
|
||||
@@ -0,0 +1,120 @@
|
||||
"use strict";
|
||||
const uni_modules_uniSwipeAction_components_uniSwipeActionItem_mpwxs = require("./mpwxs.js");
|
||||
const uni_modules_uniSwipeAction_components_uniSwipeActionItem_bindingx = require("./bindingx.js");
|
||||
const uni_modules_uniSwipeAction_components_uniSwipeActionItem_mpother = require("./mpother.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const block0 = (Component2) => {
|
||||
if (!Component2.wxsCallMethods) {
|
||||
Component2.wxsCallMethods = [];
|
||||
}
|
||||
Component2.wxsCallMethods.push("closeSwipe", "change");
|
||||
};
|
||||
const block1 = {};
|
||||
const _sfc_main = {
|
||||
mixins: [uni_modules_uniSwipeAction_components_uniSwipeActionItem_mpwxs.mpwxs, uni_modules_uniSwipeAction_components_uniSwipeActionItem_bindingx.bindIngXMixins, uni_modules_uniSwipeAction_components_uniSwipeActionItem_mpother.otherMixins],
|
||||
emits: ["click", "change"],
|
||||
props: {
|
||||
// 控制开关
|
||||
show: {
|
||||
type: String,
|
||||
default: "none"
|
||||
},
|
||||
// 禁用
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 是否自动关闭
|
||||
autoClose: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 滑动缺省距离
|
||||
threshold: {
|
||||
type: Number,
|
||||
default: 20
|
||||
},
|
||||
// 左侧按钮内容
|
||||
leftOptions: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
// 右侧按钮内容
|
||||
rightOptions: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
// TODO vue3
|
||||
unmounted() {
|
||||
this.__isUnmounted = true;
|
||||
this.uninstall();
|
||||
},
|
||||
methods: {
|
||||
uninstall() {
|
||||
if (this.swipeaction) {
|
||||
this.swipeaction.children.forEach((item, index) => {
|
||||
if (item === this) {
|
||||
this.swipeaction.children.splice(index, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取父元素实例
|
||||
*/
|
||||
getSwipeAction(name = "uniSwipeAction") {
|
||||
let parent = this.$parent;
|
||||
let parentName = parent.$options.name;
|
||||
while (parentName !== name) {
|
||||
parent = parent.$parent;
|
||||
if (!parent)
|
||||
return false;
|
||||
parentName = parent.$options.name;
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.f($props.leftOptions, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.text),
|
||||
b: item.style && item.style.color ? item.style.color : "#FFFFFF",
|
||||
c: item.style && item.style.fontSize ? item.style.fontSize : "16px",
|
||||
d: index,
|
||||
e: item.style && item.style.backgroundColor ? item.style.backgroundColor : "#C7C6CD",
|
||||
f: common_vendor.o((...args) => _ctx.appTouchStart && _ctx.appTouchStart(...args), index),
|
||||
g: common_vendor.o(($event) => _ctx.appTouchEnd($event, index, item, "left"), index),
|
||||
h: common_vendor.o(($event) => _ctx.onClickForPC(index, item, "left"), index)
|
||||
};
|
||||
}),
|
||||
b: common_vendor.f($props.rightOptions, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.text),
|
||||
b: item.style && item.style.color ? item.style.color : "#FFFFFF",
|
||||
c: item.style && item.style.fontSize ? item.style.fontSize : "16px",
|
||||
d: index,
|
||||
e: item.style && item.style.backgroundColor ? item.style.backgroundColor : "#C7C6CD",
|
||||
f: common_vendor.o((...args) => _ctx.appTouchStart && _ctx.appTouchStart(...args), index),
|
||||
g: common_vendor.o(($event) => _ctx.appTouchEnd($event, index, item, "right"), index),
|
||||
h: common_vendor.o(($event) => _ctx.onClickForPC(index, item, "right"), index)
|
||||
};
|
||||
}),
|
||||
c: _ctx.is_show,
|
||||
d: $props.threshold,
|
||||
e: $props.disabled
|
||||
};
|
||||
}
|
||||
if (typeof block0 === "function")
|
||||
block0(_sfc_main);
|
||||
if (typeof block1 === "function")
|
||||
block1(_sfc_main);
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<wxs src="./wx.wxs" module="wxsswipe"/>
|
||||
<view class="uni-swipe"><view class="uni-swipe_box" change:prop="{{wxsswipe.showWatch}}" prop="{{c}}" data-threshold="{{d}}" data-disabled="{{e}}" bindtouchstart="{{wxsswipe.touchstart}}" bindtouchmove="{{wxsswipe.touchmove}}" bindtouchend="{{wxsswipe.touchend}}"><view class="uni-swipe_button-group button-group--left"><block wx:if="{{$slots.left}}"><slot name="left"></slot></block><block wx:else><view wx:for="{{a}}" wx:for-item="item" wx:key="d" style="{{'background-color:' + item.e}}" class="uni-swipe_button button-hock" catchtouchstart="{{item.f}}" catchtouchend="{{item.g}}" catchtap="{{item.h}}"><text class="uni-swipe_button-text" style="{{'color:' + item.b + ';' + ('font-size:' + item.c)}}">{{item.a}}</text></view></block></view><view class="uni-swipe_text--center"><slot></slot></view><view class="uni-swipe_button-group button-group--right"><block wx:if="{{$slots.right}}"><slot name="right"></slot></block><block wx:else><view wx:for="{{b}}" wx:for-item="item" wx:key="d" style="{{'background-color:' + item.e}}" class="uni-swipe_button button-hock" catchtouchstart="{{item.f}}" catchtouchend="{{item.g}}" catchtap="{{item.h}}"><text class="uni-swipe_button-text" style="{{'color:' + item.b + ';' + ('font-size:' + item.c)}}">{{item.a}}</text></view></block></view></view></view>
|
||||
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.uni-swipe {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.uni-swipe_box {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
}
|
||||
.uni-swipe_text--center {
|
||||
width: 100%;
|
||||
cursor: grab;
|
||||
}
|
||||
.uni-swipe_button-group {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.button-group--left {
|
||||
left: 0;
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
.button-group--right {
|
||||
right: 0;
|
||||
transform: translateX(100%);
|
||||
}
|
||||
.uni-swipe_button {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
}
|
||||
.uni-swipe_button-text {
|
||||
flex-shrink: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
.ani {
|
||||
transition-property: transform;
|
||||
transition-duration: 0.3s;
|
||||
transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
|
||||
}
|
||||
349
unpackage/dist/dev/mp-weixin/uni_modules/uni-swipe-action/components/uni-swipe-action-item/wx.wxs
vendored
Normal file
349
unpackage/dist/dev/mp-weixin/uni_modules/uni-swipe-action/components/uni-swipe-action-item/wx.wxs
vendored
Normal file
@@ -0,0 +1,349 @@
|
||||
var MIN_DISTANCE = 10;
|
||||
|
||||
/**
|
||||
* 判断当前是否为H5、app-vue
|
||||
*/
|
||||
var IS_HTML5 = false
|
||||
if (typeof window === 'object') IS_HTML5 = true
|
||||
|
||||
/**
|
||||
* 监听页面内值的变化,主要用于动态开关swipe-action
|
||||
* @param {Object} newValue
|
||||
* @param {Object} oldValue
|
||||
* @param {Object} ownerInstance
|
||||
* @param {Object} instance
|
||||
*/
|
||||
function showWatch(newVal, oldVal, ownerInstance, instance) {
|
||||
var state = instance.getState()
|
||||
getDom(instance, ownerInstance)
|
||||
if (newVal && newVal !== 'none') {
|
||||
openState(newVal, instance, ownerInstance)
|
||||
return
|
||||
}
|
||||
|
||||
if (state.left) {
|
||||
openState('none', instance, ownerInstance)
|
||||
}
|
||||
resetTouchStatus(instance)
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始触摸操作
|
||||
* @param {Object} e
|
||||
* @param {Object} ins
|
||||
*/
|
||||
function touchstart(e, ownerInstance) {
|
||||
var instance = e.instance;
|
||||
var disabled = instance.getDataset().disabled
|
||||
var state = instance.getState();
|
||||
getDom(instance, ownerInstance)
|
||||
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
||||
disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
|
||||
if (disabled) return
|
||||
// 开始触摸时移除动画类
|
||||
instance.requestAnimationFrame(function() {
|
||||
instance.removeClass('ani');
|
||||
ownerInstance.callMethod('closeSwipe');
|
||||
})
|
||||
|
||||
// 记录上次的位置
|
||||
state.x = state.left || 0
|
||||
// 计算滑动开始位置
|
||||
stopTouchStart(e, ownerInstance)
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始滑动操作
|
||||
* @param {Object} e
|
||||
* @param {Object} ownerInstance
|
||||
*/
|
||||
function touchmove(e, ownerInstance) {
|
||||
var instance = e.instance;
|
||||
var disabled = instance.getDataset().disabled
|
||||
var state = instance.getState()
|
||||
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
||||
disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
|
||||
if (disabled) return
|
||||
// 是否可以滑动页面
|
||||
stopTouchMove(e);
|
||||
if (state.direction !== 'horizontal') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.preventDefault) {
|
||||
// 阻止页面滚动
|
||||
e.preventDefault()
|
||||
}
|
||||
|
||||
move(state.x + state.deltaX, instance, ownerInstance)
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束触摸操作
|
||||
* @param {Object} e
|
||||
* @param {Object} ownerInstance
|
||||
*/
|
||||
function touchend(e, ownerInstance) {
|
||||
var instance = e.instance;
|
||||
var disabled = instance.getDataset().disabled
|
||||
var state = instance.getState()
|
||||
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
||||
disabled = (typeof(disabled) === 'string' ? JSON.parse(disabled) : disabled) || false;
|
||||
|
||||
if (disabled) return
|
||||
// 滑动过程中触摸结束,通过阙值判断是开启还是关闭
|
||||
// fixed by mehaotian 定时器解决点击按钮,touchend 触发比 click 事件时机早的问题 ,主要是 ios13
|
||||
moveDirection(state.left, instance, ownerInstance)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置移动距离
|
||||
* @param {Object} value
|
||||
* @param {Object} instance
|
||||
* @param {Object} ownerInstance
|
||||
*/
|
||||
function move(value, instance, ownerInstance) {
|
||||
value = value || 0
|
||||
var state = instance.getState()
|
||||
var leftWidth = state.leftWidth
|
||||
var rightWidth = state.rightWidth
|
||||
// 获取可滑动范围
|
||||
state.left = range(value, -rightWidth, leftWidth);
|
||||
instance.requestAnimationFrame(function() {
|
||||
instance.setStyle({
|
||||
transform: 'translateX(' + state.left + 'px)',
|
||||
'-webkit-transform': 'translateX(' + state.left + 'px)'
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取元素信息
|
||||
* @param {Object} instance
|
||||
* @param {Object} ownerInstance
|
||||
*/
|
||||
function getDom(instance, ownerInstance) {
|
||||
var state = instance.getState()
|
||||
var leftDom = ownerInstance.selectComponent('.button-group--left')
|
||||
var rightDom = ownerInstance.selectComponent('.button-group--right')
|
||||
var leftStyles = {
|
||||
width: 0
|
||||
}
|
||||
var rightStyles = {
|
||||
width: 0
|
||||
}
|
||||
|
||||
if (leftDom) {
|
||||
leftStyles = leftDom.getBoundingClientRect()
|
||||
}
|
||||
|
||||
if (rightDom) {
|
||||
rightStyles = rightDom.getBoundingClientRect()
|
||||
}
|
||||
state.leftWidth = leftStyles.width || 0
|
||||
state.rightWidth = rightStyles.width || 0
|
||||
state.threshold = instance.getDataset().threshold
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取范围
|
||||
* @param {Object} num
|
||||
* @param {Object} min
|
||||
* @param {Object} max
|
||||
*/
|
||||
function range(num, min, max) {
|
||||
return Math.min(Math.max(num, min), max);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 移动方向判断
|
||||
* @param {Object} left
|
||||
* @param {Object} value
|
||||
* @param {Object} ownerInstance
|
||||
* @param {Object} ins
|
||||
*/
|
||||
function moveDirection(left, ins, ownerInstance) {
|
||||
var state = ins.getState()
|
||||
var threshold = state.threshold
|
||||
var position = state.position
|
||||
var isopen = state.isopen || 'none'
|
||||
var leftWidth = state.leftWidth
|
||||
var rightWidth = state.rightWidth
|
||||
if (state.deltaX === 0) {
|
||||
openState('none', ins, ownerInstance)
|
||||
return
|
||||
}
|
||||
if ((isopen === 'none' && rightWidth > 0 && -left > threshold) || (isopen !== 'none' && rightWidth > 0 &&
|
||||
rightWidth +
|
||||
left < threshold)) {
|
||||
// right
|
||||
openState('right', ins, ownerInstance)
|
||||
} else if ((isopen === 'none' && leftWidth > 0 && left > threshold) || (isopen !== 'none' && leftWidth > 0 &&
|
||||
leftWidth - left < threshold)) {
|
||||
// left
|
||||
openState('left', ins, ownerInstance)
|
||||
} else {
|
||||
// default
|
||||
openState('none', ins, ownerInstance)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 开启状态
|
||||
* @param {Boolean} type
|
||||
* @param {Object} ins
|
||||
* @param {Object} ownerInstance
|
||||
*/
|
||||
function openState(type, ins, ownerInstance) {
|
||||
var state = ins.getState()
|
||||
var leftWidth = state.leftWidth
|
||||
var rightWidth = state.rightWidth
|
||||
var left = ''
|
||||
state.isopen = state.isopen ? state.isopen : 'none'
|
||||
switch (type) {
|
||||
case "left":
|
||||
left = leftWidth
|
||||
break
|
||||
case "right":
|
||||
left = -rightWidth
|
||||
break
|
||||
default:
|
||||
left = 0
|
||||
}
|
||||
|
||||
// && !state.throttle
|
||||
|
||||
if (state.isopen !== type) {
|
||||
state.throttle = true
|
||||
ownerInstance.callMethod('change', {
|
||||
open: type
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
state.isopen = type
|
||||
// 添加动画类
|
||||
ins.requestAnimationFrame(function() {
|
||||
ins.addClass('ani');
|
||||
move(left, ins, ownerInstance)
|
||||
})
|
||||
// 设置最终移动位置,理论上只要进入到这个函数,肯定是要打开的
|
||||
}
|
||||
|
||||
|
||||
function getDirection(x, y) {
|
||||
if (x > y && x > MIN_DISTANCE) {
|
||||
return 'horizontal';
|
||||
}
|
||||
if (y > x && y > MIN_DISTANCE) {
|
||||
return 'vertical';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置滑动状态
|
||||
* @param {Object} event
|
||||
*/
|
||||
function resetTouchStatus(instance) {
|
||||
var state = instance.getState();
|
||||
state.direction = '';
|
||||
state.deltaX = 0;
|
||||
state.deltaY = 0;
|
||||
state.offsetX = 0;
|
||||
state.offsetY = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置滑动开始位置
|
||||
* @param {Object} event
|
||||
*/
|
||||
function stopTouchStart(event) {
|
||||
var instance = event.instance;
|
||||
var state = instance.getState();
|
||||
resetTouchStatus(instance);
|
||||
var touch = event.touches[0];
|
||||
if (IS_HTML5 && isPC()) {
|
||||
touch = event;
|
||||
}
|
||||
state.startX = touch.clientX;
|
||||
state.startY = touch.clientY;
|
||||
}
|
||||
|
||||
/**
|
||||
* 滑动中,是否禁止打开
|
||||
* @param {Object} event
|
||||
*/
|
||||
function stopTouchMove(event) {
|
||||
var instance = event.instance;
|
||||
var state = instance.getState();
|
||||
var touch = event.touches[0];
|
||||
if (IS_HTML5 && isPC()) {
|
||||
touch = event;
|
||||
}
|
||||
state.deltaX = touch.clientX - state.startX;
|
||||
state.deltaY = touch.clientY - state.startY;
|
||||
state.offsetY = Math.abs(state.deltaY);
|
||||
state.offsetX = Math.abs(state.deltaX);
|
||||
state.direction = state.direction || getDirection(state.offsetX, state.offsetY);
|
||||
}
|
||||
|
||||
function isPC() {
|
||||
var userAgentInfo = navigator.userAgent;
|
||||
var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
|
||||
var flag = true;
|
||||
for (var v = 0; v < Agents.length - 1; v++) {
|
||||
if (userAgentInfo.indexOf(Agents[v]) > 0) {
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(userAgentInfo.indexOf('Phone') > 0 && userAgentInfo.indexOf('Harmony') > 0){
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
var movable = false
|
||||
|
||||
function mousedown(e, ins) {
|
||||
if (!IS_HTML5) return
|
||||
if (!isPC()) return
|
||||
touchstart(e, ins)
|
||||
movable = true
|
||||
}
|
||||
|
||||
function mousemove(e, ins) {
|
||||
if (!IS_HTML5) return
|
||||
if (!isPC()) return
|
||||
if (!movable) return
|
||||
touchmove(e, ins)
|
||||
}
|
||||
|
||||
function mouseup(e, ins) {
|
||||
if (!IS_HTML5) return
|
||||
if (!isPC()) return
|
||||
touchend(e, ins)
|
||||
movable = false
|
||||
}
|
||||
|
||||
function mouseleave(e, ins) {
|
||||
if (!IS_HTML5) return
|
||||
if (!isPC()) return
|
||||
movable = false
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
showWatch: showWatch,
|
||||
touchstart: touchstart,
|
||||
touchmove: touchmove,
|
||||
touchend: touchend,
|
||||
mousedown: mousedown,
|
||||
mousemove: mousemove,
|
||||
mouseup: mouseup,
|
||||
mouseleave: mouseleave
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "uniSwipeAction",
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.children = [];
|
||||
},
|
||||
methods: {
|
||||
// 公开给用户使用,重制组件样式
|
||||
resize() {
|
||||
},
|
||||
// 公开给用户使用,关闭全部 已经打开的组件
|
||||
closeAll() {
|
||||
this.children.forEach((vm) => {
|
||||
vm.is_show = "none";
|
||||
});
|
||||
},
|
||||
closeOther(vm) {
|
||||
if (this.openItem && this.openItem !== vm) {
|
||||
this.openItem.is_show = "none";
|
||||
}
|
||||
this.openItem = vm;
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view><slot></slot></view>
|
||||
@@ -261,7 +261,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
b: $data.animationData,
|
||||
c: common_vendor.n($props.customClass),
|
||||
d: common_vendor.s($options.transformStyles),
|
||||
e: common_vendor.o$1((...args) => $options.onClick && $options.onClick(...args))
|
||||
e: common_vendor.o((...args) => $options.onClick && $options.onClick(...args))
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
|
||||
@@ -136,10 +136,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
b: $data.currentValue ? $options.currentLabel : $props.placeholder,
|
||||
c: $props.fontSize + "px",
|
||||
d: $data.currentValue ? $props.textColor : $props.placeholderColor,
|
||||
e: common_vendor.o$1(() => {
|
||||
e: common_vendor.o(() => {
|
||||
}),
|
||||
f: common_vendor.o$1([($event) => $data.searchQuery = $event.detail.value, (...args) => $options.onSearch && $options.onSearch(...args)]),
|
||||
g: common_vendor.o$1((...args) => $options.handleFocus && $options.handleFocus(...args)),
|
||||
f: common_vendor.o([($event) => $data.searchQuery = $event.detail.value, (...args) => $options.onSearch && $options.onSearch(...args)]),
|
||||
g: common_vendor.o((...args) => $options.handleFocus && $options.handleFocus(...args)),
|
||||
h: $data.searchQuery
|
||||
} : {
|
||||
i: common_vendor.t($options.currentLabel || $props.placeholder),
|
||||
@@ -148,7 +148,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
}, {
|
||||
l: $props.clearable && $data.currentValue && !$props.disabled
|
||||
}, $props.clearable && $data.currentValue && !$props.disabled ? {
|
||||
m: common_vendor.o$1((...args) => $options.clearValue && $options.clearValue(...args))
|
||||
m: common_vendor.o((...args) => $options.clearValue && $options.clearValue(...args))
|
||||
} : {
|
||||
n: $props.placeholderColor
|
||||
}, {
|
||||
@@ -158,10 +158,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
r: $props.backgroundColor,
|
||||
s: $props.borderColor,
|
||||
t: $props.borderRadius + "px",
|
||||
v: common_vendor.o$1((...args) => $options.togglePicker && $options.togglePicker(...args)),
|
||||
v: common_vendor.o((...args) => $options.togglePicker && $options.togglePicker(...args)),
|
||||
w: $data.isOpen
|
||||
}, $data.isOpen ? common_vendor.e({
|
||||
x: common_vendor.o$1((...args) => $options.togglePicker && $options.togglePicker(...args)),
|
||||
x: common_vendor.o((...args) => $options.togglePicker && $options.togglePicker(...args)),
|
||||
y: $options.filteredOptions.length > 0
|
||||
}, $options.filteredOptions.length > 0 ? {
|
||||
z: common_vendor.f($options.filteredOptions, (item, index, i0) => {
|
||||
@@ -172,7 +172,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
d: $data.currentValue === item.value ? 1 : "",
|
||||
e: item.disabled ? $props.placeholderColor : $props.textColor,
|
||||
f: $data.currentValue === item.value ? $props.activeColor + "20" : $props.backgroundColor,
|
||||
g: common_vendor.o$1(($event) => $options.selectOption(item, index), item.value)
|
||||
g: common_vendor.o(($event) => $options.selectOption(item, index), item.value)
|
||||
};
|
||||
}),
|
||||
A: $props.fontSize + "px"
|
||||
|
||||
Reference in New Issue
Block a user