live change value text
This commit is contained in:
@@ -12,12 +12,21 @@ const getFontFamily = (fontFamily?: string): string => {
|
||||
};
|
||||
|
||||
const getFontWeight = (fontWeight?: string): string => {
|
||||
if (!fontWeight) return "normal";
|
||||
|
||||
// اگر عدد است، مستقیماً برگردان
|
||||
const numValue = parseInt(fontWeight);
|
||||
if (!isNaN(numValue)) {
|
||||
return numValue.toString();
|
||||
}
|
||||
|
||||
// برای مقادیر string قدیمی
|
||||
const weightMap: Record<string, string> = {
|
||||
bold: "bold",
|
||||
normal: "normal",
|
||||
"300": "300",
|
||||
};
|
||||
return weightMap[fontWeight || "normal"] || "normal";
|
||||
return weightMap[fontWeight] || "normal";
|
||||
};
|
||||
|
||||
const getColorWithOpacity = (fill?: string, opacity?: number): string => {
|
||||
|
||||
Reference in New Issue
Block a user