x-block-lib 0.6.23 → 0.6.24
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/dist/index.js +28 -25
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1954,38 +1954,41 @@ const zh = (e, t) => {
|
|
|
1954
1954
|
const i = this.getInput("DUMMY");
|
|
1955
1955
|
if (!i)
|
|
1956
1956
|
return;
|
|
1957
|
-
|
|
1958
|
-
|
|
1957
|
+
let s = this.value;
|
|
1958
|
+
s || (s = void 0);
|
|
1959
|
+
const a = t.find((d) => d.validator(s));
|
|
1960
|
+
if (!a)
|
|
1959
1961
|
return;
|
|
1960
1962
|
i.removeField("VALUE", !0), i.removeField("SUFFIX", !0);
|
|
1961
|
-
let
|
|
1962
|
-
if (
|
|
1963
|
-
const
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
1 / Math.pow(10,
|
|
1969
|
-
(
|
|
1970
|
-
this.value =
|
|
1963
|
+
let c, l;
|
|
1964
|
+
if (a.ui === "pixelInput") {
|
|
1965
|
+
const d = Bc(this.value) ?? 0;
|
|
1966
|
+
c = new Rs(
|
|
1967
|
+
d,
|
|
1968
|
+
a.min,
|
|
1969
|
+
a.max,
|
|
1970
|
+
a.precision ? 1 / Math.pow(10, a.precision) : null,
|
|
1971
|
+
(_) => {
|
|
1972
|
+
this.value = _ + "px";
|
|
1971
1973
|
}
|
|
1972
|
-
),
|
|
1973
|
-
} else if (
|
|
1974
|
-
const
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
(
|
|
1981
|
-
this.value =
|
|
1974
|
+
), l = "px";
|
|
1975
|
+
} else if (a.ui === "percentInput") {
|
|
1976
|
+
const d = Rc(this.value) ?? 0;
|
|
1977
|
+
c = new Rs(
|
|
1978
|
+
d,
|
|
1979
|
+
a.min,
|
|
1980
|
+
a.max,
|
|
1981
|
+
a.precision ? 1 / Math.pow(10, a.precision) : null,
|
|
1982
|
+
(_) => {
|
|
1983
|
+
this.value = _ + "%";
|
|
1982
1984
|
}
|
|
1983
|
-
),
|
|
1985
|
+
), l = "%";
|
|
1984
1986
|
}
|
|
1985
|
-
|
|
1987
|
+
c && i.appendField(c, "VALUE"), l && i.appendField(l, "SUFFIX");
|
|
1986
1988
|
},
|
|
1987
1989
|
checkWarning_: function() {
|
|
1988
|
-
|
|
1990
|
+
let i = this.value;
|
|
1991
|
+
if (i || (i = void 0), !t.find((a) => a.validator(i))) {
|
|
1989
1992
|
this.setWarningText(m.WARN_TYPE_NOT_AVAILABLE);
|
|
1990
1993
|
return;
|
|
1991
1994
|
}
|