easy-email-pro-theme 1.24.0 → 1.25.0
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 +15 -16
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -18041,31 +18041,30 @@ function LineHeight(props) {
|
|
|
18041
18041
|
const fallbackValue = props.fallbackValue || get(defaultElement, props.name);
|
|
18042
18042
|
const value = getFieldValue(props.path, props.name) || fallbackValue;
|
|
18043
18043
|
const fontSize = ((_a = getFieldValue(props.path, "font-size") || get(defaultElement, props.name.replace("line-height", "font-size"))) == null ? void 0 : _a.replace("px", "")) || 16;
|
|
18044
|
-
const unit =
|
|
18044
|
+
const unit = useMemo$1(() => {
|
|
18045
|
+
if (String(value).indexOf("px") !== -1) {
|
|
18046
|
+
return "px";
|
|
18047
|
+
}
|
|
18048
|
+
if (String(value).indexOf("%") !== -1) {
|
|
18049
|
+
return "%";
|
|
18050
|
+
}
|
|
18051
|
+
return "";
|
|
18052
|
+
}, [value]);
|
|
18045
18053
|
const onChangeUnit = useCallback$1(
|
|
18046
18054
|
(unit2) => {
|
|
18047
|
-
var _a2, _b;
|
|
18048
18055
|
if (unit2 === "px") {
|
|
18049
|
-
const val = ((_a2 = value.toString()) == null ? void 0 : _a2.replace("%", "")) || "100";
|
|
18050
18056
|
setFieldValue(
|
|
18051
18057
|
props.path,
|
|
18052
18058
|
props.name,
|
|
18053
|
-
`${(
|
|
18059
|
+
`${(1.2 * fontSize).toFixed(0)}px`
|
|
18054
18060
|
);
|
|
18061
|
+
} else if (unit2 === "%") {
|
|
18062
|
+
setFieldValue(props.path, props.name, "120%");
|
|
18055
18063
|
} else {
|
|
18056
|
-
|
|
18057
|
-
if (val) {
|
|
18058
|
-
setFieldValue(
|
|
18059
|
-
props.path,
|
|
18060
|
-
props.name,
|
|
18061
|
-
(val / fontSize * 100).toFixed(0) + "%"
|
|
18062
|
-
);
|
|
18063
|
-
} else {
|
|
18064
|
-
setFieldValue(props.path, props.name, "120%");
|
|
18065
|
-
}
|
|
18064
|
+
setFieldValue(props.path, props.name, "1.2");
|
|
18066
18065
|
}
|
|
18067
18066
|
},
|
|
18068
|
-
[fontSize, props.name, props.path, setFieldValue
|
|
18067
|
+
[fontSize, props.name, props.path, setFieldValue]
|
|
18069
18068
|
);
|
|
18070
18069
|
return useMemo$1(() => {
|
|
18071
18070
|
const adapter = {
|
|
@@ -18107,7 +18106,7 @@ function LineHeight(props) {
|
|
|
18107
18106
|
},
|
|
18108
18107
|
wrapperCol: { span: 24 }
|
|
18109
18108
|
},
|
|
18110
|
-
/* @__PURE__ */ React__default.createElement(Select$1, { value: unit, onChange: onChangeUnit }, /* @__PURE__ */ React__default.createElement(Select$1.Option, { value: "" }, t("%")), /* @__PURE__ */ React__default.createElement(Select$1.Option, { value: "px" }, t("px")))
|
|
18109
|
+
/* @__PURE__ */ React__default.createElement(Select$1, { value: unit, onChange: onChangeUnit }, /* @__PURE__ */ React__default.createElement(Select$1.Option, { value: "" }, " "), /* @__PURE__ */ React__default.createElement(Select$1.Option, { value: "%" }, t("%")), /* @__PURE__ */ React__default.createElement(Select$1.Option, { value: "px" }, t("px")))
|
|
18111
18110
|
)));
|
|
18112
18111
|
}, [label, onChangeUnit, props, unit]);
|
|
18113
18112
|
}
|