element-assits 0.0.98 → 0.0.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +7 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2991,7 +2991,9 @@ const PC = {
|
|
|
2991
2991
|
domWidth: 0,
|
|
2992
2992
|
leftRate: 0.2,
|
|
2993
2993
|
defaultLeftRate: null,
|
|
2994
|
-
centerWidth: 0
|
|
2994
|
+
centerWidth: 0,
|
|
2995
|
+
defaultToMin: this.min,
|
|
2996
|
+
defaultToMax: this.max
|
|
2995
2997
|
};
|
|
2996
2998
|
},
|
|
2997
2999
|
computed: {
|
|
@@ -3026,7 +3028,7 @@ const PC = {
|
|
|
3026
3028
|
}).then(() => {
|
|
3027
3029
|
this.getDomSize();
|
|
3028
3030
|
const t = (r + this.centerWidth / 2) / this.domWidth;
|
|
3029
|
-
this.defaultLeftRate = t.toFixed(2) - 0, this.leftRate = this.defaultLeftRate;
|
|
3031
|
+
this.defaultLeftRate = t.toFixed(2) - 0, this.leftRate = this.defaultLeftRate, this.defaultLeftRate > this.max && (this.defaultToMax = this.defaultLeftRate), this.defaultLeftRate < this.min && (this.defaultToMin = this.defaultLeftRate);
|
|
3030
3032
|
});
|
|
3031
3033
|
else
|
|
3032
3034
|
return;
|
|
@@ -3044,7 +3046,7 @@ const PC = {
|
|
|
3044
3046
|
if (!this.isDown)
|
|
3045
3047
|
return null;
|
|
3046
3048
|
const t = r.pageX - this.domPageX;
|
|
3047
|
-
this.leftRate = Math.min(Math.max(t / this.domWidth, this.
|
|
3049
|
+
this.leftRate = Math.min(Math.max(t / this.domWidth, this.defaultToMin), this.defaultToMax);
|
|
3048
3050
|
}
|
|
3049
3051
|
}
|
|
3050
3052
|
};
|
|
@@ -3064,11 +3066,11 @@ var FC = function() {
|
|
|
3064
3066
|
t.isDown = !1;
|
|
3065
3067
|
}, mouseleave: function(a) {
|
|
3066
3068
|
t.isDown = !1;
|
|
3067
|
-
} } }, [i("div", { staticClass: "sc-left", style: { width: `calc(${t.leftRate * 100}% - ${t.centerWidth / 2}px)` } }, [t._t("left")], 2), t.defaultAlias !== 1 ?
|
|
3069
|
+
} } }, [t.defaultAlias !== 0 ? i("div", { staticClass: "sc-left", style: { width: `calc(${t.leftRate * 100}% - ${t.centerWidth / 2}px)` } }, [t._t("left")], 2) : t._e(), t.defaultAlias !== 0 && t.defaultAlias !== 1 ? i("div", { ref: "scc", staticClass: "sc-center" }, [i("div", { staticClass: "sc-bamboo", on: { mousedown: t.handleMousedown } }, t._l(8, function(a) {
|
|
3068
3070
|
return i("i", { key: a, staticClass: "sc-texture" });
|
|
3069
3071
|
}), 0), t.$slots.center ? i("div", { staticClass: "sc-on-bamboo", on: { mousedown: function(a) {
|
|
3070
3072
|
a.stopPropagation();
|
|
3071
|
-
} } }, [t._t("center")], 2) : t._e()]), i("div", { staticClass: "sc-right", style: { width: `calc(${(1 - t.leftRate) * 100}% - ${t.centerWidth / 2}px)` } }, [t._t("right")], 2)
|
|
3073
|
+
} } }, [t._t("center")], 2) : t._e()]) : t._e(), t.defaultAlias !== 1 ? i("div", { staticClass: "sc-right", style: { width: `calc(${(1 - t.leftRate) * 100}% - ${t.centerWidth / 2}px)` } }, [t._t("right")], 2) : t._e()]);
|
|
3072
3074
|
}, MC = [], BC = /* @__PURE__ */ j(
|
|
3073
3075
|
PC,
|
|
3074
3076
|
FC,
|