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.
Files changed (2) hide show
  1. package/dist/index.js +28 -25
  2. 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
- const s = t.find((l) => l.validator(this.value));
1958
- if (!s)
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 a, c;
1962
- if (s.ui === "pixelInput") {
1963
- const l = Bc(this.value) ?? 0;
1964
- a = new Rs(
1965
- l,
1966
- s.min,
1967
- s.max,
1968
- 1 / Math.pow(10, s.precision ?? 15),
1969
- (d) => {
1970
- this.value = d + "px";
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
- ), c = "px";
1973
- } else if (s.ui === "percentInput") {
1974
- const l = Rc(this.value) ?? 0;
1975
- a = new Rs(
1976
- l,
1977
- s.min,
1978
- s.max,
1979
- s.precision ? 1 / Math.pow(10, s.precision) : null,
1980
- (d) => {
1981
- this.value = d + "%";
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
- ), c = "%";
1985
+ ), l = "%";
1984
1986
  }
1985
- a && i.appendField(a, "VALUE"), c && i.appendField(c, "SUFFIX");
1987
+ c && i.appendField(c, "VALUE"), l && i.appendField(l, "SUFFIX");
1986
1988
  },
1987
1989
  checkWarning_: function() {
1988
- if (!t.find((s) => s.validator(this.value))) {
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
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.6.23",
4
+ "version": "0.6.24",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",